146 lines
4.9 KiB
VB.net
146 lines
4.9 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports System.Linq
|
|
Imports Extensiones
|
|
|
|
Partial Class Bancos_CatEstatusIE
|
|
Inherits ClsPaginas
|
|
|
|
|
|
#Region "Propiedades"
|
|
Public Property CveEstatusIE As Integer
|
|
Get
|
|
Return ViewState("CveEstatusIE").ToString.ToEntero
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveEstatusIE") = value
|
|
End Set
|
|
End Property
|
|
Public Property EsEditar As Integer
|
|
Get
|
|
Return ViewState("EsEditar").ToString.ToEntero
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("EsEditar") = value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
CveEstatusIE = -1
|
|
EsEditar = 0
|
|
dvEstatus.Visible = False
|
|
CargaDatos()
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub CargaDatos()
|
|
Dim ObjEstatusIE As New ClsBancos
|
|
If ObjEstatusIE.GetBancos_EstatusIE() Then
|
|
ViewState("DTEstatusIE") = ObjEstatusIE.DtResultados
|
|
GlobalDTBancosEstatusIE = ObjEstatusIE.DtResultados
|
|
GvDatos.DataSource = GlobalDTBancosEstatusIE
|
|
Else
|
|
GvDatos.DataSource = Nothing
|
|
End If
|
|
ObjEstatusIE.Dispose()
|
|
GvDatos.DataBind()
|
|
|
|
If UsuarioActual.Empresa.CvePlataforma = 2 Then
|
|
GvDatos.Columns(5).Visible = False
|
|
GvDatos.Columns(6).Visible = False
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
|
Dim Boton = CType(sender, LinkButton)
|
|
CveEstatusIE = Boton.CommandArgument.ToEntero
|
|
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
|
TxtEstatusIE.Text = GvRow.DataKey("EstatusIE").ToString
|
|
TxtCveEstatusIE.Text = GvRow.DataKey("CveEstatusIE").ToString
|
|
TxtCveEstatusIE.Enabled = False
|
|
chkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False)
|
|
EsEditar = 1
|
|
BtnAgregarCatalogo.Text = "Actualizar"
|
|
dvEstatus.Visible = True
|
|
UpBodyCompuesto.Update()
|
|
UpFooter.Update()
|
|
RegistraScript("$('#divAgregar').modal()")
|
|
End Sub
|
|
|
|
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
|
Dim ObjEstatusIE As New ClsBancos
|
|
|
|
If EsEditar = 0 Then
|
|
If ObjEstatusIE.AddBancos_EstatusIE(TxtCveEstatusIE.Text.Trim.ToEntero, TxtEstatusIE.Text.Trim, UsuarioActual.CveUsuario) Then
|
|
Alert("El estatus se agregó correctamente", TipoMensaje.MsgInformacion)
|
|
End If
|
|
ElseIf EsEditar = 1 Then
|
|
|
|
If ObjEstatusIE.UpdateBancos_EstatusIE(TxtEstatusIE.Text.Trim, chkEstatus.Checked, CveEstatusIE) Then
|
|
Alert("El estatus se editó correctamente", TipoMensaje.MsgInformacion)
|
|
End If
|
|
EsEditar = 0
|
|
dvEstatus.Visible = False
|
|
BtnAgregarCatalogo.Text = "Agregar"
|
|
End If
|
|
RegistraScript("$('#divAgregar').modal('hide')")
|
|
|
|
ObjEstatusIE.Dispose()
|
|
TxtCveEstatusIE.Text = ""
|
|
TxtEstatusIE.Text = ""
|
|
|
|
|
|
CargaDatos()
|
|
UPDatos.Update()
|
|
UpBodyCompuesto.Update()
|
|
|
|
End Sub
|
|
|
|
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
|
Dim ObjEstatusIE As New ClsBancos
|
|
Dim CveEstatusIE As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveEstatusIE").ToEntero
|
|
If ObjEstatusIE.RemoveBancos_EstatusIE(CveEstatusIE) Then
|
|
Alert("El Compuesto se eliminó correctamente", TipoMensaje.MsgInformacion)
|
|
End If
|
|
ObjEstatusIE.Dispose()
|
|
CargaDatos()
|
|
UPDatos.Update()
|
|
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.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveEstatusIE").ToString
|
|
|
|
If e.Row.DBCampo("Estatus") = "Activo" 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 btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
|
|
EsEditar = 0
|
|
RegistraScript("$('#divAgregar').modal()")
|
|
BtnAgregarCatalogo.Text = "Agregar"
|
|
TxtCveEstatusIE.Text = ""
|
|
TxtEstatusIE.Text = ""
|
|
TxtCveEstatusIE.Enabled = True
|
|
dvEstatus.Visible = False
|
|
UpBodyCompuesto.Update()
|
|
UpFooter.Update()
|
|
End Sub
|
|
|
|
End Class
|