Unidades, rep comisiones
This commit is contained in:
163
Inventarios/CatUnidades.aspx
Normal file
163
Inventarios/CatUnidades.aspx
Normal file
@@ -0,0 +1,163 @@
|
||||
<%@ Page Title="Catálogo de Unidades" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatUnidades.aspx.vb" Inherits="Inventarios_CatUnidades" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
|
||||
<style>
|
||||
|
||||
#DivAgregarUnidad > div.modal-dialog > div label input {
|
||||
padding:0px!important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
||||
Catálogo de Unidades
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkAgregarUnidad" OnClick="LnkAgregarUnidad_Click" data-toggle="tooltip" data-placement="left" title="Agregar Unidad" Text="<i class='fa fa-plus'></i>Agregar Unidad"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCamion,Placa,Especificacion,ConfigCartaPorte,Anio,TipoPermisoSCT,NumPermisoSCT,NombreAseguradora,NumPolizaSeguro"
|
||||
EmptyDataText="No se Encontraron Unidades" ToolTip="Listado de Unidades" CssClass="table table-striped table-advance table-hover mysmallbtn" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:BoundField HeaderText="Placa" DataField="Placa" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Especificación" DataField="Especificacion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Configuración Carta Porte" DataField="ConfigCartaPorte" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Tipo Permiso SCT" DataField="TipoPermisoSCT" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Número Permiso SCT" DataField="NumPermisoSCT" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Nombre Aseguradora" DataField="NombreAseguradora" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Numero Póliza Seguro" DataField="NumPolizaSeguro" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:BoundField HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataField="FechaIng" ItemStyle-Width="15%" DataFormatString="{0:G}" />
|
||||
<asp:BoundField HeaderText="Usuario" DataField="Usuario" />
|
||||
<asp:TemplateField ItemStyle-Width="13%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" Visible="true" AlternateText="Eitar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Editar' class='fa fa-pencil' title='Editar' ></i>" />
|
||||
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Eliminar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Eliminar" data-btn-ok-label="Si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalUnidades" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div id="DivAgregarUnidad" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog rowpadding">
|
||||
<div class="modal-content" >
|
||||
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal runat="server" ID="LtlTituloModal" Text="Agregar Unidad"></asp:Literal></h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="padding:0px">
|
||||
<label for="<%= TxtPlacaNuevo.ClientID.ToString()%>" style="padding:0px">Placa:</label>
|
||||
<asp:TextBox ID="TxtPlacaNuevo" CssClass="form-control" runat="server" MaxLength="7" style="padding:0px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RfvTxtPlacaNuevo" ControlToValidate="TxtPlacaNuevo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Placa''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||
<asp:RegularExpressionValidator runat="server" ID="RevTxtPlacaNuevo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Placa''</b> no contiene los caracteres suficientes." ControlToValidate="TxtPlacaNuevo" ValidationExpression="^.{6,8}$" ValidationGroup="GrpUnidad"></asp:RegularExpressionValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="padding:0px">
|
||||
<label for="<%= TxtEspecificacionNuevo.ClientID.ToString()%>" style="padding:0px">Especificación:</label>
|
||||
<asp:TextBox ID="TxtEspecificacionNuevo" CssClass="form-control" runat="server" MaxLength="100" style="padding:0px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RfvTxtEspecificacionNuevo" ControlToValidate="TxtEspecificacionNuevo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Especificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="padding:0px">
|
||||
<label for="<%= DdlConfigAuto.ClientID.ToString()%>" style="padding:0px">Configuración Carta Porte:</label>
|
||||
<asp:DropDownList ID="DdlConfigAuto" CssClass="form-control input-sm select2me " Width="100%" runat="server" AppendDataBoundItems="true" AutoPostBack="false" CausesValidation="true" DataTextField="ClaveConfigAutoTransporteDescripcion" DataValueField="ClaveConfigAutoTransporte" style="padding:0px">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlConfigAuto" runat="server" ControlToValidate="DdlConfigAuto" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Configuración Carta Porte''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="padding:0px">
|
||||
<label for="<%= TxtAnio.ClientID.ToString()%>" style="padding:0px">Año:</label>
|
||||
<asp:TextBox ID="TxtAnio" CssClass="form-control" runat="server" MaxLength="4" style="padding:0px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtAnio" FilterType="Custom" ValidChars="1234567890" />
|
||||
<asp:RequiredFieldValidator runat="server" ID="RfvTxtAnio" ControlToValidate="TxtAnio" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Año''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="padding:0px">
|
||||
<label for="<%= TxtTipoPermisoSCT.ClientID.ToString()%>" style="padding:0px">Tipo Permiso SCT:</label>
|
||||
<asp:TextBox ID="TxtTipoPermisoSCT" CssClass="form-control" runat="server" MaxLength="10" style="padding:0px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RfvTxtTipoPermisoSCT" ControlToValidate="TxtTipoPermisoSCT" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Permiso SCT''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="padding:0px">
|
||||
<label for="<%= TxtNumermisoSCT.ClientID.ToString()%>" style="padding:0px">Numero Permiso SCT:</label>
|
||||
<asp:TextBox ID="TxtNumermisoSCT" CssClass="form-control" runat="server" MaxLength="50" style="padding:0px"></asp:TextBox>
|
||||
<%--<asp:RequiredFieldValidator runat="server" ID="RfvTxtNumermisoSCT" ControlToValidate="TxtNumermisoSCT" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Numero Permiso SCT''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>--%>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" style="padding:0px">
|
||||
<label for="<%= TxtNombreAseguradora.ClientID.ToString()%>" style="padding:0px">Nombre Aseguradora:</label>
|
||||
<asp:TextBox ID="TxtNombreAseguradora" CssClass="form-control" runat="server" MaxLength="50" style="padding:0px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RfvTxtNombreAseguradora" ControlToValidate="TxtNombreAseguradora" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre Aseguradora''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" style="padding:0px">
|
||||
<label for="<%= TxtNumPolizaSeguro.ClientID.ToString()%>" style="padding:0px">Numero Póliza Seguro:</label>
|
||||
<asp:TextBox ID="TxtNumPolizaSeguro" CssClass="form-control" runat="server" MaxLength="25" style="padding:0px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RfvTxtNumPolizaSeguro" ControlToValidate="TxtNumPolizaSeguro" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Numero Póliza Seguro''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
<asp:Button ID="BtnAgregarCamion" Text="Agregar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" OnClick="BtnAgregarCamion_Click" ValidationGroup="GrpUnidad" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
167
Inventarios/CatUnidades.aspx.vb
Normal file
167
Inventarios/CatUnidades.aspx.vb
Normal file
@@ -0,0 +1,167 @@
|
||||
Imports Extensiones
|
||||
Partial Class Inventarios_CatUnidades
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveCamion As Integer
|
||||
Get
|
||||
|
||||
If ViewState("CveCamion") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("CveCamion").ToString().ToEntero()
|
||||
End If
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
ViewState("CveCamion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub Catalogos_CatPtoSubFunsion_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
|
||||
If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjInventarios.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjInventarios.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
|
||||
Using ObjGral As New ClsGenerales
|
||||
If ObjGral.GetCartaPorteConfigAutoTransportes() Then
|
||||
DdlConfigAuto.DataSource = ObjGral.DtResultados
|
||||
End If
|
||||
End Using
|
||||
|
||||
DdlConfigAuto.DataBind()
|
||||
|
||||
UpModalUnidades.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkAgregarUnidad_Click(sender As Object, e As EventArgs)
|
||||
|
||||
CveCamion = -1
|
||||
|
||||
BtnAgregarCamion.Text = "Agregar"
|
||||
|
||||
TxtPlacaNuevo.Text = ""
|
||||
TxtEspecificacionNuevo.Text = ""
|
||||
TxtEspecificacionNuevo.Text = ""
|
||||
DdlConfigAuto.SelectedValueExist(-1)
|
||||
|
||||
TxtAnio.Text = ""
|
||||
TxtTipoPermisoSCT.Text = ""
|
||||
TxtNumermisoSCT.Text = ""
|
||||
TxtNombreAseguradora.Text = ""
|
||||
TxtNumPolizaSeguro.Text = ""
|
||||
|
||||
LtlTituloModal.Text = "Agregar Unidad"
|
||||
|
||||
UpModalUnidades.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarUnidad"))
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEditar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
BtnAgregarCamion.Text = "Actualizar"
|
||||
Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
|
||||
|
||||
CveCamion = GvRow.DataKey("CveCamion").ToEntero()
|
||||
|
||||
|
||||
TxtPlacaNuevo.Text = GvRow.DataKey("Placa")
|
||||
TxtEspecificacionNuevo.Text = GvRow.DataKey("Especificacion")
|
||||
|
||||
DdlConfigAuto.SelectedValueExist(GvRow.DataKey("ConfigCartaPorte"))
|
||||
|
||||
TxtAnio.Text = GvRow.DataKey("Anio")
|
||||
TxtTipoPermisoSCT.Text = GvRow.DataKey("TipoPermisoSCT")
|
||||
TxtNumermisoSCT.Text = GvRow.DataKey("NumPermisoSCT")
|
||||
TxtNombreAseguradora.Text = GvRow.DataKey("NombreAseguradora")
|
||||
TxtNumPolizaSeguro.Text = GvRow.DataKey("NumPolizaSeguro")
|
||||
|
||||
LtlTituloModal.Text = "Actualizar Unidad"
|
||||
|
||||
UpModalUnidades.Update()
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarUnidad"))
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ErrorAlElimiar As Boolean = False
|
||||
|
||||
Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
|
||||
|
||||
Dim CveCamionEliminar = GvRow.DataKey("CveCamion").ToEntero()
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
|
||||
If (ObjInventarios.RemoveCamiones(CveCamionEliminar, UsuarioActual.CveEmpresa)) Then
|
||||
|
||||
UpDatos.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarUnidad"))
|
||||
Alert("Unidad Eliminada Correctamente")
|
||||
Else
|
||||
ErrorAlElimiar = True
|
||||
End If
|
||||
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
If Not ErrorAlElimiar Then
|
||||
CargaDatos()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCamion_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ErrorPrceso As Boolean = False
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
|
||||
If CveCamion <= 0 Then
|
||||
If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, UsuarioActual.CveEmpresa, DdlConfigAuto.SelectedValue, TxtAnio.Text.ToEntero(), TxtTipoPermisoSCT.Text, TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario) Then
|
||||
Alert("Unidad agregada correctamente")
|
||||
Else
|
||||
ErrorPrceso = True
|
||||
End If
|
||||
Else
|
||||
If ObjInventarios.UpdateCamiones(CveCamion, TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, DdlConfigAuto.SelectedValue, TxtAnio.Text.ToEntero(), TxtTipoPermisoSCT.Text, TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Unidad actualizada correctamente")
|
||||
Else
|
||||
ErrorPrceso = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not ErrorPrceso Then
|
||||
CargaDatos()
|
||||
End If
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarUnidad"))
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
@@ -3278,7 +3278,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End Sub
|
||||
Public Sub BtnAgregarCamion_Click(sender As Object, e As EventArgs) Handles BtnAgregarCamion.Click
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, ConfigCartaPorte:=DdlConfigAuto.SelectedValue, Anio:=TxtAnio.Text.ToEntero(), TipoPermisoSCT:=TxtTipoPermisoSCT.Text, NumPermisoSCT:=TxtNumermisoSCT.Text, NombreAseguradora:=TxtNombreAseguradora.Text, NumPolizaSeguro:=TxtNumPolizaSeguro.Text, CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, ConfigCartaPorte:=DdlConfigAuto.SelectedValue, Anio:=TxtAnio.Text.ToEntero(), TipoPermisoSCT:=TxtTipoPermisoSCT.Text, NumPermisoSCT:=TxtNumermisoSCT.Text, NombreAseguradora:=TxtNombreAseguradora.Text, NumPolizaSeguro:=TxtNumPolizaSeguro.Text, CveEmpresa:=UsuarioActual.CveEmpresa, CveUsuario:=UsuarioActual.CveUsuario) Then
|
||||
RegistraScript("$('#DivAgregarNuevoCamion').modal('hide');")
|
||||
CargarCamiones()
|
||||
LimpiarAgregarCamion()
|
||||
|
||||
Reference in New Issue
Block a user