Commit inicial Ventas Productivo
This commit is contained in:
52
GPS/CatModelos.aspx.vb
Normal file
52
GPS/CatModelos.aspx.vb
Normal file
@@ -0,0 +1,52 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class GPS_CatModelos
|
||||
Inherits ClsPaginas
|
||||
|
||||
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 GPS As New ClsGPS
|
||||
If GPS.ModeloGet(-1, -1) Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCHyperLink("ImgE").NavigateUrl = $"/GPS/WizardModelo.aspx?CveModelo={e.Row.DataKey("CveModelo").ToString}"
|
||||
|
||||
If e.Row.DBCampo("Estatus") = 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
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveModelo As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveModelo").ToEntero
|
||||
If GPS.ModeloDelete(CveModelo) Then
|
||||
Alert("El modelo se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user