nominas y personal

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-06-26 16:40:01 -07:00
parent b02820d1b2
commit 06d856bcff
12 changed files with 1427 additions and 417 deletions

View File

@@ -640,5 +640,68 @@ Partial Class RH_CatPersonal
Response.End()
End Sub
Protected Sub LnkFormato_Click(sender As Object, e As EventArgs)
Dim RFCs As New StringBuilder
Dim contador = 0
Using ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
For Each item As DataRow In ObjPersonal.DtResultados.Rows
Dim rfc As String = item("RFC").ToString().Trim()
If rfc.Length > 0 Then
contador = contador + 1
RFCs.AppendLine(String.Format("{0}|{1}", contador, rfc))
End If
Next
End If
End Using
Response.Clear()
Response.ContentType = "text/plain"
Response.AppendHeader("content-disposition", "attachment;filename=RFCs_Validacion_Masiva.txt")
'Response.Write(contador.ToString())
Response.Write(RFCs.ToString())
Response.End()
End Sub
Protected Sub LnkCargarValidacion_Click(sender As Object, e As EventArgs)
Dim fileurl As String
Dim archivos As Files = TxtValidacionMasivaRFC.getfiles()
If archivos.Archivos.Count > 0 Then
fileurl = archivos.Archivos(0).FileUrl
Dim linestxt As String() = IO.File.ReadAllLines(fileurl, Encoding.GetEncoding("iso-8859-1"))
Dim contadorok As Integer = 0
Dim contadorfail As Integer = 0
Using ObjPersonal As ClsRH = New ClsRH()
For Each item As String In linestxt
Dim splitstr As String() = item.Split("|"c)
Dim Cve As String = ""
Dim rfc As String = ""
Dim msg As String = ""
If splitstr.Length > 0 Then
Cve = splitstr(0)
End If
If splitstr.Length > 1 Then
rfc = splitstr(1)
End If
If splitstr.Length > 2 Then
msg = splitstr(2)
End If
If msg = txtStringValido.Text Then
contadorok = contadorok + 1
Else
contadorfail = contadorfail + 1
End If
If ObjPersonal.UpdateRFCValidado(rfc.ToUpper(), UsuarioActual.CveEmpresa, (msg = txtStringValido.Text)) Then
End If
Next
End Using
Alert(String.Format("Se encontraron {0} rfc correctos y {1} rfc incorrectos", contadorok, contadorfail))
Else
Alert("Favor de agregar un archivo", TipoMensaje.MsgAdvertencia)
End If
End Sub
End Class