Commit inicial Ventas Productivo
This commit is contained in:
192
RH/CatCursosCapacitadores.aspx.vb
Normal file
192
RH/CatCursosCapacitadores.aspx.vb
Normal file
@@ -0,0 +1,192 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
|
||||
Partial Class RH_CatCursosCapacitadores
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveCapaciatador As Integer
|
||||
Get
|
||||
If Not ViewState("CveCapaciatador") Is Nothing Then
|
||||
Return ViewState("CveCapaciatador").ToString.ToEntero
|
||||
Else
|
||||
Return 0
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCapaciatador") = value
|
||||
End Set
|
||||
|
||||
End Property
|
||||
|
||||
Private Property Actualizar As Boolean
|
||||
Get
|
||||
If Not ViewState("Actualizar") Is Nothing Then
|
||||
Return DirectCast(ViewState("Actualizar"), Boolean)
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("Actualizar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Sub RH_CatCapacitadores_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
CargadatosGvCapacitador()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#Region "Capcitador"
|
||||
|
||||
Private Sub CargadatosGvCapacitador()
|
||||
|
||||
Dim objRH As New ClsRH
|
||||
|
||||
If objRH.CapacitadoresGet(-1, -1, -1, UsuarioActual.Empresa.CveEmpresa) Then
|
||||
GvCapacitadores.DataSource = objRH.DtResultados
|
||||
Else
|
||||
GvCapacitadores.DataSource = Nothing
|
||||
End If
|
||||
objRH.Dispose()
|
||||
|
||||
GvCapacitadores.DataBind()
|
||||
UpGral.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCapacitador_Click(sender As Object, e As EventArgs) Handles BtnAgregarCapacitador.Click
|
||||
LtlTituloModalCapacitadores.Text = "Agregar Capacitador"
|
||||
BtnAgregarCapacitadorModal.Text = "Agregar"
|
||||
Actualizar = False
|
||||
TxtCapacitador.Text = ""
|
||||
TxtCedula.Text = ""
|
||||
TxtEspecialidades.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
Actualizar = False
|
||||
UpGral.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAgregarCapacitador"))
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCapacitadorModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarCapacitadorModal.Click
|
||||
|
||||
Dim objRH As New ClsRH
|
||||
Dim Estatus As Integer = 0
|
||||
Dim Externo As Integer = 0
|
||||
|
||||
If ChkEstatus.Checked Then
|
||||
Estatus = 1
|
||||
Else
|
||||
Estatus = 0
|
||||
End If
|
||||
|
||||
If chkExterno.Checked Then
|
||||
Externo = 1
|
||||
Else
|
||||
Externo = 0
|
||||
End If
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarCapacitador"), "jsHideModalCapacitador")
|
||||
|
||||
UpGral.Update()
|
||||
|
||||
If Not Actualizar Then
|
||||
If objRH.CapacitadorAdd(TxtCapacitador.Text, Estatus, Externo, TxtCedula.Text, TxtEspecialidades.Text, UsuarioActual.Empresa.CveEmpresa, UsuarioActual.CveUsuario) Then
|
||||
|
||||
CveCapaciatador = 0
|
||||
TxtCapacitador.Text = ""
|
||||
TxtEspecialidades.Text = ""
|
||||
TxtCedula.Text = ""
|
||||
|
||||
ChkEstatus.Checked = True
|
||||
chkExterno.Checked = True
|
||||
|
||||
CargadatosGvCapacitador()
|
||||
UpGral.Update()
|
||||
|
||||
Alert("Capacitador Agregado Correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrio un error al guardar el Capacitador", TipoMensaje.MsgError)
|
||||
End If
|
||||
Else
|
||||
If objRH.CapacitadorUpdate(CveCapaciatador, TxtCapacitador.Text, Estatus, Externo, TxtCedula.Text, TxtEspecialidades.Text, UsuarioActual.Empresa.CveEmpresa, UsuarioActual.CveUsuario) Then
|
||||
|
||||
CveCapaciatador = 0
|
||||
TxtCapacitador.Text = ""
|
||||
TxtEspecialidades.Text = ""
|
||||
TxtCedula.Text = ""
|
||||
|
||||
ChkEstatus.Checked = True
|
||||
chkExterno.Checked = True
|
||||
|
||||
CargadatosGvCapacitador()
|
||||
UpModaCapacitador.Update()
|
||||
|
||||
Alert("Capacitador Actualizado Correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrio un error al Actualizar el Capacitador", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
CveCapaciatador = 0
|
||||
Actualizar = False
|
||||
objRH.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Remove_ClickCapacitador(sender As Object, e As EventArgs)
|
||||
|
||||
Dim objRH As New ClsRH
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim activo As Boolean = 0
|
||||
Dim CveCapacitador As Integer = GvRow.DataKey("CveCapacitador")
|
||||
|
||||
If objRH.CapacitadorRemove(CveCapacitador) Then
|
||||
CargadatosGvCapacitador()
|
||||
|
||||
Alert("Capacitador Elimino Correctamente ", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrio un error al Eliminar el Capacitador", TipoMensaje.MsgError)
|
||||
End If
|
||||
CveCapaciatador = 0
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_ClickCapacitador(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim activo As Boolean = 0
|
||||
|
||||
LtlTituloModalCapacitadores.Text = "Editar Capacitador"
|
||||
Actualizar = True
|
||||
|
||||
CveCapaciatador = GvRow.DataKey("CveCapacitador")
|
||||
TxtCapacitador.Text = GvRow.DataKey("Capacitador")
|
||||
TxtEspecialidades.Text = GvRow.DataKey("Especialidades")
|
||||
TxtCedula.Text = GvRow.DataKey("Cedula")
|
||||
|
||||
ChkEstatus.Checked = GvRow.DataKey("Estatus")
|
||||
chkExterno.Checked = GvRow.DataKey("Externo")
|
||||
|
||||
BtnAgregarCapacitadorModal.Text = "Actualizar"
|
||||
|
||||
UpModaCapacitador.Update()
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAgregarCapacitador"))
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user