72 lines
2.5 KiB
VB.net
72 lines
2.5 KiB
VB.net
Imports Extensiones
|
|
Imports System.Data
|
|
|
|
Partial Class Acarreos_ContratosAcarreos
|
|
Inherits ClsPaginas
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
If Not Request("Actualizar") = "" Then
|
|
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
CargaDatos()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
Dim ObjAcar As New ClsAcarreos
|
|
If ObjAcar.GetAcarreosProyectos(-1, UsuarioActual.CveEmpresa, -1, "-1") Then
|
|
GvContratoAcarreo.DataSource = ObjAcar.DtResultados
|
|
GvContratoAcarreo.DataBind()
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Response.Redirect($"/Acarreos/RegistroContratosAcarreos.aspx?&CveAcarreoProyecto={GvRow.DataKey("CveAcarreoProyecto")}", True)
|
|
UpDatos.Update()
|
|
End Sub
|
|
|
|
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
|
Dim ObjAcar As New ClsAcarreos()
|
|
Dim ErrorClasif As Boolean = False
|
|
ObjAcar.IniciaTransacSQL()
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
HdnID.Value = GvRow.DataKey("CveAcarreoProyecto")
|
|
UpDatos.Update()
|
|
If Not ObjAcar.RemoveAcarreosMaterialVolumen(HdnID.Value.ToEntero) Then
|
|
ErrorClasif = True
|
|
End If
|
|
If Not ObjAcar.RemoveAcarreosTarifas(HdnID.Value.ToEntero) Then
|
|
ErrorClasif = True
|
|
End If
|
|
If Not ObjAcar.RemoveAcarreosProyectos(HdnID.Value.ToEntero) Then
|
|
ErrorClasif = True
|
|
End If
|
|
|
|
If ErrorClasif = False Then
|
|
ObjAcar.Commit()
|
|
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
|
UpDatos.Update()
|
|
Else
|
|
ObjAcar.RollBack()
|
|
End If
|
|
|
|
CargaDatos()
|
|
ObjAcar.Dispose()
|
|
UpDatos.Update()
|
|
End Sub
|
|
|
|
Private Sub LnkContratoAcarreo_Click(sender As Object, e As EventArgs) Handles LnkContratoAcarreo.Click
|
|
Response.Redirect("/Acarreos/RegistroContratosAcarreos.aspx", True)
|
|
UppAddAcciones.Update()
|
|
End Sub
|
|
|
|
Private Sub GvContratoAcarreo_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvContratoAcarreo.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
|
|
End If
|
|
End Sub
|
|
End Class
|