This commit is contained in:
2023-07-28 11:37:24 -07:00
3 changed files with 196 additions and 197 deletions

View File

@@ -1595,6 +1595,7 @@
<asp:BoundField DataField="TipoPago" HeaderText="Tipo pago" /> <asp:BoundField DataField="TipoPago" HeaderText="Tipo pago" />
<asp:BoundField DataField="DiasextraAutorizado" HeaderText="Días extra" /> <asp:BoundField DataField="DiasextraAutorizado" HeaderText="Días extra" />
<asp:BoundField DataField="diasPago" HeaderText="Días pago" /> <asp:BoundField DataField="diasPago" HeaderText="Días pago" />
<asp:BoundField DataField="DiasPrima" HeaderText="Días Prima" />
<asp:TemplateField HeaderText="Aplica prima"> <asp:TemplateField HeaderText="Aplica prima">
<ItemTemplate> <ItemTemplate>
<asp:Label runat="server" Text='<%# ((Eval("AplicaPrima").ToString() == "1" || Eval("AplicaPrima").ToString().ToUpper() == "TRUE") ? "Sí": "No") %>'> </asp:Label> <asp:Label runat="server" Text='<%# ((Eval("AplicaPrima").ToString() == "1" || Eval("AplicaPrima").ToString().ToUpper() == "TRUE") ? "Sí": "No") %>'> </asp:Label>

View File

@@ -3270,6 +3270,7 @@
<asp:BoundField DataField="TipoPago" HeaderText="Tipo pago" /> <asp:BoundField DataField="TipoPago" HeaderText="Tipo pago" />
<asp:BoundField DataField="DiasextraAutorizado" HeaderText="Días extra" /> <asp:BoundField DataField="DiasextraAutorizado" HeaderText="Días extra" />
<asp:BoundField DataField="diasPago" HeaderText="Días pago" /> <asp:BoundField DataField="diasPago" HeaderText="Días pago" />
<asp:BoundField DataField="DiasPrima" HeaderText="Días Prima" />
<asp:TemplateField HeaderText="Aplica prima"> <asp:TemplateField HeaderText="Aplica prima">
<ItemTemplate> <ItemTemplate>
<asp:Label runat="server" Text='<%# If(Eval("AplicaPrima").ToString() = "1" Or Eval("AplicaPrima").ToString().ToUpper() = "TRUE", "Sí", "No") %>'> </asp:Label> <asp:Label runat="server" Text='<%# If(Eval("AplicaPrima").ToString() = "1" Or Eval("AplicaPrima").ToString().ToUpper() = "TRUE", "Sí", "No") %>'> </asp:Label>

View File

@@ -943,25 +943,22 @@ Partial Class RH_Personal
divBitacora.Visible = True divBitacora.Visible = True
CargaGvBitacora() CargaGvBitacora()
CargaCuentasBancarias()
CarcaConceptosNomina()
CargaFonacot()
End If End If
Else Else
cargatipoTrabajador() cargatipoTrabajador()
MostrarOcultarFechasEstatus() MostrarOcultarFechasEstatus()
LoadDefaultValues() LoadDefaultValues()
'Configuración de Modalidad Insert
ImgAddObs.Visible = False ImgAddObs.Visible = False
LblFechaCaptura.Text = Now.ToShortDateString() LblFechaCaptura.Text = Now.ToShortDateString()
LblUsuarioCapturo.Text = UsuarioActual.Usuario LblUsuarioCapturo.Text = UsuarioActual.Usuario
ViewState("CvePersonal") = -1 ViewState("CvePersonal") = -1
BtnEliminar.Visible = False BtnEliminar.Visible = False
CarcaConceptosNomina()
CargaFonacot()
CargaCuentasBancarias()
'Inicia Permisos
'Fin Permisos
End If End If
If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
@@ -1939,218 +1936,219 @@ Partial Class RH_Personal
Dim EnviarCorreoNomina As Boolean = False Dim EnviarCorreoNomina As Boolean = False
'System.Threading.Thread.Sleep(3000) 'System.Threading.Thread.Sleep(3000)
Dim ObjPersonal As New ClsRH() Using ObjPersonal As New ClsRH()
Dim ObjCuentasDeposito As New ClsGenerales(ObjPersonal.IniciaTransacSQL()) Using ObjCuentasDeposito As New ClsGenerales(ObjPersonal.IniciaTransacSQL())
Dim ObjAF As New ClsAF(ObjPersonal.IniciaTransacSQL()) Using ObjAF As New ClsAF(ObjPersonal.IniciaTransacSQL())
Dim Extension As String = Path.GetExtension(UsuarioActual.Empresa.Ruta & "Temp\RH\" & ViewState("Archivo").ToString())
Dim URL As String = If(Extension.Trim().Length > 0, CvePersonal & Extension, "")
Dim Ruta = String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, ViewState("Archivo").ToString())
Dim Archivo As New System.IO.FileInfo(Ruta)
Dim TieneError = False Dim Extension As String = Path.GetExtension(UsuarioActual.Empresa.Ruta & "Temp\RH\" & ViewState("Archivo").ToString())
Dim Mensaje = "" Dim URL As String = If(Extension.Trim().Length > 0, CvePersonal & Extension, "")
Dim Accion = "" Dim Ruta = String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, ViewState("Archivo").ToString())
Dim Archivo As New System.IO.FileInfo(Ruta)
'Dim FechaBaja As Date = MinFecha
'Dim FechaActivo As Date = MinFecha
'Dim FechaReingreso As Date = MinFecha
'If DdlEstatusPersonal.SelectedValue.ToEntero() <> CvePersonalEstatusInicial Then Dim TieneError = False
' If DdlEstatusPersonal.SelectedValue.ToEntero() = 1 Then Dim Mensaje = ""
' FechaActivo = TxtFechaActivo.Text.ToDate Dim Accion = ""
' ElseIf DdlEstatusPersonal.SelectedValue.ToEntero() = 2 Then
' ElseIf DdlEstatusPersonal.SelectedValue.ToEntero() = 5 Then
' FechaReingreso = TxtFechaReingreso.Text.ToDate
' End If
'End If
If UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 80 Then 'Dim FechaBaja As Date = MinFecha
TxtSalarioCotizado.Text = TxtSDI.Text 'Dim FechaActivo As Date = MinFecha
End If 'Dim FechaReingreso As Date = MinFecha
If CvePersonal = -1 Then 'If DdlEstatusPersonal.SelectedValue.ToEntero() <> CvePersonalEstatusInicial Then
URL = "" ' If DdlEstatusPersonal.SelectedValue.ToEntero() = 1 Then
' FechaActivo = TxtFechaActivo.Text.ToDate
' ElseIf DdlEstatusPersonal.SelectedValue.ToEntero() = 2 Then
' ElseIf DdlEstatusPersonal.SelectedValue.ToEntero() = 5 Then
' FechaReingreso = TxtFechaReingreso.Text.ToDate
' End If
'End If
If ObjPersonal.AddPersonal(TxtCodigo.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtFechaIngreso.Text.ToDate, If UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 80 Then
DdlTipoPeriodo.SelectedValue.ToEntero(), TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble, TxtSalarioCotizado.Text = TxtSDI.Text
TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero(),
TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero(), TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"),
DdlTipoContrato.SelectedValue.ToEntero(), TxtUbicacion.Text.Trim,
DdlTurno.SelectedValue.ToEntero(), DdlPuesto.SelectedValue.ToEntero(),
DdlDepartamento.SelectedValue.ToEntero(),
DdlRuta.SelectedValue.ToEntero(),
DdlEscolaridad.SelectedValue.ToEntero(),
DdlEstadoCivil.SelectedValue.ToEntero(),
DdlGenero.SelectedValue.ToEntero(),
-1, "-1",
DdlEstatusPersonal.SelectedValue.ToEntero(), TxtFechaNacimiento.Text.ToDate,
TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim,
DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtTelefonoEmergencia.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, TxtCURP.Text.Trim, TxtCredencialElector.Text.Trim,
TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(),
DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), URL,
DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text,
DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(),
TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(),
Sindicalizado:=ChkSindicalizado.Checked, Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(),
CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero, CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero(), NetoPeriodo:=TxtNetoPeriodo.Text.ToDecimal) Then
If Archivo.Exists Then
If Not IsNothing(ViewState("FilesMoveimgNew")) Then
Dim filemove As String = ViewState("FilesMoveimgNew").ToString()
If Not String.IsNullOrWhiteSpace(filemove) Then
filemove.FilesMove(ObjPersonal.CvePersonal.ToString(), String.Format("{0}RH\Personal\", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
End If
End If End If
If File.Exists(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) Then If CvePersonal = -1 Then
File.Delete(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) URL = ""
End If
System.IO.File.Move(String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, URL), String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
End If If ObjPersonal.AddPersonal(TxtCodigo.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtFechaIngreso.Text.ToDate,
DdlTipoPeriodo.SelectedValue.ToEntero(), TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble,
TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero(),
TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero(), TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"),
DdlTipoContrato.SelectedValue.ToEntero(), TxtUbicacion.Text.Trim,
DdlTurno.SelectedValue.ToEntero(), DdlPuesto.SelectedValue.ToEntero(),
DdlDepartamento.SelectedValue.ToEntero(),
DdlRuta.SelectedValue.ToEntero(),
DdlEscolaridad.SelectedValue.ToEntero(),
DdlEstadoCivil.SelectedValue.ToEntero(),
DdlGenero.SelectedValue.ToEntero(),
-1, "-1",
DdlEstatusPersonal.SelectedValue.ToEntero(), TxtFechaNacimiento.Text.ToDate,
TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim,
DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtTelefonoEmergencia.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, TxtCURP.Text.Trim, TxtCredencialElector.Text.Trim,
TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(),
DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), URL,
DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text,
DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(),
TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(),
Sindicalizado:=ChkSindicalizado.Checked, Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(),
CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero, CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero(), NetoPeriodo:=TxtNetoPeriodo.Text.ToDecimal) Then
If Archivo.Exists Then
If Not IsNothing(ViewState("FilesMoveimgNew")) Then
Dim filemove As String = ViewState("FilesMoveimgNew").ToString()
If Not String.IsNullOrWhiteSpace(filemove) Then
filemove.FilesMove(ObjPersonal.CvePersonal.ToString(), String.Format("{0}RH\Personal\", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
End If
End If
If File.Exists(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) Then
File.Delete(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
End If
System.IO.File.Move(String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, URL), String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
End If
ObjPersonal.AgroDepartamentoPersonalUp(UsuarioActual.CveEmpresa, DDlAgroDepartamento.SelectedValue.ToEntero(), ObjPersonal.CvePersonal, If(ChkCharolaForanea.Checked, 1, 0)) ObjPersonal.AgroDepartamentoPersonalUp(UsuarioActual.CveEmpresa, DDlAgroDepartamento.SelectedValue.ToEntero(), ObjPersonal.CvePersonal, If(ChkCharolaForanea.Checked, 1, 0))
'Agregar Cuentas Bancarias 'Agregar Cuentas Bancarias
ViewState("CvePersonal") = ObjPersonal.CvePersonal ViewState("CvePersonal") = ObjPersonal.CvePersonal
'Funsion usa RH Familiares 'Funsion usa RH Familiares
If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
ProcesaDTFamiliares(ObjPersonal) ProcesaDTFamiliares(ObjPersonal)
End If End If
If TempDTCuentasBancos.Rows.Count > 0 Then If TempDTCuentasBancos IsNot Nothing AndAlso TempDTCuentasBancos.Rows.Count > 0 Then
For Each row As DataRow In TempDTCuentasBancos.Rows For Each row As DataRow In TempDTCuentasBancos.Rows
If Not ObjCuentasDeposito.AddCuentasDepositos(row("BancoNombre").ToString(), row("Plaza").ToString(), row("Sucursal").ToString(), row("Cuenta").ToString(), row("CLABE").ToString(), row("CIE").ToString(), row("SWIFT").ToString(), row("Referencia").ToString(), "", UsuarioActual.CveUsuario, row("CveMoneda").ToString().ToEntero(), UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=row("BBVAAlias").ToString()) Then If Not ObjCuentasDeposito.AddCuentasDepositos(row("BancoNombre").ToString(), row("Plaza").ToString(), row("Sucursal").ToString(), row("Cuenta").ToString(), row("CLABE").ToString(), row("CIE").ToString(), row("SWIFT").ToString(), row("Referencia").ToString(), "", UsuarioActual.CveUsuario, row("CveMoneda").ToString().ToEntero(), UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=row("BBVAAlias").ToString()) Then
TieneError = True
Exit For
End If
Next
End If
If DTLicencias IsNot Nothing AndAlso DTLicencias.Rows.Count > 0 Then
For Each Dr As DataRow In DTLicencias.Rows
If Not ObjAF.AddLicencia(-1, Dr("Licencia").ToString(), Dr("FechaExpedicion").ToString().ToDateTime(), Dr("FechaVencimiento").ToString().ToDateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePersonal:=ObjPersonal.CvePersonal) Then
TieneError = True
Exit For
End If
Next
End If
'If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
' GlobalDTGralColectivas(-1) = ObjPersonal.DtResultados
'Else
' TieneError = True
'End If
Mensaje = "El Personal se guardó correctamente."
Accion = If(Request("CveFactura") Is Nothing, "document.location.href=""/RH/CatPersonal.aspx""", "window.opener.location.href = window.opener.location.href; window.close();")
'Alert("El Personal se guardó correctamente.", TipoMensaje.MsgInformacion, "window.location.href=""/RH/CatPersonal.aspx"";")
EnviarCorreoNomina = True
Else
TieneError = True TieneError = True
Exit For
End If End If
Next
End If Else
If DTLicencias IsNot Nothing AndAlso DTLicencias.Rows.Count > 0 Then 'If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension) Then
For Each Dr As DataRow In DTLicencias.Rows If ObjPersonal.UpdatePersonal(TxtCodigo.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtFechaIngreso.Text.ToDate,
If Not ObjAF.AddLicencia(-1, Dr("Licencia").ToString(), Dr("FechaExpedicion").ToString().ToDateTime(), Dr("FechaVencimiento").ToString().ToDateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePersonal:=ObjPersonal.CvePersonal) Then DdlTipoPeriodo.SelectedValue.ToEntero(), TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble,
TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero(),
TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero(), TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"),
DdlTipoContrato.SelectedValue.ToEntero(), TxtUbicacion.Text.Trim,
DdlTurno.SelectedValue.ToEntero(), DdlPuesto.SelectedValue.ToEntero(),
DdlDepartamento.SelectedValue.ToEntero(),
DdlRuta.SelectedValue.ToEntero(),
DdlEscolaridad.SelectedValue.ToEntero(),
DdlEstadoCivil.SelectedValue.ToEntero(),
DdlGenero.SelectedValue.ToEntero(),
DdlMotivoBaja.SelectedValue.ToEntero(), If(DdlEstatusPersonal.SelectedValue = "2", TxtFechaBaja.Text.Trim, "-1"),
DdlEstatusPersonal.SelectedValue.ToEntero(), TxtFechaNacimiento.Text.ToDate,
TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim,
DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtTelefonoEmergencia.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim,
TxtCURP.Text.Trim, TxtCredencialElector.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim,
DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(),
DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), CvePersonal,
URL, DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text,
DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(),
TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveUsuarioModifico:=UsuarioActual.CveUsuario,
CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=If(ChkSindicalizado.Checked, 1, 0), Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(),
CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(), CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero(), EsReserva:=If(chkEsReserva.Checked, 1, 0),
Fiscalizable:=If(chkNoFiscalizar.Checked, 0, 1), CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero(), NetoPeriodo:=TxtNetoPeriodo.Text.ToDecimal) Then
'Funcion usa RH Familiares
If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
ProcesaDTFamiliares(ObjPersonal)
End If
ObjPersonal.AgroDepartamentoPersonalUp(UsuarioActual.CveEmpresa, DDlAgroDepartamento.SelectedValue.ToEntero(), CvePersonal, If(ChkCharolaForanea.Checked, 1, 0))
If Archivo.Exists Then
If Not Directory.Exists(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta)) Then Directory.CreateDirectory(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta))
If File.Exists(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) Then
File.Delete(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
End If
System.IO.File.Move(String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, URL), String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
End If
Mensaje = "Los cambios se guardaron correctamente."
'If ViewState("CveEstatusOriginal").ToString() <> DdlEstatusPersonal.SelectedValue Then
' 'Manda Mail con bajas
'End If
Else
TieneError = True TieneError = True
Exit For
End If End If
Next
End If
'If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
' GlobalDTGralColectivas(-1) = ObjPersonal.DtResultados
'Else
' TieneError = True
'End If
Mensaje = "El Personal se guardó correctamente." 'GUARDA ORGANIGRAMA
Accion = If(Request("CveFactura") Is Nothing, "document.location.href=""/RH/CatPersonal.aspx""", "window.opener.location.href = window.opener.location.href; window.close();") If Not TieneError Then
If Not ObjPersonal.AddUpdatePersonalOrganigrama(CvePersonal, If(DdlSupervisorOrganigrama.SelectedValue.ToEntero() = 0, CvePersonal, DdlSupervisorOrganigrama.SelectedValue.ToEntero())) Then
TieneError = True
End If
End If
'Alert("El Personal se guardó correctamente.", TipoMensaje.MsgInformacion, "window.location.href=""/RH/CatPersonal.aspx"";")
EnviarCorreoNomina = True
Else
TieneError = True
End If
Else
'If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension) Then
If ObjPersonal.UpdatePersonal(TxtCodigo.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtFechaIngreso.Text.ToDate,
DdlTipoPeriodo.SelectedValue.ToEntero(), TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble,
TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero(),
TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero(), TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"),
DdlTipoContrato.SelectedValue.ToEntero(), TxtUbicacion.Text.Trim,
DdlTurno.SelectedValue.ToEntero(), DdlPuesto.SelectedValue.ToEntero(),
DdlDepartamento.SelectedValue.ToEntero(),
DdlRuta.SelectedValue.ToEntero(),
DdlEscolaridad.SelectedValue.ToEntero(),
DdlEstadoCivil.SelectedValue.ToEntero(),
DdlGenero.SelectedValue.ToEntero(),
DdlMotivoBaja.SelectedValue.ToEntero(), If(DdlEstatusPersonal.SelectedValue = "2", TxtFechaBaja.Text.Trim, "-1"),
DdlEstatusPersonal.SelectedValue.ToEntero(), TxtFechaNacimiento.Text.ToDate,
TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim,
DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtTelefonoEmergencia.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim,
TxtCURP.Text.Trim, TxtCredencialElector.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim,
DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(),
DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), CvePersonal,
URL, DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text,
DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(),
TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveUsuarioModifico:=UsuarioActual.CveUsuario,
CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=If(ChkSindicalizado.Checked, 1, 0), Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(),
CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(), CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero(), EsReserva:=If(chkEsReserva.Checked, 1, 0),
Fiscalizable:=If(chkNoFiscalizar.Checked, 0, 1), CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero(), NetoPeriodo:=TxtNetoPeriodo.Text.ToDecimal) Then
'Funcion usa RH Familiares
If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
ProcesaDTFamiliares(ObjPersonal)
End If
ObjPersonal.AgroDepartamentoPersonalUp(UsuarioActual.CveEmpresa, DDlAgroDepartamento.SelectedValue.ToEntero(), CvePersonal, If(ChkCharolaForanea.Checked, 1, 0))
If Archivo.Exists Then
If Not Directory.Exists(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta)) Then Directory.CreateDirectory(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta))
If File.Exists(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) Then
File.Delete(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
End If End If
System.IO.File.Move(String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, URL), String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
End If If TieneError Then
ObjPersonal.RollBack()
Alert("Ocurrio un error guardar el Personal. Por favor vuelva a intentar.", TipoMensaje.ToastAdventencia)
Else
ObjPersonal.Commit()
Alert(Mensaje, TipoMensaje.MsgInformacion, Accion)
Mensaje = "Los cambios se guardaron correctamente." CargaEstatusPersonal(DdlEstatusPersonal.SelectedValue.ToEntero())
'If ViewState("CveEstatusOriginal").ToString() <> DdlEstatusPersonal.SelectedValue Then 'If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
' 'Manda Mail con bajas ' ImgPersonal.ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & ObjPersonal.URL
'End If 'End If
GlobalDTRHPersonal(UsuarioActual.CveEmpresa) = Nothing
GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa) = Nothing
If CvePersonal > 0 Then
Using objbase As New ClsRH
If (objbase.PersonalDomUp(DdlEstadosDomicilio.SelectedValue.ToEntero(), TxtCiudadOrigen.Text, CvePersonal, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
End If
End Using
CargaDatos()
End If
Else
TieneError = True
End If
'GUARDA ORGANIGRAMA
If Not TieneError Then
If Not ObjPersonal.AddUpdatePersonalOrganigrama(CvePersonal, If(DdlSupervisorOrganigrama.SelectedValue.ToEntero() = 0, CvePersonal, DdlSupervisorOrganigrama.SelectedValue.ToEntero())) Then
TieneError = True
End If
End If
End If
If TieneError Then
ObjPersonal.RollBack()
Alert("Ocurrio un error guardar el Personal. Por favor vuelva a intentar.", TipoMensaje.ToastAdventencia)
Else
ObjPersonal.Commit()
Alert(Mensaje, TipoMensaje.MsgInformacion, Accion)
CargaEstatusPersonal(DdlEstatusPersonal.SelectedValue.ToEntero())
'If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
' ImgPersonal.ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & ObjPersonal.URL
'End If
GlobalDTRHPersonal(UsuarioActual.CveEmpresa) = Nothing
GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa) = Nothing
If CvePersonal > 0 Then
Using objbase As New ClsRH
If (objbase.PersonalDomUp(DdlEstadosDomicilio.SelectedValue.ToEntero(), TxtCiudadOrigen.Text, CvePersonal, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) Then
End If End If
GuardarDocumentosFirmaContrato()
Session("FileUpload") = ""
ViewState("Archivo") = ""
End Using End Using
CargaDatos() End Using
End If End Using
End If
GuardarDocumentosFirmaContrato()
Session("FileUpload") = ""
ViewState("Archivo") = ""
ObjPersonal.Dispose()
ObjCuentasDeposito.Dispose()
ObjAF.Dispose()
UpDatos.Update() UpDatos.Update()
CargaGvBitacora() CargaGvBitacora()
@@ -3399,7 +3397,7 @@ Partial Class RH_Personal
End If End If
LimpiaCuentasBancarias() LimpiaCuentasBancarias()
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString()) CargaGridCuentasBancos("")
If CvePersonal > 0 Then If CvePersonal > 0 Then
CargaGvBitacora() CargaGvBitacora()
@@ -3412,7 +3410,6 @@ Partial Class RH_Personal
End Sub End Sub
Private Sub CargaCuentasBancarias() Private Sub CargaCuentasBancarias()
Dim ObjCuentasBancos As New ClsGenerales Dim ObjCuentasBancos As New ClsGenerales
ViewState("OrdenCuentasBancos") = ""
DTCuentasBancos = New DataTable DTCuentasBancos = New DataTable
TempDTCuentasBancos = New DataTable TempDTCuentasBancos = New DataTable
@@ -3427,7 +3424,7 @@ Partial Class RH_Personal
End If End If
ObjCuentasBancos.Dispose() ObjCuentasBancos.Dispose()
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString()) CargaGridCuentasBancos("")
End Sub End Sub
#Region "GRIDVIEW - CUENTAS BANCARIAS" #Region "GRIDVIEW - CUENTAS BANCARIAS"
@@ -3485,11 +3482,11 @@ Partial Class RH_Personal
GvBancosCuentas.EditIndex = e.NewEditIndex GvBancosCuentas.EditIndex = e.NewEditIndex
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString()) CargaGridCuentasBancos("")
End Sub End Sub
Protected Sub GvBancosCuentas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBancosCuentas.RowCancelingEdit Protected Sub GvBancosCuentas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBancosCuentas.RowCancelingEdit
GvBancosCuentas.EditIndex = -1 GvBancosCuentas.EditIndex = -1
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString()) CargaGridCuentasBancos("")
End Sub End Sub
Protected Sub GvBancosCuentas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvBancosCuentas.RowUpdating Protected Sub GvBancosCuentas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvBancosCuentas.RowUpdating
Dim NombreBanco = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNombreBanco").Text.Trim Dim NombreBanco = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNombreBanco").Text.Trim
@@ -3582,7 +3579,7 @@ Partial Class RH_Personal
ObjCuentasBancos.Dispose() ObjCuentasBancos.Dispose()
GvBancosCuentas.EditIndex = -1 GvBancosCuentas.EditIndex = -1
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString()) CargaGridCuentasBancos("")
CargaGvBitacora() CargaGvBitacora()
End Sub End Sub
Protected Sub GvBancosCuentas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvBancosCuentas.RowDeleting Protected Sub GvBancosCuentas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvBancosCuentas.RowDeleting
@@ -3600,7 +3597,7 @@ Partial Class RH_Personal
TempDTCuentasBancos.Rows.RemoveAt(index) TempDTCuentasBancos.Rows.RemoveAt(index)
End If End If
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString()) CargaGridCuentasBancos("")
ObjCuentasBancos.Dispose() ObjCuentasBancos.Dispose()
CargaGvBitacora() CargaGvBitacora()
End Sub End Sub