--Se crean los métodos faltantes del CRUD para la tabla de destinos, rutas e importes con sus respectivos procedimientos almacenados. Se agregan los datakeys a los Gv de Rutas, Destinos e importes, se agregan códigos de color a los estatus, se unifican los botones para agregar y modificar las clases y se agrega un modal dinámico con el panel apropiado para cada textbox. Se agrega una Cve para guardar el valor de la clave al ser modificado, se agregan los dropdownlist de CveOrigen y CveFinal para los importes y CveRuta, se crea el método para mostrar modal dinámico y los métodos del CRUD.
This commit is contained in:
@@ -333,6 +333,68 @@ 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) As Integer
|
||||||
|
Dim Retorno As Integer = -1
|
||||||
|
|
||||||
|
DataAdapter("PA_Trans_DestinosAdd")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveDestino", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
.Add("@Destino", SqlDbType.VarChar).Value = Destino
|
||||||
|
.Add("@EsNacional", SqlDbType.VarChar).Value = Convert.ToBoolean(EsNacional)
|
||||||
|
.Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus)
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveDestino").Value.ToString)
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al agregar el destino.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
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) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Trans_DestinosUpdate")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveDestino", SqlDbType.Int).Value = CveDestino
|
||||||
|
.Add("@Destino", SqlDbType.VarChar).Value = Destino
|
||||||
|
.Add("@EsNacional", SqlDbType.VarChar).Value = Convert.ToBoolean(EsNacional)
|
||||||
|
.Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus)
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al actualizar el destino.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function RemoveDestino(CveDestino As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
DataAdapter("PA_Trans_DestinosRemove")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveDestino", SqlDbType.Int).Value = CveDestino
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al eliminar el destino.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Rutas"
|
#Region "Rutas"
|
||||||
@@ -351,15 +413,73 @@ Public Class ClsTransportes
|
|||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al obtener las rutas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
OnError("Ocurrió un error al obtener las rutas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function AddRuta(Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer
|
||||||
|
Dim Retorno As Integer = -1
|
||||||
|
|
||||||
|
DataAdapter("PA_Trans_RutasAdd")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveRuta", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
.Add("@Ruta", SqlDbType.VarChar).Value = Ruta
|
||||||
|
.Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus)
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveRuta").Value.ToString)
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al agregar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function UpdateRuta(CveRuta As Integer, Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Trans_RutasUpdate")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||||
|
.Add("@Ruta", SqlDbType.VarChar).Value = Ruta
|
||||||
|
.Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus)
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al actualizar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function RemoveRuta(CveRuta As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
DataAdapter("PA_Trans_RutasRemove")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al eliminar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Tarifas"
|
#Region "Importes"
|
||||||
Public Function GetDestinosTarifas(CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean
|
Public Function GetDestinosTarifas(CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Trans_DestinosTarifasGet")
|
DataAdapter("PA_Trans_DestinosTarifasGet")
|
||||||
@@ -376,6 +496,63 @@ Public Class ClsTransportes
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function AddDestinosTarifas(CveRuta As String, CveDestinoOrigen As String, CveDestinoFinal As String, Importe As String) As Integer
|
||||||
|
Dim Retorno As Integer = -1
|
||||||
|
|
||||||
|
DataAdapter("PA_Trans_DestinosTarifasAdd")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveDestinoTarifa", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta.ToEntero
|
||||||
|
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen.ToEntero
|
||||||
|
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal.ToEntero
|
||||||
|
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe.ToDecimal
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveDestinoTarifa").Value.ToString)
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al agregar el importe.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function UpdateDestinosTarifas(CveDestinoTarifa As Integer, CveRuta As String, CveDestinoOrigen As String, CveDestinoFinal As String, Importe As String) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Trans_DestinosTarifasUpdate")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveDestinoTarifa", SqlDbType.Int).Value = CveDestinoTarifa
|
||||||
|
.Add("@CveRuta", SqlDbType.Int).Value = CveRuta.ToEntero
|
||||||
|
.Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen.ToEntero
|
||||||
|
.Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal.ToEntero
|
||||||
|
.Add("@Importe", SqlDbType.SmallMoney).Value = Importe.ToDecimal
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al actualizar el importe.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function RemoveDestinosTarifas(CveDestinoTarifa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
DataAdapter("PA_Trans_DestinosTarifasRemove")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveDestinoTarifa", SqlDbType.Int).Value = CveDestinoTarifa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al eliminar el importe.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -13,199 +13,392 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-block: 1rem;
|
margin-block: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.my-1 {
|
||||||
|
margin-block: 1rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</asp:Content>
|
</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">
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:Panel ID="PnlGeneral" runat="server">
|
||||||
|
<%--Calendario Tab--%>
|
||||||
|
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
|
||||||
|
<%--Rutas Tab--%>
|
||||||
|
<ajax:TabPanel ID="TabRutas" runat="server" HeaderText="Rutas">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="spaced">
|
||||||
|
<div>
|
||||||
|
<asp:LinkButton ID="BtnAgregarRuta" runat="server" AlternateText="Agregar"
|
||||||
|
CssClass="btn bsuccesscle btn-sm green" OnClick="MostrarModal" Text="<i class='fa fa-add'>Agregar</i>"
|
||||||
|
ToolTip="Agregar" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRutas.ClientID) %>"
|
||||||
|
style="display: inline-block; margin-right: -10px; width: 150px;" />
|
||||||
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRutas.ClientID) %>"
|
||||||
|
style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier">
|
||||||
|
</i></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<asp:Panel ID="PnlGeneral" runat="server">
|
</div>
|
||||||
<%--Calendario Tab--%>
|
<asp:GridView ID="GvRutas" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
||||||
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
|
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
|
||||||
<%--Rutas Tab--%>
|
data-sort="true" DataKeyNames="CveRuta, Ruta, Estatus, CveUsuario, FechaIng, CveEmpresa">
|
||||||
<ajax:TabPanel ID="TabRutas" runat="server" HeaderText="Rutas">
|
<Columns>
|
||||||
<ContentTemplate>
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="No. Ruta">
|
||||||
<div class="spaced">
|
<ItemTemplate>
|
||||||
<div>
|
<asp:Literal ID="LtlCveRuta" runat="server" Text='<%# Eval("CveRuta") %>'></asp:Literal>
|
||||||
<asp:LinkButton ID="BtnAgregarRuta" runat="server" AlternateText="Agregar"
|
</ItemTemplate>
|
||||||
CssClass="btn bsuccesscle btn-sm green" OnClick="AddRuta" Text="<i class='fa fa-add'>Agregar</i>"
|
</asp:TemplateField>
|
||||||
ToolTip="Agregar" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRutas.ClientID) %>"
|
|
||||||
style="display: inline-block; margin-right: -10px; width: 150px;" />
|
|
||||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRutas.ClientID) %>"
|
|
||||||
style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier">
|
|
||||||
</i></a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="Ruta">
|
||||||
<asp:GridView ID="GvRutas" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
<ItemTemplate>
|
||||||
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
|
<asp:Literal ID="LtlRuta" runat="server" Text='<%# Eval("Ruta") %>'></asp:Literal>
|
||||||
data-sort="true" DataKeyNames="">
|
</ItemTemplate>
|
||||||
<Columns>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="No. Ruta">
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlCveRuta" runat="server" Text='<%# Eval("CveRuta") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
|
|
||||||
<asp:TemplateField HeaderText="Ruta">
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="Estatus">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="LtlRuta" runat="server" Text='<%# Eval("Ruta") %>'></asp:Literal>
|
<asp:Label ID="LtlEstatus" runat="server" Text='<%# If(Eval("Estatus").ToString = "True", "Activo", "Inactivo") %>'
|
||||||
</ItemTemplate>
|
CssClass='<%# If(Eval("Estatus").ToString = "True", "text-success", "text-danger") %>'></asp:Label>
|
||||||
</asp:TemplateField>
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField HeaderText="Estatus">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
<asp:LinkButton ID="BtnEditarRuta" runat="server" AlternateText="Editar"
|
||||||
</ItemTemplate>
|
CssClass="btn btn-circle btn-sm green" OnClick="MostrarModal" Text="<i class='fa fa-pencil'></i>" />
|
||||||
</asp:TemplateField>
|
<asp:LinkButton ID="BtnEliminarRuta" runat="server" AlternateText="Eliminar"
|
||||||
|
CssClass="btn btn-circle btn-sm red" OnClick="RemoveRuta" 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>
|
||||||
|
<%--Destinos Tab--%>
|
||||||
|
<ajax:TabPanel ID="TabDestinos" runat="server" HeaderText="Destinos">
|
||||||
|
<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 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>
|
||||||
|
</div>
|
||||||
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
</div>
|
||||||
<ItemTemplate>
|
</div>
|
||||||
<asp:LinkButton ID="BtnEditarRuta" runat="server" AlternateText="Editar"
|
<asp:GridView ID="GvDestinos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
||||||
CssClass="btn btn-circle btn-sm green" OnClick="UpdateRuta" Text="<i class='fa fa-pencil'></i>" />
|
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
|
||||||
<asp:LinkButton ID="BtnEliminarRuta" runat="server" AlternateText="Eliminar"
|
data-sort="true" DataKeyNames="CveDestino, Destino, EsNacional, Estatus, CveUsuario, FechaIng, CveEmpresa">
|
||||||
CssClass="btn btn-circle btn-sm red" OnClick="RemoveRuta" Text="<i class='fa fa-trash'></i>"
|
<Columns>
|
||||||
data-toggle="confirmation" data-popout="true" data-original-title="Confirmar"
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="No. Destino">
|
||||||
data-btn-ok-label="si" />
|
<ItemTemplate>
|
||||||
</ItemTemplate>
|
<asp:Literal ID="LtlCveDestino" runat="server" Text='<%# Eval("CveDestino") %>'></asp:Literal>
|
||||||
</asp:TemplateField>
|
</ItemTemplate>
|
||||||
</Columns>
|
</asp:TemplateField>
|
||||||
</asp:GridView>
|
|
||||||
</ContentTemplate>
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="Destino">
|
||||||
</ajax:TabPanel>
|
<ItemTemplate>
|
||||||
<%--Rutas Tab--%>
|
<asp:Literal ID="LtlDestino" runat="server" Text='<%# Eval("Destino") %>'></asp:Literal>
|
||||||
<ajax:TabPanel ID="TabDestinos" runat="server" HeaderText="Destinos">
|
</ItemTemplate>
|
||||||
<ContentTemplate>
|
</asp:TemplateField>
|
||||||
<div class="spaced">
|
|
||||||
<div>
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="Estatus">
|
||||||
<asp:LinkButton ID="BtnAgregarDestino" runat="server" AlternateText="Agregar"
|
<ItemTemplate>
|
||||||
CssClass="btn btn-success btn-sm green" OnClick="AddDestino" Text="<i class='fa fa-add'>Agregar</i>"
|
<asp:Label ID="LtlEstatus" runat="server" Text='<%# If(Eval("Estatus").ToString = "True", "Activo", "Inactivo") %>'
|
||||||
ToolTip="Agregar" />
|
CssClass='<%# If(Eval("Estatus").ToString = "True", "text-success", "text-danger") %>'></asp:Label>
|
||||||
</div>
|
</ItemTemplate>
|
||||||
<div>
|
</asp:TemplateField>
|
||||||
<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) %>"
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="Nacional">
|
||||||
style="display: inline-block; margin-right: -10px; width: 150px;" />
|
<ItemTemplate>
|
||||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDestinos.ClientID) %>"
|
<asp:Label ID="LtlEsNacional" runat="server" Text='<%# If(Eval("EsNacional").ToString = "True", "Sí", "No") %>'></asp:Label>
|
||||||
style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier">
|
</ItemTemplate>
|
||||||
</i></a>
|
</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--%>
|
||||||
|
<ajax:TabPanel ID="TabImportes" runat="server" HeaderText="Importes">
|
||||||
|
<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">
|
||||||
|
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvImportes.ClientID) %>"
|
||||||
|
style="display: inline-block; margin-right: -10px; width: 150px;" />
|
||||||
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvImportes.ClientID) %>"
|
||||||
|
style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier">
|
||||||
|
</i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<asp:GridView ID="GvImportes" runat="server" AutoGenerateColumns="false" EmptyDataText="No
|
||||||
</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="">
|
|
||||||
<Columns>
|
|
||||||
<asp:TemplateField HeaderText="No. Destino">
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlCveDestino" runat="server" Text='<%# Eval("CveDestino") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
|
|
||||||
<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:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
|
|
||||||
<asp:TemplateField HeaderText="Nacional">
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlEsNacional" runat="server" Text='<%# Eval("EsNacional") %>'></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="UpdateDestino" 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--%>
|
|
||||||
<ajax:TabPanel ID="TabImportes" runat="server" HeaderText="Importes">
|
|
||||||
<ContentTemplate>
|
|
||||||
<div class="spaced">
|
|
||||||
<div>
|
|
||||||
<asp:LinkButton ID="BtnAgregarImporte" runat="server" AlternateText="Agregar"
|
|
||||||
CssClass="btn btn-success btn-sm green" OnClick="AddImporte" 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">
|
|
||||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvImportes.ClientID) %>"
|
|
||||||
style="display: inline-block; margin-right: -10px; width: 150px;" />
|
|
||||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvImportes.ClientID) %>"
|
|
||||||
style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier">
|
|
||||||
</i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<asp:GridView ID="GvImportes" runat="server" AutoGenerateColumns="false" EmptyDataText="No
|
|
||||||
se Encontró Contrato Registrado"
|
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="">
|
data-sort="true" DataKeyNames="CveDestinoTarifa, CveRuta, CveDestinoOrigen, CveDestinoFinal, Importe, Destino, Salida">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField HeaderText="No. Importe">
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="No. Importe">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="LtlCveDestinoTarifa" runat="server" Text='<%# Eval("CveDestinoTarifa")%>'></asp:Literal>
|
<asp:Literal ID="LtlCveDestinoTarifa" runat="server" Text='<%# Eval("CveDestinoTarifa")%>'></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField HeaderText="Destino">
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="Ruta">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="LtlDestino" runat="server" Text='<%# Eval("Destino")%>'></asp:Literal>
|
<asp:Literal ID="LtlCveRuta" runat="server" Text='<%# Eval("Ruta")%>'></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField HeaderText="Salida">
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="Destino">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="LtlSalida" runat="server" Text='<%# Eval("Salida")%>'></asp:Literal>
|
<asp:Literal ID="LtlDestino" runat="server" Text='<%# Eval("Destino")%>'></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField HeaderText="Importe">
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="Salida">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="LtlImporte" runat="server" Text='<%# Eval("Importe")%>'></asp:Literal>
|
<asp:Literal ID="LtlSalida" runat="server" Text='<%# Eval("Salida")%>'></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
<asp:TemplateField ItemStyle-CssClass="bold text-center" HeaderText="Importe">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="BtnEditarImporte" runat="server" AlternateText="Editar"
|
<asp:Literal ID="LtlImporte" runat="server" Text='<%# Eval("Importe")%>'></asp:Literal>
|
||||||
CssClass="btn btn-circle btn-sm green" OnClick="UpdateImporte" Text="<i class='fa fa-pencil'></i>" />
|
</ItemTemplate>
|
||||||
<asp:LinkButton ID="BtnEliminarImporte" runat="server" AlternateText="Eliminar"
|
</asp:TemplateField>
|
||||||
CssClass="btn btn-circle btn-sm red" OnClick="RemoveImporte" 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>
|
|
||||||
|
|
||||||
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="BtnEditarImporte" runat="server" AlternateText="Editar"
|
||||||
|
CssClass="btn btn-circle btn-sm green" OnClick="MostrarModal" Text="<i class='fa fa-pencil'></i>" />
|
||||||
|
<asp:LinkButton ID="BtnEliminarImporte" runat="server" AlternateText="Eliminar"
|
||||||
|
CssClass="btn btn-circle btn-sm red" OnClick="RemoveImporte" 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>
|
||||||
|
</ajax:TabContainer>
|
||||||
|
</asp:Panel>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
</Columns>
|
<div id="Modal" class="modal ADS fade" role="dialog">
|
||||||
</asp:GridView>
|
<asp:UpdatePanel runat="server" ID="UpModal" UpdateMode="Conditional">
|
||||||
</ContentTemplate>
|
<ContentTemplate>
|
||||||
</ajax:TabPanel>
|
<div class="modal-dialog rowpadding">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
<asp:Label runat="server" ID="ModalLabel"></asp:Label>
|
||||||
|
</div>
|
||||||
|
|
||||||
</ajax:TabContainer>
|
<div class="modal-body">
|
||||||
</asp:Panel>
|
<%-- Ruta --%>
|
||||||
|
<asp:Panel runat="server" ID="PnRuta" Visible="False">
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4">Nombre de la ruta</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:TextBox ID="TxtRuta" runat="server" MaxLength="70" Width="100%"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVRuta" runat="server" ControlToValidate="TxtRuta"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Ruta''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCERuta" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVRuta" Width="100%">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4">Estatus:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:DropDownList ID="DdlRutaEstatus" runat="server" Class="table-group-action-input form-control input-inline select2me"
|
||||||
|
AppendDataBoundItems="true"
|
||||||
|
Width="99.9%">
|
||||||
|
<asp:ListItem Text="Seleccione" Value="" Selected="True"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Activo" Value="True"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Inactivo" Value="False"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVRutaEstatus" runat="server" ControlToValidate="DdlRutaEstatus"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCERutaEstatus" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVRutaEstatus" Width="400px" BehaviorID="_content_VCERutaEstatus">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</asp:Panel>
|
||||||
|
<%-- Destino --%>
|
||||||
|
<asp:Panel ID="PnDestino" runat="server" Visible="false">
|
||||||
|
<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: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>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEDestino" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVDestino" Width="100%">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4">Nacional:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:DropDownList ID="DdlEsNacional" runat="server" Class="table-group-action-input form-control input-inline select2me"
|
||||||
|
AppendDataBoundItems="true"
|
||||||
|
Width="99.9%">
|
||||||
|
<asp:ListItem Text="Seleccione" Value="" Selected="True"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Sí" Value="True"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="No" Value="False"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVEsNacional" runat="server" ControlToValidate="DdlEsNacional"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nacional''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEEsNacional" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVEsNacional" Width="400px" BehaviorID="_content_VCEEsNacional">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4">Estatus:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:DropDownList ID="DdlDestinoEstatus" runat="server" Class="table-group-action-input form-control input-inline select2me"
|
||||||
|
AppendDataBoundItems="true"
|
||||||
|
Width="99.9%">
|
||||||
|
<asp:ListItem Text="Seleccione" Value="" Selected="True"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Activo" Value="True"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Inactivo" Value="False"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVDestinoEstatus" runat="server" ControlToValidate="DdlDestinoEstatus"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEDestinoEstatus" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVDestinoEstatus" Width="400px" BehaviorID="_content_VCEDestinoEstatus">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</asp:Panel>
|
||||||
|
<%-- Importes --%>
|
||||||
|
<asp:Panel ID="PnImporte" runat="server" Visible="false">
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4">Ruta:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:DropDownList ID="DdlRutas" AppendDataBoundItems="true" DataTextField="Ruta"
|
||||||
|
DataValueField="CveRuta" Class="form-control input-sm select2me"
|
||||||
|
Width="200px" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVRutas" runat="server" ControlToValidate="DdlRutas"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Ruta''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCERutas" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVRutas" Width="400px" BehaviorID="_content_VCERutas">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4">Partida:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:DropDownList ID="DdlOrigen" runat="server" Class="table-group-action-input form-control input-inline select2me"
|
||||||
|
AppendDataBoundItems="true"
|
||||||
|
Width="99.9%" DataTextField="Destino"
|
||||||
|
DataValueField="CveDestino">
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVOrigen" runat="server" ControlToValidate="DdlOrigen"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Partida''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEOrigen" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVOrigen" Width="400px" BehaviorID="_content_VCEOrigen">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4">Destino:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:DropDownList ID="DdlFinal" runat="server" Class="table-group-action-input form-control input-inline select2me"
|
||||||
|
AppendDataBoundItems="true"
|
||||||
|
Width="99.9%" DataTextField="Destino"
|
||||||
|
DataValueField="CveDestino">
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVFinal" runat="server" ControlToValidate="DdlFinal"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Origen''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEFinal" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVFinal" Width="400px" BehaviorID="_content_VCEFinal">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<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"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="VCOImporte"
|
||||||
|
TargetControlID="RFVDestino" Width="100%">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</asp:Panel>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:Button ID="BtnAddRuta" OnClick="AddRuta" runat="server" CssClass="btn btn-primary"
|
||||||
|
ValidationGroup="GrpGuardar" Visible="false"></asp:Button>
|
||||||
|
<asp:Button ID="BtnAddDestino" OnClick="AddDestino" runat="server" CssClass="btn btn-primary"
|
||||||
|
ValidationGroup="GrpGuardar" Visible="false"></asp:Button>
|
||||||
|
<asp:Button ID="BtnAddImporte" OnClick="AddImporte" runat="server" CssClass="btn btn-primary"
|
||||||
|
ValidationGroup="GrpGuardar" Visible="false"></asp:Button>
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,21 @@
|
|||||||
Option Explicit On
|
Option Explicit On
|
||||||
Option Strict On
|
Option Strict On
|
||||||
|
|
||||||
Partial Class CatRutas
|
Partial Class CatRutas
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
|
|
||||||
|
Private Property Cve As Integer
|
||||||
|
Get
|
||||||
|
Return ViewState("Cve").ToString().ToEntero
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("Cve") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
InicializaCalendar()
|
ViewState("Cve") = 0
|
||||||
|
InicializarCombos()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -34,48 +45,243 @@ Partial Class CatRutas
|
|||||||
GvImportes.DataBind()
|
GvImportes.DataBind()
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub InicializaCalendar()
|
UpPanel.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub InicializarCombos()
|
||||||
|
Dim ObjDestinos As New ClsTransportes()
|
||||||
|
|
||||||
|
If ObjDestinos.GetDestinos() Then
|
||||||
|
|
||||||
|
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
DdlOrigen.DataSource = ObjDestinos.DtResultados
|
||||||
|
DdlOrigen.DataBind()
|
||||||
|
DdlOrigen.Items.Insert(0, New ListItem("Seleccione Partida", ""))
|
||||||
|
|
||||||
|
DdlFinal.DataSource = ObjDestinos.DtResultados
|
||||||
|
DdlFinal.DataBind()
|
||||||
|
DdlFinal.Items.Insert(0, New ListItem("Seleccione Destino", ""))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjDestinos.Dispose()
|
||||||
|
|
||||||
|
|
||||||
|
Dim ObjRutas As New ClsTransportes()
|
||||||
|
If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
|
||||||
|
|
||||||
|
If ObjRutas.DtResultados.Rows.Count > 0 Then
|
||||||
|
DdlRutas.DataSource = ObjRutas.DtResultados
|
||||||
|
DdlRutas.DataBind()
|
||||||
|
DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", ""))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub MostrarModal(sender As Object, e As EventArgs)
|
||||||
|
TxtRuta.Text = ""
|
||||||
|
DdlRutaEstatus.SelectedValue = ""
|
||||||
|
TxtDestino.Text = ""
|
||||||
|
DdlEsNacional.SelectedValue = ""
|
||||||
|
DdlDestinoEstatus.SelectedValue = ""
|
||||||
|
DdlOrigen.SelectedValue = ""
|
||||||
|
DdlFinal.SelectedValue = ""
|
||||||
|
TxtImporte.Text = ""
|
||||||
|
BtnAddRuta.Visible = False
|
||||||
|
BtnAddDestino.Visible = False
|
||||||
|
BtnAddImporte.Visible = False
|
||||||
|
PnRuta.Visible = False
|
||||||
|
PnDestino.Visible = False
|
||||||
|
PnImporte.Visible = False
|
||||||
|
Dim id As String = DirectCast(sender, LinkButton).ID
|
||||||
|
|
||||||
|
If id.Contains("Editar") Then
|
||||||
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
|
|
||||||
|
Select Case id
|
||||||
|
Case "BtnEditarRuta"
|
||||||
|
ModalLabel.Text = "Editar Ruta"
|
||||||
|
PnRuta.Visible = True
|
||||||
|
TxtRuta.Text = GvRow.DataKey("Ruta")
|
||||||
|
DdlRutaEstatus.SelectedValue = GvRow.DataKey("Estatus")
|
||||||
|
BtnAddRuta.Visible = True
|
||||||
|
BtnAddRuta.Text = "Editar"
|
||||||
|
ViewState("Cve") = GvRow.DataKey("CveRuta").ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
Case "BtnEditarDestino"
|
||||||
|
ModalLabel.Text = "Editar Destino"
|
||||||
|
TxtDestino.Text = GvRow.DataKey("Destino")
|
||||||
|
DdlEsNacional.SelectedValue = GvRow.DataKey("EsNacional")
|
||||||
|
DdlDestinoEstatus.SelectedValue = GvRow.DataKey("Estatus")
|
||||||
|
PnDestino.Visible = True
|
||||||
|
BtnAddDestino.Visible = True
|
||||||
|
BtnAddDestino.Text = "Editar"
|
||||||
|
ViewState("Cve") = GvRow.DataKey("CveDestino").ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
Case "BtnEditarImporte"
|
||||||
|
ModalLabel.Text = "Editar Importe"
|
||||||
|
DdlRutas.SelectedValue = GvRow.DataKey("CveRuta")
|
||||||
|
DdlOrigen.SelectedValue = GvRow.DataKey("CveDestinoOrigen")
|
||||||
|
DdlFinal.SelectedValue = GvRow.DataKey("CveDestinoFinal")
|
||||||
|
TxtImporte.Text = GvRow.DataKey("Importe")
|
||||||
|
PnImporte.Visible = True
|
||||||
|
BtnAddImporte.Visible = True
|
||||||
|
BtnAddImporte.Text = "Editar"
|
||||||
|
ViewState("Cve") = GvRow.DataKey("CveDestinoTarifa").ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
|
If id.Contains("Agregar") Then
|
||||||
|
Select Case id
|
||||||
|
Case "BtnAgregarRuta"
|
||||||
|
ModalLabel.Text = "Agregar Ruta"
|
||||||
|
PnRuta.Visible = True
|
||||||
|
BtnAddRuta.Visible = True
|
||||||
|
BtnAddRuta.Text = "Guardar"
|
||||||
|
Case "BtnAgregarDestino"
|
||||||
|
ModalLabel.Text = "Agregar Destino"
|
||||||
|
PnDestino.Visible = True
|
||||||
|
BtnAddDestino.Visible = True
|
||||||
|
BtnAddDestino.Text = "Guardar"
|
||||||
|
Case "BtnAgregarImporte"
|
||||||
|
ModalLabel.Text = "Agregar Importe"
|
||||||
|
PnImporte.Visible = True
|
||||||
|
BtnAddImporte.Visible = True
|
||||||
|
BtnAddImporte.Text = "Guardar"
|
||||||
|
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
UpModal.Update()
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal('show');", "Modal"))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
#Region "Rutas"
|
#Region "Rutas"
|
||||||
Protected Sub AddRuta(sender As Object, e As EventArgs)
|
Protected Sub AddRuta(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
End Sub
|
Dim ObjRuta As New ClsTransportes
|
||||||
Protected Sub UpdateRuta(sender As Object, e As EventArgs)
|
ObjRuta.IniciaTransacSQL()
|
||||||
|
Try
|
||||||
|
If BtnAddRuta.Text = "Guardar" Then
|
||||||
|
If ObjRuta.AddRuta(TxtRuta.Text, DdlRutaEstatus.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 1 Then
|
||||||
|
ObjRuta.Commit()
|
||||||
|
Alert("Ruta Agregada Correctamente.")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If BtnAddRuta.Text = "Editar" Then
|
||||||
|
If ObjRuta.UpdateRuta(Cve, TxtRuta.Text, DdlRutaEstatus.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||||
|
ObjRuta.Commit()
|
||||||
|
Alert("Ruta Actualizada Correctamente.")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
ObjRuta.RollBack()
|
||||||
|
Finally
|
||||||
|
CargaDatos()
|
||||||
|
ObjRuta.Dispose()
|
||||||
|
End Try
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub RemoveRuta(sender As Object, e As EventArgs)
|
Protected Sub RemoveRuta(sender As Object, e As EventArgs)
|
||||||
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
|
Dim ObjRuta As New ClsTransportes
|
||||||
|
|
||||||
|
If ObjRuta.RemoveRuta(GvRow.DataKey("CveRuta").ToEntero) Then
|
||||||
|
Alert("Ruta eliminada correctamente")
|
||||||
|
CargaDatos()
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjRuta.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Destinos"
|
#Region "Destinos"
|
||||||
Protected Sub AddDestino(sender As Object, e As EventArgs)
|
Protected Sub AddDestino(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
End Sub
|
Dim ObjDestino As New ClsTransportes
|
||||||
Protected Sub UpdateDestino(sender As Object, e As EventArgs)
|
ObjDestino.IniciaTransacSQL()
|
||||||
|
Try
|
||||||
|
If BtnAddDestino.Text = "Guardar" Then
|
||||||
|
If ObjDestino.AddDestino(TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 1 Then
|
||||||
|
ObjDestino.Commit()
|
||||||
|
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) Then
|
||||||
|
ObjDestino.Commit()
|
||||||
|
Alert("Destino actualizado correctamente.")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
ObjDestino.RollBack()
|
||||||
|
Finally
|
||||||
|
CargaDatos()
|
||||||
|
ObjDestino.Dispose()
|
||||||
|
End Try
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub RemoveDestino(sender As Object, e As EventArgs)
|
Protected Sub RemoveDestino(sender As Object, e As EventArgs)
|
||||||
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
|
Dim ObjDestino As New ClsTransportes
|
||||||
|
|
||||||
|
If ObjDestino.RemoveDestino(GvRow.DataKey("CveDestino").ToEntero) Then
|
||||||
|
Alert("Destino eliminado correctamente")
|
||||||
|
CargaDatos()
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjDestino.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Importes"
|
#Region "Importes"
|
||||||
Protected Sub AddImporte(sender As Object, e As EventArgs)
|
Protected Sub AddImporte(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
End Sub
|
Dim ObjImporte As New ClsTransportes
|
||||||
Protected Sub UpdateImporte(sender As Object, e As EventArgs)
|
ObjImporte.IniciaTransacSQL()
|
||||||
|
Try
|
||||||
|
If BtnAddImporte.Text = "Guardar" Then
|
||||||
|
If ObjImporte.AddDestinosTarifas(DdlRutas.SelectedValue, DdlOrigen.SelectedValue, DdlFinal.SelectedValue, TxtImporte.Text) > 1 Then
|
||||||
|
ObjImporte.Commit()
|
||||||
|
Alert("Importe agregado correctamente.")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If BtnAddImporte.Text = "Editar" Then
|
||||||
|
If ObjImporte.UpdateDestinosTarifas(Cve, DdlRutas.SelectedValue, DdlOrigen.SelectedValue, DdlFinal.SelectedValue, TxtImporte.Text) Then
|
||||||
|
ObjImporte.Commit()
|
||||||
|
Alert("Importe actualizado correctamente.")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
ObjImporte.RollBack()
|
||||||
|
Finally
|
||||||
|
CargaDatos()
|
||||||
|
ObjImporte.Dispose()
|
||||||
|
End Try
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub RemoveImporte(sender As Object, e As EventArgs)
|
Protected Sub RemoveImporte(sender As Object, e As EventArgs)
|
||||||
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
|
Dim ObjImporte As New ClsTransportes
|
||||||
|
|
||||||
|
If ObjImporte.RemoveDestinosTarifas(GvRow.DataKey("CveDestinoTarifa").ToEntero) Then
|
||||||
|
Alert("Importe eliminada correctamente")
|
||||||
|
CargaDatos()
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjImporte.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user