This commit is contained in:
2023-12-26 19:24:48 -07:00
11 changed files with 372 additions and 248 deletions

View File

@@ -23,12 +23,12 @@
text-align: center;
}
.disponible:hover {
.disponible:hover,.disponible.activo {
background-color: #45b6af;
color: #fff;
}
.disponible.activo {
{
background-color: #45b6af;
color: #fff;
}
@@ -49,17 +49,21 @@
color: #fff;
}
.chofer {
align-items: center;
text-align: center;
background-color: #BFBFBF;
.btnChofer {
width: 45px;
height: 45px;
border-radius: 10px !important;
margin: 5px;
cursor: pointer;
color: black;
border: 1px solid black;
text-align: center;
color: black
}
.btnChofer a{
color:#2C3E50;
}
.btnChofer:hover {
background-color: #E1E5EC;
}
</style>
</asp:Content>
@@ -218,8 +222,8 @@
<table>
<tbody>
<tr>
<td colspan="5" class="chofer my-1">
<asp:LinkButton ID="chofer" runat="server" class="chofer"
<td colspan="2" class="btnChofer my-1">
<asp:LinkButton ID="chofer" runat="server"
Text="<i class='fa fa-user'><br/>Chofer</i>" />
</td>
</tr>

View File

@@ -65,7 +65,7 @@ Partial Class Boletos
TxtFecha.Text = ObjViaje.Fecha.ToShortDateString
'Boletos Vendidos
Dim dt As DataTable
If ObjViaje.GetViajesPasajeros(CveViaje) Then
If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=True) Then 'Poner párametro para estatus y cancelado de viajes
dt = ObjViaje.DtResultados
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
For Each dr As DataRow In dt.Rows
@@ -138,7 +138,6 @@ Partial Class Boletos
linkButton.CssClass += " activo"
AsientoSeleccionado = buttonID
End Sub
Protected Sub AddBoleto(sender As Object, e As EventArgs)
If AsientoSeleccionado = "" Then
@@ -151,7 +150,7 @@ Partial Class Boletos
Try
AsientoSeleccionado = AsientoSeleccionado.Replace("A", "")
Dim retorno As Integer = ObjTransporte.AddViajePasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario)
Dim retorno As Integer = ObjTransporte.AddViajesPasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario)
If retorno > 1 Then
ObjTransporte.Commit()

View File

@@ -10,7 +10,6 @@
.my-1 {
margin-block: 1rem;
}
</style>
</asp:Content>
@@ -38,7 +37,7 @@
<ItemTemplate>
<asp:Literal ID="LtlAsiento" runat="server" Text='<%# Eval("Asiento") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre">
<ItemTemplate>
@@ -76,10 +75,10 @@
<ItemTemplate>
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="BtnEliminar" runat="server" AlternateText="Eliminar"
<asp:LinkButton ID="BtnToggle" runat="server" AlternateText="Activar/Desactivar"
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-cancel'></i>"
data-toggle="confirmation" data-popout="true" data-original-title="Confirmar"
data-btn-ok-label="si" />
data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("Estatus").ToString = "True", "Cancelar Boleto", "Reactivar") %>'
data-btn-ok-label="si" OnClick="ToggleViajesPasajeros" />
<asp:LinkButton ID="BtnViaje" runat="server" AlternateText="Viaje"
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-print'></i>" />
@@ -88,7 +87,7 @@
</Columns>
</asp:GridView>
</div>
</asp:Content>

View File

@@ -1,5 +1,6 @@
Option Explicit On
Option Strict On
Imports ADSNetLibrary.Helpers
Imports ADSNetLibrary.SIGAPI.Helpers
Imports Extensiones.ModExtensiones
@@ -40,4 +41,28 @@ Partial Class ListadoBoletos
End If
End Sub
Protected Sub ToggleViajesPasajeros(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveViajePasajero As String = GvRow.DataKey("CveViajePasajero")
Dim Estatus As String = GvRow.DataKey("Estatus")
Dim cambiarEstatus As Boolean = Not Estatus.ToBool
Dim ObjTransportes As New ClsTransportes
Try
ObjTransportes.IniciaTransacSQL()
If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero.ToEntero, Activar:=True, Estatus:=cambiarEstatus) Then
Alert("El boleto ha sido cancelado correctamente.")
End If
ObjTransportes.Commit()
Catch ex As Exception
ObjTransportes.RollBack()
Alert($"No se pudo cambiar el estatus del boleto {ex}", TipoMensaje.MsgError)
Finally
ObjTransportes.Dispose()
CargaDatos()
End Try
End Sub
End Class

View File

@@ -6,6 +6,16 @@ Imports Extensiones.ModExtensiones
Partial Class ListadoViajes
Inherits ClsPaginas
#Region "Propiedades"
Private Property CveViaje As String
Get
Return ViewState("CveViaje").ToString()
End Get
Set(value As String)
ViewState("CveViaje") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -155,11 +165,11 @@ Partial Class ListadoViajes
DdlDestino.SelectedValue = ""
End If
Else
Dim id As Integer = Convert.ToInt32(Request.QueryString("CveViaje"))
If ObjTransportes.UpdateViajes(id, DdlRutas.Text.ToEntero, DdlTransporte.Text.ToEntero, DdlChofer.Text.ToEntero, UsuarioActual.CveEmpresa, TxtFechaViaje.Text.ToDate, DdlPartida.Text.ToEntero, DdlDestino.Text.ToEntero) = True Then
If ObjTransportes.UpdateViajes(CveViaje.ToEntero, DdlRutas.Text.ToEntero, DdlTransporte.Text.ToEntero, DdlChofer.Text.ToEntero, UsuarioActual.CveEmpresa, TxtFechaViaje.Text.ToDate, DdlPartida.Text.ToEntero, DdlDestino.Text.ToEntero) = True Then
Alert("El viaje se modificó correctamente.", TipoMensaje.MsgInformacion)
ObjTransportes.Commit()
CargaDatos()
End If
End If
Catch ex As Exception
@@ -181,6 +191,8 @@ Partial Class ListadoViajes
DdlDestino.SelectedValue = GvRow.DataKey("CveDestino")
DdlPartida.SelectedValue = GvRow.DataKey("CvePartida")
DdlChofer.SelectedValue = GvRow.DataKey("CvePersonal")
ViewState("CveViaje") = GvRow.DataKey("CveViaje")
Page.Response.Write("<script>console.log('El resultado de tu variable" + CveViaje + "')</script>")
Dim fecha As DateTime
If DateTime.TryParse(GvRow.DataKey("Fecha").ToString, fecha) Then