VyA CatRutas

This commit is contained in:
rakcsle
2024-11-28 19:59:50 -07:00
parent 765bb6dd6a
commit fd256bc37d
5 changed files with 193 additions and 98 deletions

View File

@@ -7680,8 +7680,8 @@ Public Class ClsPaginas
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
End If End If
'Dim urlHost As String = "http://sig.adssistemas.mx:7998/" Dim urlHost As String = "http://sig.adssistemas.mx:7998/"
Dim urlHost As String = "http://localhost:2202/" 'Dim urlHost As String = "http://localhost:2202/"
If EsProduccion Then If EsProduccion Then
urlHost = "http://192.200.113.178:6599/" urlHost = "http://192.200.113.178:6599/"
End If End If

View File

@@ -264,14 +264,14 @@ Public Class ClsTransportes
#End Region #End Region
#Region "Destinos" #Region "Destinos"
Public Function GetDestinos(Optional CveSubProyecto As Integer = 0) As Boolean Public Function GetDestinos(CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Trans_DestinosGet") DataAdapter("PA_Trans_DestinosGet")
If CveRuta <> 0 Then
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End If End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -283,7 +283,7 @@ Public Class ClsTransportes
Return Retorno Return Retorno
End Function End Function
Public Function AddDestino(Destino As String, Estatus As String, EsNacional As String, CveUsuario As Integer, CveEmpresa As Integer, CveEstado As Integer) As Integer Public Function AddDestino(Destino As String, Estatus As String, EsNacional As String, CveUsuario As Integer, CveEmpresa As Integer, CveEstado As Integer, Direccion As String) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_Trans_DestinosAdd") DataAdapter("PA_Trans_DestinosAdd")
@@ -295,6 +295,7 @@ Public Class ClsTransportes
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveEstado", SqlDbType.Int).Value = CveEstado .Add("@CveEstado", SqlDbType.Int).Value = CveEstado
.Add("@Direccion", SqlDbType.VarChar).Value = Direccion
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -306,7 +307,7 @@ Public Class ClsTransportes
Return Retorno Return Retorno
End Function End Function
Public Function UpdateDestino(CveDestino As Integer, Destino As String, Estatus As String, EsNacional As String, CveUsuario As Integer, CveEmpresa As Integer, CveEstado As Integer) As Boolean Public Function UpdateDestino(CveDestino As Integer, Destino As String, Estatus As String, EsNacional As String, CveUsuario As Integer, CveEmpresa As Integer, CveEstado As Integer, Direccion As String) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Trans_DestinosUpdate") DataAdapter("PA_Trans_DestinosUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -317,7 +318,7 @@ Public Class ClsTransportes
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveEstado", SqlDbType.Int).Value = CveEstado .Add("@CveEstado", SqlDbType.Int).Value = CveEstado
.Add("@Direccion", SqlDbType.VarChar).Value = Direccion
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -351,13 +352,14 @@ Public Class ClsTransportes
#End Region #End Region
#Region "Importes" #Region "Importes"
Public Function GetDestinosTarifas(CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean Public Function GetDestinosTarifas(CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Trans_DestinosTarifasGet") DataAdapter("PA_Trans_DestinosTarifasGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen .Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal .Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -369,7 +371,7 @@ Public Class ClsTransportes
Return Retorno Return Retorno
End Function End Function
Public Function AddDestinosTarifas(CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal) As Integer Public Function AddDestinosTarifas(CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal, ImporteNov As Decimal, ImporteDic As Decimal) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_Trans_DestinosTarifasAdd") DataAdapter("PA_Trans_DestinosTarifasAdd")
@@ -379,6 +381,8 @@ Public Class ClsTransportes
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen .Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal .Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe .Add("@Importe", SqlDbType.SmallMoney).Value = Importe
.Add("@ImporteNov", SqlDbType.SmallMoney).Value = ImporteNov
.Add("@ImporteDic", SqlDbType.SmallMoney).Value = ImporteDic
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -389,7 +393,7 @@ Public Class ClsTransportes
Return Retorno Return Retorno
End Function End Function
Public Function UpdateDestinosTarifas(CveDestinoTarifa As Integer, CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal) As Boolean Public Function UpdateDestinosTarifas(CveDestinoTarifa As Integer, CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal, ImporteNov As Decimal, ImporteDic As Decimal) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Trans_DestinosTarifasUpdate") DataAdapter("PA_Trans_DestinosTarifasUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -398,6 +402,8 @@ Public Class ClsTransportes
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen .Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal .Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe .Add("@Importe", SqlDbType.SmallMoney).Value = Importe
.Add("@ImporteNov", SqlDbType.SmallMoney).Value = ImporteNov
.Add("@ImporteDic", SqlDbType.SmallMoney).Value = ImporteDic
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -2,10 +2,6 @@
MasterPageFile="~/Site.master" CodeFile="CatRutas.aspx.vb" MasterPageFile="~/Site.master" CodeFile="CatRutas.aspx.vb"
Inherits="CatRutas" EnableEventValidation="true" %> Inherits="CatRutas" EnableEventValidation="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="E" runat="Server">
Rutas y Destinos
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style> <style>
.spaced { .spaced {
@@ -20,6 +16,30 @@
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="E" runat="Server">
Rutas y Destinos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="BtnAgregarDestino" runat="server" OnClick="MostrarModal"><i class='fa fa-plus'></i> Agregar Destino</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="BtnAgregarImporte" runat="server" OnClick="MostrarModal" ><i class='fa fa-plus'></i> Agregar Tarifa</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpPanel" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpPanel" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
@@ -31,62 +51,67 @@
<ContentTemplate> <ContentTemplate>
<div class="spaced"> <div class="spaced">
<div> <div>
<asp:LinkButton ID="BtnAgregarDestino" runat="server" AlternateText="Agregar"
CssClass="btn btn-success btn-sm green" OnClick="MostrarModal" Text="<i class='fa fa-add'>Agregar</i>"
ToolTip="Agregar" />
</div> </div>
<div> <div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="row my-1" style="margin-right: 10px; margin-top: 10px;" align="right"> <div class="row my-1" style="margin-right: 10px; margin-top: 10px;" align="right">
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDestinos.ClientID) %>" <input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDestinos.ClientID) %>"
style="display: inline-block; margin-right: -10px; width: 150px;" /> style="display: inline-block; margin-right: -10px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDestinos.ClientID) %>" <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDestinos.ClientID) %>"
style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"> style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</i></a>
</div> </div>
<asp:GridView ID="GvDestinos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
data-sort="true" DataKeyNames="CveDestino, Destino, EsNacional, Estatus, CveUsuario, FechaIng, CveEmpresa, CveEstado, Direccion">
<Columns>
<asp:TemplateField HeaderText="Destino">
<ItemTemplate>
<asp:Literal ID="LtlDestino" runat="server" Text='<%# Eval("Destino") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Label ID="LtlEstatus" runat="server" Text='<%# If(Eval("Estatus").ToString = "True", "Activo", "Inactivo") %>'
CssClass='<%# If(Eval("Estatus").ToString = "True", "text-success", "text-danger") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nacional">
<ItemTemplate>
<asp:Label ID="LtlEsNacional" runat="server" Text='<%# If(Eval("EsNacional").ToString = "True", "Sí", "No") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Direccion" >
<ItemTemplate>
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Direccion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
<ItemTemplate>
<asp:LinkButton ID="BtnEditarDestino" runat="server" AlternateText="Editar"
CssClass="btn btn-circle btn-sm green" OnClick="MostrarModal" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="BtnEliminarDestino" runat="server" AlternateText="Eliminar"
CssClass="btn btn-circle btn-sm red" OnClick="RemoveDestino" Text="<i class='fa fa-trash'></i>"
data-toggle="confirmation" data-popout="true" data-original-title="Confirmar"
data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div> </div>
</div> </div>
<asp:GridView ID="GvDestinos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
data-sort="true" DataKeyNames="CveDestino, Destino, EsNacional, Estatus, CveUsuario, FechaIng, CveEmpresa, CveEstado">
<Columns>
<asp:TemplateField HeaderText="Destino">
<ItemTemplate>
<asp:Literal ID="LtlDestino" runat="server" Text='<%# Eval("Destino") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Label ID="LtlEstatus" runat="server" Text='<%# If(Eval("Estatus").ToString = "True", "Activo", "Inactivo") %>'
CssClass='<%# If(Eval("Estatus").ToString = "True", "text-success", "text-danger") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nacional">
<ItemTemplate>
<asp:Label ID="LtlEsNacional" runat="server" Text='<%# If(Eval("EsNacional").ToString = "True", "Sí", "No") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estado">
<ItemTemplate>
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("NombreEstado") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
<ItemTemplate>
<asp:LinkButton ID="BtnEditarDestino" runat="server" AlternateText="Editar"
CssClass="btn btn-circle btn-sm green" OnClick="MostrarModal" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="BtnEliminarDestino" runat="server" AlternateText="Eliminar"
CssClass="btn btn-circle btn-sm red" OnClick="RemoveDestino" Text="<i class='fa fa-trash'></i>"
data-toggle="confirmation" data-popout="true" data-original-title="Confirmar"
data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
<%--Importes Tab--%> <%--Importes Tab--%>
@@ -94,9 +119,7 @@
<ContentTemplate> <ContentTemplate>
<div class="spaced"> <div class="spaced">
<div> <div>
<asp:LinkButton ID="BtnAgregarImporte" runat="server" AlternateText="Agregar"
CssClass="btn btn-success btn-sm green" OnClick="MostrarModal" Text="<i class='fa fa-add'>Agregar</i>"
ToolTip="Agregar" />
</div> </div>
<div> <div>
<div class="row my-1" style="margin-right: 10px; margin-top: 10px;" align="right"> <div class="row my-1" style="margin-right: 10px; margin-top: 10px;" align="right">
@@ -111,7 +134,7 @@
<asp:GridView ID="GvImportes" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado" <asp:GridView ID="GvImportes" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
data-sort="true" DataKeyNames="CveDestinoTarifa, CveSubProyecto, CveDestinoOrigen, CveDestinoFinal, Importe, Destino, Partida"> data-sort="true" DataKeyNames="CveDestinoTarifa, CveSubProyecto, CveDestinoOrigen, CveDestinoFinal, Importe, Destino, Partida,ImporteNov, ImporteDic">
<Columns> <Columns>
<asp:TemplateField HeaderText="Ruta"> <asp:TemplateField HeaderText="Ruta">
<ItemTemplate> <ItemTemplate>
@@ -216,7 +239,7 @@
<div class="row my-1"> <div class="row my-1">
<label class="col-md-4">Nombre del Destino</label> <label class="col-md-4">Nombre del Destino</label>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtDestino" runat="server" MaxLength="70" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtDestino" runat="server" MaxLength="70" Width="100%" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="TxtDestino" <asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="TxtDestino"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Destino''</b> es necesario, por favor ingréselo." Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Destino''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
@@ -264,10 +287,10 @@
</div> </div>
</div> </div>
<div class="row my-1"> <div class="row my-1" style="display:none">
<label class="col-md-4">Estado:</label> <label class="col-md-4">Estado:</label>
<div class="col-md-8"> <div class="col-md-8">
<asp:DropDownList ID="DdlEstado" runat="server" Class="table-group-action-input form-control input-inline select2me" <asp:DropDownList ID="DdlEstado" runat="server" Class="table-group-action-input form-control input-inline select2me" Visible="false"
DataTextField="NombreEstado" DataTextField="NombreEstado"
DataValueField="CveEstado" DataValueField="CveEstado"
AppendDataBoundItems="true" AppendDataBoundItems="true"
@@ -281,6 +304,20 @@
</ajax:ValidatorCalloutExtender> </ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="row my-1">
<label class="col-md-4">Dirección:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtDireccion" runat="server" MaxLength="150" Width="100%" CssClass="form-control"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtDestino"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Destino''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco"
TargetControlID="RFVDestino" Width="100%">
</ajax:ValidatorCalloutExtender>--%>
</div>
</div>
</asp:Panel> </asp:Panel>
<%-- Importes --%> <%-- Importes --%>
<asp:Panel ID="PnImporte" runat="server" Visible="false"> <asp:Panel ID="PnImporte" runat="server" Visible="false">
@@ -335,7 +372,7 @@
</div> </div>
<div class="row my-1"> <div class="row my-1">
<label class="col-md-4">Importe</label> <label class="col-md-4">Importe:</label>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox type="number" ID="TxtImporte" runat="server" MaxLength="7" Width="100%"></asp:TextBox> <asp:TextBox type="number" ID="TxtImporte" runat="server" MaxLength="7" Width="100%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVImporte" runat="server" ControlToValidate="TxtImporte" <asp:RequiredFieldValidator ID="RFVImporte" runat="server" ControlToValidate="TxtImporte"
@@ -346,6 +383,34 @@
</ajax:ValidatorCalloutExtender> </ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="row my-1">
<label class="col-md-4">Importe Noviembre:</label>
<div class="col-md-8">
<asp:TextBox type="number" ID="TxtImporteNov" runat="server" MaxLength="7" Width="100%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtImporteNov"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe Noviembre''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="VCOImporte"
TargetControlID="RFVDestino" Width="100%">
</ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row my-1">
<label class="col-md-4">Importe Diciembre:</label>
<div class="col-md-8">
<asp:TextBox type="number" ID="TxtImporteDic" runat="server" MaxLength="7" Width="100%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtImporteDic"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe Diciembre''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="VCOImporte"
TargetControlID="RFVDestino" Width="100%">
</ajax:ValidatorCalloutExtender>
</div>
</div>
</asp:Panel> </asp:Panel>
</div> </div>

View File

@@ -22,24 +22,31 @@ Partial Class CatRutas
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
Dim ObjRutas As New ClsTransportes()
'Lista Destinos'
If ObjRutas.GetDestinos() Then
GvDestinos.DataSource = Nothing
GvImportes.DataSource = Nothing
Dim ObjRutas As New ClsTransportes()
'Lista Destinos'
If ObjRutas.GetDestinos(-1, UsuarioActual.CveEmpresa) Then
If ObjRutas.DtResultados.Rows.Count > 0 Then If ObjRutas.DtResultados.Rows.Count > 0 Then
GvDestinos.DataSource = ObjRutas.DtResultados GvDestinos.DataSource = ObjRutas.DtResultados
GvDestinos.DataBind()
End If End If
End If End If
'Lista Importes' 'Lista Importes'
If ObjRutas.GetDestinosTarifas(-1, -1, -1) Then If ObjRutas.GetDestinosTarifas(-1, -1, -1, UsuarioActual.CveEmpresa) Then
If ObjRutas.DtResultados.Rows.Count > 0 Then If ObjRutas.DtResultados.Rows.Count > 0 Then
GvImportes.DataSource = ObjRutas.DtResultados GvImportes.DataSource = ObjRutas.DtResultados
GvImportes.DataBind()
End If End If
End If End If
ObjRutas.Dispose() ObjRutas.Dispose()
GvDestinos.DataBind()
GvImportes.DataBind()
UpPanel.Update() UpPanel.Update()
End Sub End Sub
@@ -47,7 +54,7 @@ Partial Class CatRutas
Private Sub InicializarCombos() Private Sub InicializarCombos()
Dim ObjDestinos As New ClsTransportes() Dim ObjDestinos As New ClsTransportes()
If ObjDestinos.GetDestinos() Then If ObjDestinos.GetDestinos(-1, UsuarioActual.CveEmpresa) Then
If ObjDestinos.DtResultados.Rows.Count > 0 Then If ObjDestinos.DtResultados.Rows.Count > 0 Then
@@ -61,8 +68,9 @@ Partial Class CatRutas
ObjDestinos.Dispose() ObjDestinos.Dispose()
DdlRutas.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltraParametros("CveSubProyecto in (12699,12700)") : DdlRutas.DataBind() DdlRutas.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltraParametros("CveSubProyecto in (12699,12700)") : DdlRutas.DataBind()
DdlEstado.DataSource = GlobalDTGralEstados("MEX") : DdlEstado.DataBind() DdlEstado.DataSource = GlobalDTGralEstados("MEX")
DdlEstado.Items.Insert(0, New ListItem("Seleccione Estado", "")) DdlEstado.DataBind()
DdlEstado.Items.Insert(0, New ListItem("Seleccione Estado", "-1"))
End Sub End Sub
@@ -71,11 +79,14 @@ Partial Class CatRutas
TxtRuta.Text = "" TxtRuta.Text = ""
DdlRutaEstatus.SelectedValue = "" DdlRutaEstatus.SelectedValue = ""
TxtDestino.Text = "" TxtDestino.Text = ""
TxtDireccion.Text = ""
DdlEsNacional.SelectedValue = "" DdlEsNacional.SelectedValue = ""
DdlDestinoEstatus.SelectedValue = "" DdlDestinoEstatus.SelectedValue = ""
DdlOrigen.SelectedValue = "" DdlOrigen.SelectedValue = ""
DdlFinal.SelectedValue = "" DdlFinal.SelectedValue = ""
TxtImporte.Text = "" TxtImporte.Text = ""
TxtImporteNov.Text = ""
TxtImporteDic.Text = ""
BtnAddDestino.Visible = False BtnAddDestino.Visible = False
BtnAddImporte.Visible = False BtnAddImporte.Visible = False
PnRuta.Visible = False PnRuta.Visible = False
@@ -90,14 +101,15 @@ Partial Class CatRutas
ModalLabel.Text = "Editar Ruta" ModalLabel.Text = "Editar Ruta"
PnRuta.Visible = True PnRuta.Visible = True
TxtRuta.Text = GvRow.DataKey("Ruta") TxtRuta.Text = GvRow.DataKey("Ruta")
DdlRutaEstatus.SelectedValue = GvRow.DataKey("Estatus") DdlRutaEstatus.SelectedValueExist(GvRow.DataKey("Estatus"))
ViewState("Cve") = GvRow.DataKey("CveRuta").ToEntero ViewState("Cve") = GvRow.DataKey("CveRuta").ToEntero
Case "BtnEditarDestino" Case "BtnEditarDestino"
ModalLabel.Text = "Editar Destino" ModalLabel.Text = "Editar Destino"
TxtDestino.Text = GvRow.DataKey("Destino") TxtDestino.Text = GvRow.DataKey("Destino")
DdlDestinoEstatus.SelectedValue = GvRow.DataKey("Estatus") TxtDireccion.Text = GvRow.DataKey("Direccion")
DdlEsNacional.SelectedValue = GvRow.DataKey("EsNacional") DdlDestinoEstatus.SelectedValueExist(GvRow.DataKey("Estatus"))
DdlEsNacional.SelectedValueExist(GvRow.DataKey("EsNacional"))
DdlEstado.Items.Clear() DdlEstado.Items.Clear()
If Convert.ToBoolean(DdlEsNacional.SelectedValue) Then If Convert.ToBoolean(DdlEsNacional.SelectedValue) Then
@@ -105,9 +117,10 @@ Partial Class CatRutas
Else Else
DdlEstado.DataSource = GlobalDTGralEstados("USA") : DdlEstado.DataBind() DdlEstado.DataSource = GlobalDTGralEstados("USA") : DdlEstado.DataBind()
End If End If
DdlEstado.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
UpModal.Update() UpModal.Update()
DdlEstado.SelectedValue = GvRow.DataKey("CveEstado") DdlEstado.SelectedValueExist(GvRow.DataKey("CveEstado"))
PnDestino.Visible = True PnDestino.Visible = True
BtnAddDestino.Visible = True BtnAddDestino.Visible = True
@@ -116,10 +129,12 @@ Partial Class CatRutas
Case "BtnEditarImporte" Case "BtnEditarImporte"
ModalLabel.Text = "Editar Importe" ModalLabel.Text = "Editar Importe"
DdlRutas.SelectedValue = GvRow.DataKey("CveSubProyecto") DdlRutas.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
DdlOrigen.SelectedValue = GvRow.DataKey("CveDestinoOrigen") DdlOrigen.SelectedValueExist(GvRow.DataKey("CveDestinoOrigen"))
DdlFinal.SelectedValue = GvRow.DataKey("CveDestinoFinal") DdlFinal.SelectedValueExist(GvRow.DataKey("CveDestinoFinal"))
TxtImporte.Text = GvRow.DataKey("Importe") TxtImporte.Text = GvRow.DataKey("Importe")
TxtImporteNov.Text = GvRow.DataKey("ImporteNov")
TxtImporteDic.Text = GvRow.DataKey("ImporteDic")
PnImporte.Visible = True PnImporte.Visible = True
BtnAddImporte.Visible = True BtnAddImporte.Visible = True
BtnAddImporte.Text = "Editar" BtnAddImporte.Text = "Editar"
@@ -153,29 +168,38 @@ Partial Class CatRutas
#Region "Destinos" #Region "Destinos"
Protected Sub AddDestino(sender As Object, e As EventArgs) Protected Sub AddDestino(sender As Object, e As EventArgs)
Dim errorProceso As Boolean = False
Dim ObjDestino As New ClsTransportes Dim ObjDestino As New ClsTransportes
ObjDestino.IniciaTransacSQL() 'ObjDestino.IniciaTransacSQL()
Try Try
If BtnAddDestino.Text = "Guardar" Then If BtnAddDestino.Text = "Guardar" Then
If ObjDestino.AddDestino(TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlEstado.SelectedValue.ToEntero) > 1 Then If Not ObjDestino.AddDestino(TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlEstado.SelectedValue.ToEntero, TxtDireccion.Text) > 1 Then
ObjDestino.Commit() errorProceso = True
Alert("Se presento un error al guardar Destino.", TipoMensaje.MsgAdvertencia)
Else
Alert("Destino agregado correctamente.") Alert("Destino agregado correctamente.")
End If End If
End If End If
If BtnAddDestino.Text = "Editar" Then If BtnAddDestino.Text = "Editar" Then
If ObjDestino.UpdateDestino(Cve, TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlEstado.SelectedValue.ToEntero) Then If Not ObjDestino.UpdateDestino(Cve, TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlEstado.SelectedValue.ToEntero, TxtDireccion.Text) Then
ObjDestino.Commit() errorProceso = True
Alert("Se presento un error al guardar Destino.", TipoMensaje.MsgAdvertencia)
Else
Alert("Destino actualizado correctamente.") Alert("Destino actualizado correctamente.")
End If End If
End If End If
Catch ex As Exception Catch ex As Exception
ObjDestino.RollBack()
Finally Finally
CargaDatos()
ObjDestino.Dispose() ObjDestino.Dispose()
End Try End Try
If Not errorProceso Then
CargaDatos()
RegistraScript(String.Format("$('#{0}').modal('hide');", "Modal"))
End If
End Sub End Sub
Protected Sub RemoveDestino(sender As Object, e As EventArgs) Protected Sub RemoveDestino(sender As Object, e As EventArgs)
@@ -212,14 +236,14 @@ Partial Class CatRutas
ObjImporte.IniciaTransacSQL() ObjImporte.IniciaTransacSQL()
If BtnAddImporte.Text = "Guardar" Then If BtnAddImporte.Text = "Guardar" Then
If ObjImporte.AddDestinosTarifas(DdlRutas.SelectedValue.ToEntero, DdlOrigen.SelectedValue.ToEntero, DdlFinal.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal) > 1 Then If ObjImporte.AddDestinosTarifas(DdlRutas.SelectedValue.ToEntero, DdlOrigen.SelectedValue.ToEntero, DdlFinal.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, TxtImporteNov.Text.ToDecimal, TxtImporteDic.Text.ToDecimal) > 1 Then
ObjImporte.Commit() ObjImporte.Commit()
Alert("Importe agregado correctamente.") Alert("Importe agregado correctamente.")
End If End If
End If End If
If BtnAddImporte.Text = "Editar" Then If BtnAddImporte.Text = "Editar" Then
If ObjImporte.UpdateDestinosTarifas(Cve, DdlRutas.SelectedValue.ToEntero, DdlOrigen.SelectedValue.ToEntero, DdlFinal.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal) Then If ObjImporte.UpdateDestinosTarifas(Cve, DdlRutas.SelectedValue.ToEntero, DdlOrigen.SelectedValue.ToEntero, DdlFinal.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, TxtImporteNov.Text.ToDecimal, TxtImporteDic.Text.ToDecimal) Then
ObjImporte.Commit() ObjImporte.Commit()
Alert("Importe actualizado correctamente.") Alert("Importe actualizado correctamente.")
End If End If

View File

@@ -773,7 +773,7 @@
<!-- Paquete de idioma español --> <!-- Paquete de idioma español -->
<script src="https://cdn.amcharts.com/lib/4/lang/es_ES.js"></script> <script src="https://cdn.amcharts.com/lib/4/lang/es_ES.js"></script>
<script> <script >
var chartHeader; var chartHeader;