This commit is contained in:
@@ -9,6 +9,19 @@ Imports Microsoft.Reporting.WebForms
|
||||
Partial Class RH_CatPersonal
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property ISChange As Boolean
|
||||
Get
|
||||
|
||||
If ViewState("ISChange") Is Nothing Then
|
||||
Return False
|
||||
Else
|
||||
Return DirectCast(ViewState("ISChange"), Boolean)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("ISChange") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DTDatos As DataTable
|
||||
Get
|
||||
|
||||
@@ -24,8 +37,12 @@ Partial Class RH_CatPersonal
|
||||
End Property
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then
|
||||
HplAddVenta.Visible = False
|
||||
End If
|
||||
LnkAddPersonalSimplificado.Visible = Not HplAddVenta.Visible
|
||||
TxtFechaIngreso.Text = String.Format("{0:dd/MM/yyyy}", DateTime.Now)
|
||||
ViewState("Orden") = ""
|
||||
|
||||
CargaEscolaridad()
|
||||
CargaEstadoCivil()
|
||||
CargaDepartamento()
|
||||
@@ -41,6 +58,12 @@ Partial Class RH_CatPersonal
|
||||
CargaSupervisores()
|
||||
CargaMetodosPago()
|
||||
CargaDatos()
|
||||
CargaTipoRegimen()
|
||||
CargaJornada()
|
||||
CargaEstados()
|
||||
CargaSatRiesgoPuesto()
|
||||
|
||||
LoadDefaultValues()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -135,6 +158,38 @@ Partial Class RH_CatPersonal
|
||||
|
||||
#Region " C O M B O S "
|
||||
|
||||
Private Sub LoadDefaultValues()
|
||||
DdlDepartamentoAdd.SelectedIndex = 1
|
||||
DdlRegimenContratacion.SelectedValueExist(1)
|
||||
DdlMetodoPagoAdd.SelectedValueExist(1)
|
||||
DdlTipoPeriodoAdd.SelectedValueExist(1)
|
||||
DdlTipoContratoAdd.SelectedValueExist(2)
|
||||
DdlJornada.SelectedValueExist(6)
|
||||
DdlPuestoAdd.SelectedIndex = 1
|
||||
DdlRiesgoPuesto.SelectedIndex = 1
|
||||
End Sub
|
||||
Private Sub CargaSatRiesgoPuesto()
|
||||
DdlRiesgoPuesto.DataSource = GlobalDTNomSatRiesgoPuesto
|
||||
DdlRiesgoPuesto.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaJornada()
|
||||
DdlJornada.DataSource = GlobalDTJornadas
|
||||
DdlJornada.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaEstados()
|
||||
DdlEstados.DataSource = GlobalDTGralEstados(1)
|
||||
DdlEstados.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaTipoRegimen()
|
||||
Dim dt As DataTable = GlobalDTNomSatRegimenContratacion.Copy()
|
||||
For Each item As DataRow In dt.Rows
|
||||
item("RegimenContratacion") = String.Format("{1}{0} {2}", item("CveSATRegimenContratacion"), If(item("CveSATRegimenContratacion").ToString().Length > 1, "", "0"), item("RegimenContratacion"))
|
||||
Next
|
||||
dt.AcceptChanges()
|
||||
|
||||
DdlRegimenContratacion.DataSource = dt.FiltraParametros("", "RegimenContratacion")
|
||||
DdlRegimenContratacion.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaEscolaridad()
|
||||
DdlEscolaridad.DataSource = GlobalDTEscolaridad
|
||||
DdlEscolaridad.DataBind()
|
||||
@@ -142,7 +197,9 @@ Partial Class RH_CatPersonal
|
||||
|
||||
Private Sub CargaGenero()
|
||||
DdlGenero.DataSource = GlobalDTGenero
|
||||
DdlGeneroAdd.DataSource = GlobalDTGenero
|
||||
DdlGenero.DataBind()
|
||||
DdlGeneroAdd.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaEstadoCivil()
|
||||
@@ -153,11 +210,15 @@ Partial Class RH_CatPersonal
|
||||
Private Sub CargaTipoPeriodo()
|
||||
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo
|
||||
DdlTipoPeriodo.DataBind()
|
||||
DdlTipoPeriodoAdd.DataSource = GlobalDTTipoPeriodo
|
||||
DdlTipoPeriodoAdd.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTiposContrato()
|
||||
DdlTipoContrato.DataSource = GlobalDTTiposContrato
|
||||
DdlTipoContrato.DataBind()
|
||||
DdlTipoContratoAdd.DataSource = GlobalDTTiposContrato
|
||||
DdlTipoContratoAdd.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTurno()
|
||||
@@ -167,12 +228,16 @@ Partial Class RH_CatPersonal
|
||||
|
||||
Private Sub CargaDepartamento()
|
||||
DdlDepartamento.DataSource = GlobalDTDepartamentos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlDepartamentoAdd.DataSource = DdlDepartamento.DataSource
|
||||
DdlDepartamentoAdd.DataBind()
|
||||
DdlDepartamento.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPuestos()
|
||||
DdlPuesto.DataSource = GlobalDTRHPuestos(UsuarioActual.CveEmpresa)
|
||||
DdlPuestoAdd.DataSource = DdlPuesto.DataSource
|
||||
DdlPuesto.DataBind()
|
||||
DdlPuestoAdd.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaRuta()
|
||||
@@ -214,6 +279,10 @@ Partial Class RH_CatPersonal
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTipoCentroCosto()
|
||||
|
||||
CargarCentrosDeCosto(DdlProyectoAsignadoAdd, DdlSubProyectoAsignadoAdd, LblProyectoAsignado, LblSubProyectoAsignado)
|
||||
DivProyectosAsignado.Visible = LblProyectoAsignado.Visible
|
||||
|
||||
CargarCentrosDeCosto(DdlProyectoAsignado, DdlSubProyectoAsignado, LblProyecto, LblSubProyecto)
|
||||
DivProyecto.Visible = LblProyecto.Visible
|
||||
ChkSubProyecto.Text = LblSubProyecto.Text
|
||||
@@ -228,6 +297,8 @@ Partial Class RH_CatPersonal
|
||||
Private Sub CargaMetodosPago()
|
||||
DdlMetodoPago.DataSource = GlobalDTMetodosPago
|
||||
DdlMetodoPago.DataBind()
|
||||
DdlMetodoPagoAdd.DataSource = GlobalDTMetodosPago
|
||||
DdlMetodoPagoAdd.DataBind()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -1041,4 +1112,74 @@ Partial Class RH_CatPersonal
|
||||
' End If
|
||||
'End Using
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkGuardar_Click(sender As Object, e As EventArgs)
|
||||
DdlTurno.SelectedIndex = 1
|
||||
Dim CveEtadoCivil = 1
|
||||
Dim CveEstatusPersonal = 1
|
||||
Dim CveEscolaridad As Integer = 0
|
||||
Dim isSindicalizado As Boolean = (DDlSindicalizado.SelectedValue = "1")
|
||||
Dim CvePuesto As Integer = DdlPuestoAdd.SelectedValue.ToEntero()
|
||||
Dim CveSATRiesgoPuesto As Integer = DdlRiesgoPuesto.SelectedValue.ToEntero()
|
||||
Dim continuar As Boolean = False
|
||||
Dim CvePersonal As Integer = 0
|
||||
Using ObjPersonal As New ClsRH()
|
||||
|
||||
If ObjPersonal.AddPersonal("-1", TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim, "", TxtFechaIngreso.Text.ToDate,
|
||||
DdlTipoPeriodoAdd.SelectedValue.ToEntero, TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, 0,
|
||||
0, 0, 0, 0, 15, 25, DdlMetodoPagoAdd.SelectedValue.ToEntero, TxtFechaIngreso.Text.Trim.ToDate, "-1",
|
||||
DdlTipoContratoAdd.SelectedValue.ToEntero, "",
|
||||
DdlTurno.SelectedValue.ToEntero, CvePuesto,
|
||||
DdlDepartamentoAdd.SelectedValue.ToEntero,
|
||||
-1, CveEscolaridad,
|
||||
CveEtadoCivil, DdlGeneroAdd.SelectedValue.ToEntero(),
|
||||
-1, "-1", CveEstatusPersonal, TxtFechaNacimiento.Text.ToDate,
|
||||
"", "", "", "", "", "", "",
|
||||
DdlEstados.SelectedValue.ToEntero, "", "", TxtRFC.Text.Trim,
|
||||
TxtCURP.Text.Trim, "", "", -1, CveSATRiesgoPuesto, DdlRegimenContratacion.SelectedValue.ToEntero,
|
||||
-1, DdlSubProyectoAsignadoAdd.SelectedValue.ToEntero, "",
|
||||
DdlSupervisor.SelectedValue.ToEntero, "", "", DdlJornada.SelectedValue.ToEntero, -1, "-1",
|
||||
0, "Seleccione", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, CveUniforme:=-1,
|
||||
TelefonoExtension:="", CelularPersonal:="", TelefonoMarcadoRapido:="", ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=isSindicalizado, CvePais:=151) Then
|
||||
Alert(String.Format("El empleado a sido agregado satisfactoriamente <a href=""/RH/Personal.aspx?CvePersonal={0}"">Ver empleado</a>", ObjPersonal.CvePersonal), TipoMensaje.ToastInformacion, "", 0)
|
||||
continuar = True
|
||||
ISChange = True
|
||||
Else
|
||||
'Alert("El empleado a sido agregado satisfactoriamente", TipoMensaje.ToastInformacion, "", 0)
|
||||
End If
|
||||
End Using
|
||||
DdlTurno.SelectedValueExist(-1)
|
||||
If continuar Then
|
||||
LimpiarCampos()
|
||||
If chkcontinuarAgregando.Checked Then
|
||||
Else
|
||||
|
||||
RegistraScript("$('#DmodalAddPersonal').modal('hide');")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LimpiarCampos()
|
||||
TxtAPaterno.Text = ""
|
||||
TxtAMaterno.Text = ""
|
||||
TxtNombres.Text = ""
|
||||
TxtFechaNacimiento.Text = ""
|
||||
TxtNumeroSS.Text = ""
|
||||
TxtCURP.Text = ""
|
||||
TxtRFC.Text = ""
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAddPersonalSimplificado_Click(sender As Object, e As EventArgs)
|
||||
ISChange = False
|
||||
UpAddPerSimplificado.Update()
|
||||
LimpiarCampos()
|
||||
RegistraScript("$('#DmodalAddPersonal').modal();")
|
||||
End Sub
|
||||
|
||||
Protected Sub ClickOnHideModal_Click(sender As Object, e As EventArgs)
|
||||
If ISChange Then
|
||||
CargaDatos()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user