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:
57
Transportes/ListadoContratos.aspx.vb
Normal file
57
Transportes/ListadoContratos.aspx.vb
Normal 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
|
||||
Reference in New Issue
Block a user