37 lines
4.1 KiB
Plaintext
37 lines
4.1 KiB
Plaintext
Option Strict On
|
|
Imports System.Data
|
|
Imports System.Collections.Generic
|
|
Imports System.Linq
|
|
Imports System.Web
|
|
Imports System.Web.UI.WebControls
|
|
Imports Extensiones
|
|
|
|
Partial Class CATCalidad
|
|
Inherits ClsPaginas
|
|
|
|
|
|
|
|
#Region "Propiedades"
|
|
|
|
Private Property CveCalidad() As Int32
|
|
Get
|
|
Return If(IsNothing(ViewState("CveCalidad")), 0, CInt(ViewState("CveCalidad")))
|
|
End Get
|
|
Set
|
|
ViewState("CveCalidad") = Value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
CargaCalidad()
|
|
End If
|
|
End Sub
|
|
Protected Sub CargaCalidad()
|
|
Dim ObjCali As New ClsCGame()
|
|
If ObjCali.GetCalidad(UsuarioActual.CveEmpresa) Then
|
|
GVCalidad.DataSource = ObjCali.DtResultados
|
|
GVCalidad.DataBind()
|
|
End If
|
|
ObjCali.Dispose()
|
|
upDatosCali.Update()
|
|
End Sub
|
|
|
|
Protected Sub LimpiaCalidad()
|
|
TxtCalicalidad.Text = ""
|
|
UPModalCali.Update()
|
|
End Sub
|
|
Protected Sub LnkEditarCali_Click(sender As Object, e As EventArgs)
|
|
LimpiaCalidad()
|
|
Dim gvRow As GridViewRow= DirectCast((DirectCast(sender,LinkButton)).NamingContainer,GridViewRow)
|
|
CveCalidad = gvRow.DataKey("CveCalidad").ToEntero()
|
|
TxtCalicalidad.Text = gvRow.DataKey("Calidad")
|
|
ChkCaliestatus.Checked = CBool(gvRow.DataKey("Estatus"))
|
|
RegistraScript("$('#DModalCalidad').modal()")
|
|
BtnCaliADD.Visible=False
|
|
BtnCaliEdit.Visible = True
|
|
DivEstatus.Visible = True
|
|
UPModalCali.Update()
|
|
End Sub
|
|
Protected Sub LnkAgregarCali_Click(sender As Object, e As EventArgs)
|
|
RegistraScript("$('#DModalCalidad').modal()")
|
|
LimpiaCalidad()
|
|
BtnCaliADD.Visible=True
|
|
BtnCaliEdit.Visible = False
|
|
DivEstatus.Visible = False
|
|
UPModalCali.Update()
|
|
End Sub
|
|
Protected Sub BtnCaliADD_Click(sender As Object, e As EventArgs)
|
|
Dim ObjCali As New ClsCGame()
|
|
Dim Continuar As Boolean = ObjCali.AddCalidad(TxtCalicalidad.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
ObjCali.Dispose()
|
|
If (Continuar) Then
|
|
RegistraScript("$('#DModalCalidad').modal('hide')")
|
|
LimpiaCalidad()
|
|
UPModalCali.Update()
|
|
Alert("El Calidad se ha agregado")
|
|
CargaCalidad()
|
|
End If
|
|
End Sub
|
|
Protected Sub BtnCaliEdit_Click(sender As Object, e As EventArgs)
|
|
Dim ObjCali As New ClsCGame()
|
|
Dim Continuar As Boolean = ObjCali.UpdateCalidad(CveCalidad, TxtCalicalidad.Text, ChkCaliestatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
ObjCali.Dispose()
|
|
If (Continuar) Then
|
|
RegistraScript("$('#DModalCalidad').modal('hide')")
|
|
LimpiaCalidad()
|
|
UPModalCali.Update()
|
|
Alert("El Calidad se ha actualizado")
|
|
CargaCalidad()
|
|
End If
|
|
End Sub
|
|
Protected Sub LnkEliminarCali_Click(sender As Object, e As EventArgs)
|
|
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
|
CveCalidad = gvRow.DataKey("CveCalidad").ToEntero()
|
|
Dim ObjCali As New ClsCGame()
|
|
Dim Continuar As Boolean = ObjCali.RemoveCalidad(CveCalidad)
|
|
ObjCali.Dispose()
|
|
If (Continuar) Then
|
|
Alert("El Calidad se ha eliminado")
|
|
CargaCalidad()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub GVCalidad_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVCalidad.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If CBool(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
|
|
End Class
|