-Se agregaron las propiedades de viajes a contratos y se alteraron los métodos Add, Get y Update de Contratos. Se agrega el folio a RepContratos. Se le agrega la funcionalidad para imprimir PDF y se aumentan el número de campos para las consultas.

This commit is contained in:
AbrahamCastilloV
2024-02-13 03:56:57 -07:00
parent bd6248a5a4
commit 389c32a7ae
7 changed files with 641 additions and 438 deletions

View File

@@ -32,18 +32,6 @@ Partial Class ListadoViajes
End Sub
Private Sub InicializaCombos()
'Lista Activos Fijos'
Dim ObjAF As New ClsAF()
If ObjAF.GetActivosFijos(-1, 13, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, 1, "-1", -1, -1, -1) Then
If ObjAF.DtResultados.Rows.Count > 0 Then
DdlTransporte.DataSource = ObjAF.DtResultados
DdlTransporte.DataBind()
DdlTransporte.Items.Insert(0, New ListItem("Seleccione Transporte", ""))
End If
End If
ObjAF.Dispose()
'Lista Rutas'
Dim ObjRutas As New ClsTransportes()
If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
@@ -70,11 +58,6 @@ Partial Class ListadoViajes
End If
ObjRutas.Dispose()
'Lista Chofer'
DdlChofer.DataSource = GlobalDTRHPersonal(185)
DdlChofer.DataBind()
DdlChofer.Items.Insert(0, New ListItem("Seleccione Chofer", ""))
End Sub
Private Sub GvViajes_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvViajes.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -102,12 +85,12 @@ Partial Class ListadoViajes
Public Sub MostrarModal()
IsMasivo.Visible = True
DdlRutas.Text = ""
DdlTransporte.Text = ""
DdlChofer.Text = ""
TxtFechaViaje.Text = ""
DdlPartida.Text = ""
DdlDestino.SelectedValue = ""
BtnGuardar.Text = "Guardar"
BtnGuardar.Text = "Agregar"
ModalLabel.InnerHtml = "Agregar Nuevo Viaje"
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
End Sub
@@ -135,7 +118,7 @@ Partial Class ListadoViajes
For Each fecha As DateTime In fechasGeneradas
Try
Dim CveContratoHijo As Integer = -1
CveContratoHijo = ObjTransportes.AddViajes(DdlRutas.Text.ToEntero, DdlTransporte.Text.ToEntero, DdlChofer.Text.ToEntero, UsuarioActual.CveEmpresa, fecha, DdlPartida.Text.ToEntero, DdlDestino.Text.ToEntero, IsMasivo:=True, CveMasivo:=CveMasivo)
CveContratoHijo = ObjTransportes.AddViajes(DdlRutas.Text.ToEntero, -1, -1, UsuarioActual.CveEmpresa, fecha, DdlPartida.Text.ToEntero, DdlDestino.Text.ToEntero, IsMasivo:=True, CveMasivo:=CveMasivo)
If CveContratoHijo > 0 Then
ObjTransportes.Commit()
@@ -146,8 +129,7 @@ Partial Class ListadoViajes
Next
DdlRutas.Text = ""
DdlTransporte.Text = ""
DdlChofer.Text = ""
TxtFechaViaje.Text = ""
DdlPartida.Text = ""
DdlDestino.SelectedValue = ""
@@ -158,21 +140,19 @@ Partial Class ListadoViajes
Try
If BtnGuardar.Text = "Guardar" Then
Dim CveContratoHijo As Integer = -1
CveContratoHijo = ObjTransportes.AddViajes(DdlRutas.Text.ToEntero, DdlTransporte.Text.ToEntero, DdlChofer.Text.ToEntero, UsuarioActual.CveEmpresa, TxtFechaViaje.Text.ToDate, DdlPartida.Text.ToEntero, DdlDestino.Text.ToEntero)
CveContratoHijo = ObjTransportes.AddViajes(DdlRutas.Text.ToEntero, -1, -1, UsuarioActual.CveEmpresa, TxtFechaViaje.Text.ToDate, DdlPartida.Text.ToEntero, DdlDestino.Text.ToEntero)
If CveContratoHijo > 0 Then
ObjTransportes.Commit()
Alert("El Viaje se registró Correctamente.", TipoMensaje.MsgInformacion)
DdlRutas.Text = ""
DdlTransporte.Text = ""
DdlChofer.Text = ""
TxtFechaViaje.Text = ""
DdlPartida.Text = ""
DdlDestino.SelectedValue = ""
End If
Else
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
If ObjTransportes.UpdateViajes(CveViaje.ToEntero, DdlRutas.Text.ToEntero, -1, -1, UsuarioActual.CveEmpresa, TxtFechaViaje.Text.ToDate, DdlPartida.Text.ToEntero, DdlDestino.Text.ToEntero) = True Then
Alert("El viaje se modificó correctamente.", TipoMensaje.MsgInformacion)
ObjTransportes.Commit()
CargaDatos()
@@ -192,11 +172,9 @@ Partial Class ListadoViajes
DivFechaMasivo.Visible = False
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
DdlTransporte.SelectedValue = GvRow.DataKey("CveAF")
DdlRutas.SelectedValue = GvRow.DataKey("CveRuta")
DdlDestino.SelectedValue = GvRow.DataKey("CveDestino")
DdlPartida.SelectedValue = GvRow.DataKey("CvePartida")
DdlChofer.SelectedValue = GvRow.DataKey("CvePersonal")
ViewState("CveViaje") = GvRow.DataKey("CveViaje")
ViewState("Ruta") = GvRow.DataKey("Ruta")
Dim fecha As DateTime
@@ -205,7 +183,9 @@ Partial Class ListadoViajes
TxtFechaViaje.Text = fecha.ToString("yyyy-MM-dd").Replace(" ", "T")
End If
BtnGuardar.Text = "Editar"
BtnGuardar.Text = "Actualizar"
ModalLabel.InnerHtml = "Actualizar Viaje"
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))