This commit is contained in:
2022-12-14 18:01:15 -07:00
16 changed files with 393 additions and 167 deletions

View File

@@ -1,6 +1,7 @@
Option Strict On
Option Explicit On
Imports ClosedXML.Excel
Imports Extensiones
Imports System.Data
@@ -391,6 +392,7 @@ Partial Class RH_ActualizacionMasiva
If continuar Then
Try
Dim workbook = New XLWorkbook(fileItem.FileUrl)
DTEXcel = Extensiones.ModExtensiones.ReadExcelFile(fileItem.FileUrl, True).FiltraParametros(" LEN(Codigo)>0 ")
Catch ex As Exception
continuar = False

View File

@@ -188,6 +188,11 @@
<label for="<%= DdlPais.ClientID.ToString()%>">Nacionalidad: </label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtCiudadOrigen" runat="server" MaxLength="30"></asp:TextBox>
<label for="<%= TxtCiudadOrigen.ClientID.ToString()%>">Ciudad Nacimiento: </label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlEstados" runat="server" DataTextField="NombreEstado" DataValueField="CveEstado" Width="100%" Class="form-control input-sm select2me"></asp:DropDownList>
<label for="<%= DdlEstados.ClientID.ToString()%>">Lugar de nacimiento: </label>
@@ -302,6 +307,12 @@
<label for="<%= TxtCiudad.ClientID.ToString()%>">Ciudad: </label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlEstadosDomicilio" runat="server" DataTextField="NombreEstado" DataValueField="CveEstado" Width="100%" Class="form-control input-sm select2me"></asp:DropDownList>
<label for="<%= DdlEstadosDomicilio.ClientID.ToString()%>">Estado: </label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright" style="display: none;">
<asp:TextBox CssClass="form-control" ID="TxtEstado" runat="server" MaxLength="30"></asp:TextBox>
<label for="<%= TxtEstado.ClientID.ToString()%>">Estado: </label>

View File

@@ -1354,6 +1354,8 @@ Partial Class RH_Personal
Private Sub CargaEstados(pCvePais As Integer)
DdlEstados.DataSource = GlobalDTGralEstados("-1", pCvePais)
DdlEstados.DataBind()
DdlEstadosDomicilio.DataSource = GlobalDTGralEstados("-1", pCvePais)
DdlEstadosDomicilio.DataBind()
End Sub
'Private Sub CargaSucursales()
@@ -1607,6 +1609,8 @@ Partial Class RH_Personal
TxtColonia.Text = ObjPersonal.Colonia
'DdlEstados.SelectedValueExist(ObjPersonal.CveEstado.ToString())
DdlEstados.SelectedValueExistInsert(ObjPersonal.CveEstado.ToString(), drow("EstadoText").ToString())
DdlEstadosDomicilio.SelectedValueExistInsert(drow("CveEstadoDomicilio").ToString(), drow("EstadoDomicilioText").ToString())
TxtCiudadOrigen.Text = drow("CiudadOrigen").ToString()
TxtCP.Text = ObjPersonal.CP
TxtColonia.Text = ObjPersonal.Colonia
TxtCiudad.Text = ObjPersonal.Ciudad
@@ -2061,6 +2065,10 @@ Partial Class RH_Personal
If TieneError Then
ObjPersonal.RollBack()
Alert("Ocurrio un error guardar el Personal. Por favor vuelva a intentar.", TipoMensaje.ToastAdventencia)
@@ -2068,6 +2076,9 @@ Partial Class RH_Personal
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
@@ -2075,6 +2086,12 @@ Partial Class RH_Personal
GlobalDTRHPersonal(UsuarioActual.CveEmpresa) = Nothing
If CvePersonal > 0 Then
Dim strquery As String = String.Format("UPDATE RH_Personal SET CveEstadoDomicilio = {2},CiudadOrigen ='{3}' WHERE CvePersonal ={1} AND CveEmpresa = {0} ",
UsuarioActual.CveEmpresa, CvePersonal, DdlEstadosDomicilio.SelectedValue.ToEntero(), TxtCiudadOrigen.Text)
Using objbase As New ClsClaseBase
If (objbase.runQuerystr(strquery)) Then
End If
End Using
CargaDatos()
End If
@@ -7481,27 +7498,98 @@ Partial Class RH_Personal
End Sub
Protected Sub LnkContratoAgropecuaria_Click(sender As Object, e As EventArgs)
Dim RutaArchivo As String = "C:\Proyectos\SIGGIT\General\CONTRATO.doc"
Dim RutaArchivo As String = "F:\Proyectos\wwwSIG\General\CONTRATO.doc"
Dim objGemBoxDocument As New clsGemBoxDocument(RutaArchivo)
Dim dSDTotal As Decimal = 0
Dim SDTotalText As String = ""
Dim SDTotal As String = ""
Dim SueldoDiario As String = ""
Dim septimodia As String = ""
Dim Aguinaldo As String = ""
Dim Vacaciones As String = ""
Dim Prima As String = ""
Dim vacacionesyprima As String = ""
Dim Utilidades As String = ""
Dim strquery As String = String.Format("EXEC PA_Agro_ValidacionNomGet @CveValidacionNomina=-1,@CveEmpresa ={0} ", UsuarioActual.CveEmpresa)
Using objbase As New ClsClaseBase
If (objbase.runQuerystr(strquery)) Then
Dim dbrow As DataRow
dbrow = objbase.DtResultados.FiltroPrimero("CveValidacionNomina =4")
If Not IsNothing(dbrow) Then
SueldoDiario = String.Format("{0:N2}", dbrow("Importe"))
dSDTotal = dbrow("Importe").ToString().ToDecimal()
End If
dbrow = objbase.DtResultados.FiltroPrimero("CveValidacionNomina =5")
If Not IsNothing(dbrow) Then
septimodia = String.Format("{0:N2}", dbrow("Importe"))
dSDTotal = dSDTotal + dbrow("Importe").ToString().ToDecimal()
End If
dbrow = objbase.DtResultados.FiltroPrimero("CveValidacionNomina =6")
If Not IsNothing(dbrow) Then
Aguinaldo = String.Format("{0:N2}", dbrow("Importe"))
dSDTotal = dSDTotal + dbrow("Importe").ToString().ToDecimal()
End If
dbrow = objbase.DtResultados.FiltroPrimero("CveValidacionNomina =8")
If Not IsNothing(dbrow) Then
vacacionesyprima = String.Format("{0:N2}", dbrow("Importe"))
Dim temptotal As Decimal = dbrow("Importe").ToString().ToDecimal()
Dim ObjRH As New ClsRH
Vacaciones = String.Format("{0:N2}", temptotal / 1.5)
Prima = String.Format("{0:N2}", (temptotal / 1.5) * 0.5)
dSDTotal = dSDTotal + dbrow("Importe").ToString().ToDecimal()
End If
dbrow = objbase.DtResultados.FiltroPrimero("CveValidacionNomina =7")
If Not IsNothing(dbrow) Then
Utilidades = String.Format("{0:N2}", dbrow("Importe"))
dSDTotal = dSDTotal + dbrow("Importe").ToString().ToDecimal()
End If
SDTotalText = Texto2Letras(dSDTotal.ToString().ToDouble())
SDTotal = String.Format("{0:N2}", dSDTotal)
End If
End Using
Dim Tags As New List(Of TagsDocumentos)
Dim ObjRH As New ClsRH()
If ObjRH.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
Dim Tags As New List(Of TagsDocumentos)
If ObjRH.CveSubProyecto.Contiene(11884, 11883) Then
RutaArchivo = "F:\Proyectos\wwwSIG\General\CONTRATOINVERNADERO.doc"
End If
Tags.Add(New TagsDocumentos("{NombreCompleto}", ObjRH.NombreCompleto))
Tags.Add(New TagsDocumentos("{años}", (DateTime.Now.Year - ObjRH.FechaNacimiento.Year).ToString()))
Tags.Add(New TagsDocumentos("{SubProyecto}", DdlSubProyectoAsignado.SelectedItem.Text))
Tags.Add(New TagsDocumentos("{SubProyecto}", DdlSubProyectoAsignado.SelectedItem.Text.ToUpper()))
Tags.Add(New TagsDocumentos("{EstadoCivil}", DdlEstadoCivil.SelectedItem.Text))
Tags.Add(New TagsDocumentos("{CiudadOrigen}", TxtCiudad.Text))
Tags.Add(New TagsDocumentos("{CiudadOrigen}", String.Format("{0},{1}", TxtCiudadOrigen.Text, DdlEstados.SelectedItem.Text).ToUpper()))
Tags.Add(New TagsDocumentos("{RFC}", ObjRH.RFC))
Tags.Add(New TagsDocumentos("{Ciudad}", String.Format("{0},{1}", TxtCiudad.Text, DdlEstadosDomicilio.SelectedItem.Text).ToUpper()))
Tags.Add(New TagsDocumentos("{CALLE}", TxtCalle.Text))
Tags.Add(New TagsDocumentos("{NO}", TxtNumExt.Text))
Tags.Add(New TagsDocumentos("{COLONIA}", TxtColonia.Text))
Tags.Add(New TagsDocumentos("{CP}", TxtCP.Text))
Tags.Add(New TagsDocumentos("{SDTotalText}", SDTotalText))
Tags.Add(New TagsDocumentos("{SDTotal}", SDTotal))
Tags.Add(New TagsDocumentos("{SueldoDiario}", SueldoDiario))
Tags.Add(New TagsDocumentos("{septimodia}", septimodia))
Tags.Add(New TagsDocumentos("{Aguinaldo}", Aguinaldo))
Tags.Add(New TagsDocumentos("{Vacaciones}", Vacaciones))
Tags.Add(New TagsDocumentos("{Prima}", Prima))
Tags.Add(New TagsDocumentos("{vacacionesyprima}", vacacionesyprima))
Tags.Add(New TagsDocumentos("{Utilidades}", Utilidades))
Tags.Add(New TagsDocumentos("{NumeroDia}", String.Format("{0:dd}", ObjRH.FechaIngreso)))
Tags.Add(New TagsDocumentos("{MesLetra}", String.Format("{0:MMMM}", ObjRH.FechaIngreso)))
Tags.Add(New TagsDocumentos("{Ejercicio}", String.Format("{0:yyyy}", ObjRH.FechaIngreso)))
objGemBoxDocument.SustituirTags(Tags)
End If
ObjRH.Dispose()
@@ -7509,6 +7597,8 @@ Partial Class RH_Personal
Dim objGemBoxDocument As New clsGemBoxDocument(RutaArchivo)
objGemBoxDocument.SustituirTags(Tags)
objGemBoxDocument.GuardarStreamPDF()