Se trabajo en los modelos y PA de Rutas y Destinos. Se trabajó en la lista de choferes. Se trabajó en la creación de viajes

This commit is contained in:
AbrahamCastilloV
2023-12-08 09:30:40 -07:00
parent 1ce8ac1d39
commit b8896b961a
9 changed files with 953 additions and 34 deletions

View File

@@ -0,0 +1,57 @@
Option Explicit On
Option Strict On
Partial Class ListadoContratos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
GvContratos.DataSource = ObjContratos.DtResultados
Else
Me.GvContratos.DataSource = Nothing
End If
ObjContratos.Dispose()
GvContratos.DataBind()
End Sub
Protected Sub GvContratos_Comandos(sender As Object, e As GridViewCommandEventArgs)
Dim id As Integer = Convert.ToInt32(e.CommandArgument)
Dim url As String = $"ContratoTransporte.aspx?CveContrato={id}"
If e.CommandName = "Editar" Then
Dim script As String = $"window.open('{url}', '_blank');"
Page.ClientScript.RegisterStartupScript(Me.GetType(), "OpenWindow", script, True)
End If
If e.CommandName = "Eliminar" Then
Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL()
Try
ObjContratos.RemoveContrato(id, UsuarioActual.CveEmpresa)
ObjContratos.Commit()
Catch ex As Exception
ObjContratos.RollBack()
Finally
ObjContratos.Dispose()
Response.Redirect("ListadoContratos.aspx")
End Try
End If
End Sub
End Class