101 lines
3.6 KiB
VB.net
101 lines
3.6 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
Imports Extensiones
|
|
|
|
Partial Class Contratos_CatContratosTipos
|
|
Inherits ClsPaginas
|
|
|
|
Private Sub Contratos_CatTiposContratos_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
CargaDatos()
|
|
End If
|
|
End Sub
|
|
|
|
|
|
#Region " CARGAS "
|
|
Private Sub CargaDatos()
|
|
Dim Objeto As New ClsContratos
|
|
If Objeto.GetContratosTipos(UsuarioActual.CveEmpresa) Then
|
|
GvContratos.DataSource = Objeto.DtResultados
|
|
GlobalDTContratosTipos(UsuarioActual.CveEmpresa) = Objeto.DtResultados
|
|
End If
|
|
GvContratos.DataBind()
|
|
Objeto.Dispose()
|
|
End Sub
|
|
#End Region
|
|
|
|
|
|
|
|
#Region " GV CONTRATOS Y AGREGAR "
|
|
Private Sub LbAgregarC_Click(sender As Object, e As EventArgs) Handles LbAgregarC.Click
|
|
Dim Objeto As New ClsContratos
|
|
Dim TipoContrato = TxtTipoContrato.Text
|
|
Dim Descripcion = TxtDescripcion.Text
|
|
Dim Estatus = True
|
|
|
|
If Objeto.AddContratosTipos(TipoContrato, Descripcion, Estatus, UsuarioActual.CveUsuario.ToEntero) Then
|
|
TxtTipoContrato.Text = ""
|
|
TxtDescripcion.Text = ""
|
|
CargaDatos()
|
|
UpDatos.Update()
|
|
End If
|
|
|
|
|
|
Objeto.Dispose()
|
|
Alert("El Contrato se agregó correctamente.", TipoMensaje.MsgInformacion)
|
|
End Sub
|
|
|
|
|
|
Protected Sub GvIndicadores_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvContratos.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
'ESTATUS NORMAL
|
|
If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
|
|
e.Row.Cells(0).Width = 70
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Protected Sub GVCarac_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvContratos.RowEditing
|
|
GvContratos.EditIndex = e.NewEditIndex
|
|
CargaDatos()
|
|
End Sub
|
|
|
|
Protected Sub GvContratos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvContratos.RowUpdating
|
|
Dim Update As New ClsContratos
|
|
Dim TipoContrato = GvContratos.Rows(e.RowIndex).FCTextBox("TxtTipoContrato").Text.Trim
|
|
Dim Descripcion = GvContratos.Rows(e.RowIndex).FCTextBox("TxtDescripcion").Text.Trim
|
|
Dim Clave = GvContratos.Rows(e.RowIndex).DataKey("CveContratoTipo").ToEntero
|
|
If Update.UpdateContratosTipos(Clave, TipoContrato, Descripcion, True, UsuarioActual.CveEmpresa) Then
|
|
Alert("El Tipo de Contrato se actualizó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
GvContratos.EditIndex = -1
|
|
CargaDatos()
|
|
UpDatos.Update()
|
|
End Sub
|
|
|
|
Protected Sub GvContratoss_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvContratos.RowCancelingEdit
|
|
GvContratos.EditIndex = -1
|
|
CargaDatos()
|
|
Alert("Se canceló la edición de los campos.")
|
|
End Sub
|
|
|
|
|
|
Protected Sub GvContratos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvContratos.RowDeleting
|
|
Dim Objeto As New ClsContratos
|
|
Dim Clave = GvContratos.Rows(e.RowIndex).DataKey("CveContratoTipo").ToEntero
|
|
|
|
If Objeto.RemoveContratosTipos(Clave) Then
|
|
Alert("Se eliminó correctamente el Tipo de Contrato.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
Objeto.Dispose()
|
|
GvContratos.EditIndex = -1
|
|
CargaDatos()
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
End Class
|