VyA CatRutas
This commit is contained in:
@@ -7680,8 +7680,8 @@ Public Class ClsPaginas
|
||||
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
|
||||
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
|
||||
End If
|
||||
'Dim urlHost As String = "http://sig.adssistemas.mx:7998/"
|
||||
Dim urlHost As String = "http://localhost:2202/"
|
||||
Dim urlHost As String = "http://sig.adssistemas.mx:7998/"
|
||||
'Dim urlHost As String = "http://localhost:2202/"
|
||||
If EsProduccion Then
|
||||
urlHost = "http://192.200.113.178:6599/"
|
||||
End If
|
||||
|
||||
@@ -264,14 +264,14 @@ Public Class ClsTransportes
|
||||
#End Region
|
||||
|
||||
#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
|
||||
DataAdapter("PA_Trans_DestinosGet")
|
||||
If CveRuta <> 0 Then
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||
End With
|
||||
End If
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -283,7 +283,7 @@ Public Class ClsTransportes
|
||||
Return Retorno
|
||||
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
|
||||
|
||||
DataAdapter("PA_Trans_DestinosAdd")
|
||||
@@ -295,6 +295,7 @@ Public Class ClsTransportes
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveEstado", SqlDbType.Int).Value = CveEstado
|
||||
.Add("@Direccion", SqlDbType.VarChar).Value = Direccion
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -306,7 +307,7 @@ Public Class ClsTransportes
|
||||
Return Retorno
|
||||
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
|
||||
DataAdapter("PA_Trans_DestinosUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -317,7 +318,7 @@ Public Class ClsTransportes
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveEstado", SqlDbType.Int).Value = CveEstado
|
||||
|
||||
.Add("@Direccion", SqlDbType.VarChar).Value = Direccion
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -351,13 +352,14 @@ Public Class ClsTransportes
|
||||
#End Region
|
||||
|
||||
#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
|
||||
DataAdapter("PA_Trans_DestinosTarifasGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
||||
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -369,7 +371,7 @@ Public Class ClsTransportes
|
||||
Return Retorno
|
||||
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
|
||||
|
||||
DataAdapter("PA_Trans_DestinosTarifasAdd")
|
||||
@@ -379,6 +381,8 @@ Public Class ClsTransportes
|
||||
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
||||
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
||||
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe
|
||||
.Add("@ImporteNov", SqlDbType.SmallMoney).Value = ImporteNov
|
||||
.Add("@ImporteDic", SqlDbType.SmallMoney).Value = ImporteDic
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -389,7 +393,7 @@ Public Class ClsTransportes
|
||||
|
||||
Return Retorno
|
||||
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
|
||||
DataAdapter("PA_Trans_DestinosTarifasUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -398,6 +402,8 @@ Public Class ClsTransportes
|
||||
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen
|
||||
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal
|
||||
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe
|
||||
.Add("@ImporteNov", SqlDbType.SmallMoney).Value = ImporteNov
|
||||
.Add("@ImporteDic", SqlDbType.SmallMoney).Value = ImporteDic
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
MasterPageFile="~/Site.master" CodeFile="CatRutas.aspx.vb"
|
||||
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">
|
||||
<style>
|
||||
.spaced {
|
||||
@@ -20,6 +16,30 @@
|
||||
</style>
|
||||
</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:UpdatePanel runat="server" ID="UpPanel" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
@@ -31,62 +51,67 @@
|
||||
<ContentTemplate>
|
||||
<div class="spaced">
|
||||
<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 class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<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) %>"
|
||||
style="display: inline-block; margin-right: -10px; width: 150px;" />
|
||||
<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">
|
||||
</i></a>
|
||||
style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</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>
|
||||
<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>
|
||||
</ajax:TabPanel>
|
||||
<%--Importes Tab--%>
|
||||
@@ -94,9 +119,7 @@
|
||||
<ContentTemplate>
|
||||
<div class="spaced">
|
||||
<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 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"
|
||||
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>
|
||||
<asp:TemplateField HeaderText="Ruta">
|
||||
<ItemTemplate>
|
||||
@@ -216,7 +239,7 @@
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Nombre del Destino</label>
|
||||
<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"
|
||||
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>
|
||||
@@ -264,10 +287,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
<div class="row my-1" style="display:none">
|
||||
<label class="col-md-4">Estado:</label>
|
||||
<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"
|
||||
DataValueField="CveEstado"
|
||||
AppendDataBoundItems="true"
|
||||
@@ -281,6 +304,20 @@
|
||||
</ajax:ValidatorCalloutExtender>
|
||||
</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>
|
||||
<%-- Importes --%>
|
||||
<asp:Panel ID="PnImporte" runat="server" Visible="false">
|
||||
@@ -335,7 +372,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Importe</label>
|
||||
<label class="col-md-4">Importe:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox type="number" ID="TxtImporte" runat="server" MaxLength="7" Width="100%"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVImporte" runat="server" ControlToValidate="TxtImporte"
|
||||
@@ -346,6 +383,34 @@
|
||||
</ajax:ValidatorCalloutExtender>
|
||||
</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>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -22,24 +22,31 @@ Partial Class CatRutas
|
||||
|
||||
End Sub
|
||||
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
|
||||
GvDestinos.DataSource = ObjRutas.DtResultados
|
||||
GvDestinos.DataBind()
|
||||
End If
|
||||
End If
|
||||
|
||||
'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
|
||||
GvImportes.DataSource = ObjRutas.DtResultados
|
||||
GvImportes.DataBind()
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjRutas.Dispose()
|
||||
|
||||
GvDestinos.DataBind()
|
||||
GvImportes.DataBind()
|
||||
|
||||
UpPanel.Update()
|
||||
|
||||
End Sub
|
||||
@@ -47,7 +54,7 @@ Partial Class CatRutas
|
||||
Private Sub InicializarCombos()
|
||||
Dim ObjDestinos As New ClsTransportes()
|
||||
|
||||
If ObjDestinos.GetDestinos() Then
|
||||
If ObjDestinos.GetDestinos(-1, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
@@ -61,8 +68,9 @@ Partial Class CatRutas
|
||||
ObjDestinos.Dispose()
|
||||
|
||||
DdlRutas.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltraParametros("CveSubProyecto in (12699,12700)") : DdlRutas.DataBind()
|
||||
DdlEstado.DataSource = GlobalDTGralEstados("MEX") : DdlEstado.DataBind()
|
||||
DdlEstado.Items.Insert(0, New ListItem("Seleccione Estado", ""))
|
||||
DdlEstado.DataSource = GlobalDTGralEstados("MEX")
|
||||
DdlEstado.DataBind()
|
||||
DdlEstado.Items.Insert(0, New ListItem("Seleccione Estado", "-1"))
|
||||
|
||||
|
||||
End Sub
|
||||
@@ -71,11 +79,14 @@ Partial Class CatRutas
|
||||
TxtRuta.Text = ""
|
||||
DdlRutaEstatus.SelectedValue = ""
|
||||
TxtDestino.Text = ""
|
||||
TxtDireccion.Text = ""
|
||||
DdlEsNacional.SelectedValue = ""
|
||||
DdlDestinoEstatus.SelectedValue = ""
|
||||
DdlOrigen.SelectedValue = ""
|
||||
DdlFinal.SelectedValue = ""
|
||||
TxtImporte.Text = ""
|
||||
TxtImporteNov.Text = ""
|
||||
TxtImporteDic.Text = ""
|
||||
BtnAddDestino.Visible = False
|
||||
BtnAddImporte.Visible = False
|
||||
PnRuta.Visible = False
|
||||
@@ -90,14 +101,15 @@ Partial Class CatRutas
|
||||
ModalLabel.Text = "Editar Ruta"
|
||||
PnRuta.Visible = True
|
||||
TxtRuta.Text = GvRow.DataKey("Ruta")
|
||||
DdlRutaEstatus.SelectedValue = GvRow.DataKey("Estatus")
|
||||
DdlRutaEstatus.SelectedValueExist(GvRow.DataKey("Estatus"))
|
||||
ViewState("Cve") = GvRow.DataKey("CveRuta").ToEntero
|
||||
|
||||
Case "BtnEditarDestino"
|
||||
ModalLabel.Text = "Editar Destino"
|
||||
TxtDestino.Text = GvRow.DataKey("Destino")
|
||||
DdlDestinoEstatus.SelectedValue = GvRow.DataKey("Estatus")
|
||||
DdlEsNacional.SelectedValue = GvRow.DataKey("EsNacional")
|
||||
TxtDireccion.Text = GvRow.DataKey("Direccion")
|
||||
DdlDestinoEstatus.SelectedValueExist(GvRow.DataKey("Estatus"))
|
||||
DdlEsNacional.SelectedValueExist(GvRow.DataKey("EsNacional"))
|
||||
|
||||
DdlEstado.Items.Clear()
|
||||
If Convert.ToBoolean(DdlEsNacional.SelectedValue) Then
|
||||
@@ -105,9 +117,10 @@ Partial Class CatRutas
|
||||
Else
|
||||
DdlEstado.DataSource = GlobalDTGralEstados("USA") : DdlEstado.DataBind()
|
||||
End If
|
||||
DdlEstado.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
UpModal.Update()
|
||||
|
||||
DdlEstado.SelectedValue = GvRow.DataKey("CveEstado")
|
||||
DdlEstado.SelectedValueExist(GvRow.DataKey("CveEstado"))
|
||||
|
||||
PnDestino.Visible = True
|
||||
BtnAddDestino.Visible = True
|
||||
@@ -116,10 +129,12 @@ Partial Class CatRutas
|
||||
|
||||
Case "BtnEditarImporte"
|
||||
ModalLabel.Text = "Editar Importe"
|
||||
DdlRutas.SelectedValue = GvRow.DataKey("CveSubProyecto")
|
||||
DdlOrigen.SelectedValue = GvRow.DataKey("CveDestinoOrigen")
|
||||
DdlFinal.SelectedValue = GvRow.DataKey("CveDestinoFinal")
|
||||
DdlRutas.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||
DdlOrigen.SelectedValueExist(GvRow.DataKey("CveDestinoOrigen"))
|
||||
DdlFinal.SelectedValueExist(GvRow.DataKey("CveDestinoFinal"))
|
||||
TxtImporte.Text = GvRow.DataKey("Importe")
|
||||
TxtImporteNov.Text = GvRow.DataKey("ImporteNov")
|
||||
TxtImporteDic.Text = GvRow.DataKey("ImporteDic")
|
||||
PnImporte.Visible = True
|
||||
BtnAddImporte.Visible = True
|
||||
BtnAddImporte.Text = "Editar"
|
||||
@@ -153,29 +168,38 @@ Partial Class CatRutas
|
||||
#Region "Destinos"
|
||||
Protected Sub AddDestino(sender As Object, e As EventArgs)
|
||||
|
||||
Dim errorProceso As Boolean = False
|
||||
Dim ObjDestino As New ClsTransportes
|
||||
ObjDestino.IniciaTransacSQL()
|
||||
'ObjDestino.IniciaTransacSQL()
|
||||
Try
|
||||
If BtnAddDestino.Text = "Guardar" Then
|
||||
If ObjDestino.AddDestino(TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlEstado.SelectedValue.ToEntero) > 1 Then
|
||||
ObjDestino.Commit()
|
||||
If Not ObjDestino.AddDestino(TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlEstado.SelectedValue.ToEntero, TxtDireccion.Text) > 1 Then
|
||||
errorProceso = True
|
||||
Alert("Se presento un error al guardar Destino.", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
Alert("Destino agregado correctamente.")
|
||||
End If
|
||||
End If
|
||||
|
||||
If BtnAddDestino.Text = "Editar" Then
|
||||
If ObjDestino.UpdateDestino(Cve, TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlEstado.SelectedValue.ToEntero) Then
|
||||
ObjDestino.Commit()
|
||||
If Not ObjDestino.UpdateDestino(Cve, TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlEstado.SelectedValue.ToEntero, TxtDireccion.Text) Then
|
||||
errorProceso = True
|
||||
Alert("Se presento un error al guardar Destino.", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
Alert("Destino actualizado correctamente.")
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
ObjDestino.RollBack()
|
||||
|
||||
Finally
|
||||
CargaDatos()
|
||||
ObjDestino.Dispose()
|
||||
End Try
|
||||
|
||||
If Not errorProceso Then
|
||||
CargaDatos()
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "Modal"))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub RemoveDestino(sender As Object, e As EventArgs)
|
||||
@@ -212,14 +236,14 @@ Partial Class CatRutas
|
||||
ObjImporte.IniciaTransacSQL()
|
||||
|
||||
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()
|
||||
Alert("Importe agregado correctamente.")
|
||||
End If
|
||||
End If
|
||||
|
||||
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()
|
||||
Alert("Importe actualizado correctamente.")
|
||||
End If
|
||||
|
||||
@@ -773,7 +773,7 @@
|
||||
<!-- Paquete de idioma español -->
|
||||
<script src="https://cdn.amcharts.com/lib/4/lang/es_ES.js"></script>
|
||||
|
||||
<script>
|
||||
<script >
|
||||
|
||||
|
||||
var chartHeader;
|
||||
|
||||
Reference in New Issue
Block a user