75 lines
2.4 KiB
VB.net
75 lines
2.4 KiB
VB.net
Imports Extensiones
|
|
Imports System.Data
|
|
|
|
Partial Class Acarreos_Acarreos
|
|
Inherits ClsPaginas
|
|
|
|
#Region " PROPIEDADES"
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
CargaDatos()
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
Dim ObjAcar As New ClsAcarreos()
|
|
If ObjAcar.GetAcarreo(UsuarioActual.CveEmpresa, -1) Then
|
|
GvAcarreo.DataSource = ObjAcar.DtResultados
|
|
GvAcarreo.DataBind()
|
|
End If
|
|
ObjAcar.Dispose()
|
|
UpDatos.Update()
|
|
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/RegistroAcarreo.aspx?&CveAcarreo={GvRow.DataKey("CveAcarreo")}")
|
|
UpDatos.Update()
|
|
End Sub
|
|
|
|
|
|
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
|
Dim ObjAcar As New ClsAcarreos()
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
HdnID.Value = GvRow.DataKey("CveAcarreo")
|
|
UpDatos.Update()
|
|
If ObjAcar.RemoveAcarreo(HdnID.Value) Then
|
|
CargaDatos()
|
|
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
ObjAcar.Dispose()
|
|
UpDatos.Update()
|
|
End Sub
|
|
|
|
Private Sub GvAcarreo_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvAcarreo.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.DBCampo("CveEstatus") = True Then
|
|
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
|
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
|
|
|
Else
|
|
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
|
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
|
End If
|
|
|
|
If e.Row.DBCampo("CveTipoAcarreo") = True Then
|
|
e.Row.FCLabel("LblTipoAcarreo").Text = "Destino"
|
|
|
|
Else
|
|
e.Row.FCLabel("LblTipoAcarreo").Text = "Origen"
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub LnkAcarreo_Click(sender As Object, e As EventArgs) Handles LnkAcarreo.Click
|
|
Response.Redirect("/Acarreos/RegistroAcarreo.aspx", True)
|
|
UppAddAcciones.Update()
|
|
End Sub
|
|
End Class
|