This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2023-09-14 10:19:14 -07:00
18 changed files with 551 additions and 297 deletions

View File

@@ -49,10 +49,19 @@
<li>
<asp:LinkButton ID="ImgImprimirExpediente" Visible="false" runat="server"> <i class="fa fa-file-pdf-o" style=" font-weight: bold;"></i> Expediente de personal</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LbGafete" runat="server" CssClass=""><i class="fa fa-list-alt"></i> Gafete</asp:LinkButton>
</li>
<%-- <asp:UpdatePanel runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="LbGafete" runat="server" CssClass=""><i class="fa fa-list-alt"></i> Gafete</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LbGafete" />
</Triggers>
</asp:UpdatePanel>--%>
<li>
<asp:LinkButton ID="Lnkopenaddcuentabancaria" OnClick="Lnkopenaddcuentabancaria_Click" Visible="true" runat="server"> <i class="fa fa-plus"></i> Agregar cuenta bancaria</asp:LinkButton>
</li>
@@ -80,7 +89,7 @@
<asp:UpdatePanel ID="UpDescargaConsumos" runat="server" Visible="false">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkImprimirPDFConsumo" runat="server" OnClick="LnkImprimirPDFConsumo_Click"> <i class="fa fa-file-pdf-o" style=" font-weight: bold;"></i> PDF consumo</asp:LinkButton>
<asp:LinkButton ID="LnkImprimirPDFConsumo" runat="server" OnClick="LnkImprimirPDFConsumo_Click"> <i class="fa fa-file-pdf-o" style="font-weight: bold;"></i> PDF consumo</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>

View File

@@ -10,6 +10,8 @@ Imports Microsoft.Reporting.WebForms
Imports System.Globalization
Imports System.Xml
Imports System.Web.Script.Services
Imports System.Linq
Partial Class RH_Personal
Inherits ClsPaginas
@@ -1740,6 +1742,11 @@ Partial Class RH_Personal
'Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.bmp", UsuarioActual.CveEmpresa, CvePersonal)
Dim LogoRutaFisica As String = String.Format("{0}RH\Personal\{1}.bmp", UsuarioActual.Empresa.Ruta, CvePersonal)
Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?Ru={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
ImgPersonal.ImageUrl = logouri
ElseIf File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpeg") Then
'Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.png", UsuarioActual.CveEmpresa, CvePersonal)
Dim LogoRutaFisica As String = String.Format("{0}RH\Personal\{1}.jpeg", UsuarioActual.Empresa.Ruta, CvePersonal)
Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?Ru={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
ImgPersonal.ImageUrl = logouri
End If
@@ -3897,40 +3904,95 @@ Partial Class RH_Personal
End If
ObjPersonal.Dispose()
End Sub
Private Sub LbGafete_Click(sender As Object, e As EventArgs) Handles LbGafete.Click
Dim params As New List(Of ReportParameter)
Dim ObjPersonal As New ClsRH()
If ObjPersonal.GetPersonal(CvePersonal, "-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
If ObjPersonal.DtResultados.Rows.Count > 0 Then
'Eliminar hasta 15 de septiembre 2023
'Private Sub LbGafete_Click(sender As Object, e As EventArgs) Handles LbGafete.Click
params.Add(New ReportParameter("Nombre", String.Format("{0} {1} {2}", TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim)))
params.Add(New ReportParameter("Vigencia", TxtFechaFinContrato.Text))
params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue.ToEntero() > 0, DdlPuesto.SelectedItem.Text, "")))
params.Add(New ReportParameter("CURP", TxtCURP.Text))
params.Add(New ReportParameter("NoRegistro", ""))
params.Add(New ReportParameter("RegIMSS", TxtNumeroSS.Text))
params.Add(New ReportParameter("FechaIngreso", TxtFechaIngreso.Text))
params.Add(New ReportParameter("DomPart", String.Format("{0} NoExt:{1} NoInt:{2} {3}", TxtCalle.Text, TxtNumExt.Text, TxtNumInt.Text, TxtColonia.Text)))
params.Add(New ReportParameter("Emergencia", ""))
params.Add(New ReportParameter("CUIP", ""))
params.Add(New ReportParameter("TipoSangre", ""))
params.Add(New ReportParameter("RFC", TxtRFC.Text))
params.Add(New ReportParameter("Denominacion", TxtRFC.Text))
' Dim PathSource As String = UsuarioActual.Empresa.Ruta & "Formatos\Gafete.docx"
' If File.Exists(PathSource) Then
' Dim PathRoot As String = AppDomain.CurrentDomain.BaseDirectory
' Dim pathDesti As String
' PathSource = UsuarioActual.Empresa.Ruta & "Formatos\Gafete.docx"
' pathDesti = PathRoot & "Temp\" & CvePersonal & "Gafete.docx"
' If File.Exists(pathDesti) Then
' File.Delete(pathDesti)
' End If
' File.Copy(PathSource, pathDesti)
' Dim objDoc As New clsGemBoxDocument(pathDesti)
' Dim objRH As New ClsRH
' Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString() & " del " & Now.Year.ToString()
' objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(CvePersonal, UsuarioActual.CveEmpresa))
' objRH.Dispose()
If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & ObjPersonal.CvePersonal & ".png") Then
params.Add(New ReportParameter("LogoUri", String.Format("{0}://{1}:{2}/Empresas/{3}/RH/Personal/{4}.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, ObjPersonal.CvePersonal)))
Else
params.Add(New ReportParameter("LogoUri", ""))
End If
' objDoc.Guardar(pathDesti)
ImprimirPDF("Empresas/Grales/Formatos/RHGafete.rdlc", New DataTable, params, String.Format("Gafete_{0}", ObjPersonal.CvePersonal), "PDF")
End If
End If
ObjPersonal.Dispose()
End Sub
' Dim fileinfo As New FileInfo(pathDesti)
' If fileinfo.Exists Then
' Response.ContentType = "application/docx"
' Response.AppendHeader("Content-Disposition", $"attachment; filename=Gafete_{CvePersonal}.docx")
' Response.TransmitFile(pathDesti)
' Response.End()
' End If
' 'Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
' 'baseUrl = baseUrl & "/temp/" & fileinfo.Name
' 'RegistraDescargaJavaScript(baseUrl)
' Else
' Dim params As New List(Of ReportParameter)
' Dim ObjPersonal As New ClsRH()
' If ObjPersonal.GetPersonal(CvePersonal, "-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
' If ObjPersonal.DtResultados.Rows.Count > 0 Then
' params.Add(New ReportParameter("Nombre", String.Format("{0} {1} {2}", TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim)))
' params.Add(New ReportParameter("Vigencia", TxtFechaFinContrato.Text))
' params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue.ToEntero() > 0, DdlPuesto.SelectedItem.Text, "")))
' params.Add(New ReportParameter("CURP", TxtCURP.Text))
' params.Add(New ReportParameter("NoRegistro", ""))
' params.Add(New ReportParameter("RegIMSS", TxtNumeroSS.Text))
' params.Add(New ReportParameter("FechaIngreso", TxtFechaIngreso.Text))
' params.Add(New ReportParameter("DomPart", String.Format("{0} NoExt:{1} NoInt:{2} {3}", TxtCalle.Text, TxtNumExt.Text, TxtNumInt.Text, TxtColonia.Text)))
' params.Add(New ReportParameter("Emergencia", TxtTelefonoEmergencia.Text))
' params.Add(New ReportParameter("CUIP", ""))
' params.Add(New ReportParameter("TipoSangre", DdlTipoSangre.SelectedItem.Text))
' params.Add(New ReportParameter("RFC", TxtRFC.Text))
' params.Add(New ReportParameter("Denominacion", TxtRFC.Text))
' If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & ObjPersonal.CvePersonal & ".png") Then
' params.Add(New ReportParameter("LogoUri", String.Format("{0}://{1}:{2}/Empresas/{3}/RH/Personal/{4}.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, ObjPersonal.CvePersonal)))
' Else
' params.Add(New ReportParameter("LogoUri", ""))
' End If
' ImprimirPDF("Empresas/Grales/Formatos/RHGafete.rdlc", New DataTable, params, String.Format("Gafete_{0}", ObjPersonal.CvePersonal), "PDF")
' End If
' End If
' ObjPersonal.Dispose()
' End If
'End Sub
Private Sub GenerarPDFGastosXComp(Optional Formato As String = "PDF")
If CvePersonal > 0 Then
If RBLTipoGastos.SelectedValue = "1" Then
@@ -4367,10 +4429,94 @@ Partial Class RH_Personal
objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(CvePersonal, UsuarioActual.CveEmpresa))
objRH.Dispose()
objDoc.Guardar(pathDesti)
If pathDesti.ToUpper.Contains("GAFETTE") Or pathDesti.ToUpper.Contains("GAFETE") Then
GemBox.Document.ComponentInfo.SetLicense(SerialGemBoxDocument)
Dim document = GemBox.Document.DocumentModel.Load(pathDesti)
Dim imgPersonalURL As String = ""
If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpg") Then
imgPersonalURL = UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpg"
ElseIf File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".png") Then
imgPersonalURL = UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".png"
ElseIf File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".bmp") Then
imgPersonalURL = UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".bmp"
ElseIf File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpeg") Then
imgPersonalURL = UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpeg"
End If
'imgPersonalURL = UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".png"
If imgPersonalURL.Trim.Length = 0 Then
imgPersonalURL = ModExtensiones.DirectorioBaseEmpresas & "\wwwSIG\Imagenes\SinImagenB.jpg"
End If
'Dim document As New GemBox.Document.DocumentModel()
'Dim section As New GemBox.Document.Section(document)
'Dim paragraph As New GemBox.Document.Paragraph(document)
'section.Blocks.Add(paragraph)
'Dim picture1 As New GemBox.Document.Picture(document, imgPersonalURL, 61, 53, GemBox.Document.LengthUnit.Pixel)
'paragraph.Inlines.Add(picture1)
'Dim Zahnrad As String = UsuarioActual.Empresa.Ruta & "RH\Personal\Zahnrad.gif"
'Dim Dices As String = UsuarioActual.Empresa.Ruta & "RH\Personal\Dices.png"
'Dim Graphics1 As String = UsuarioActual.Empresa.Ruta & "RH\Personal\Graphics1.svg"
'Dim section As New GemBox.Document.Section(document)
'document.Sections.Add(section)
'Dim paragraph As New GemBox.Document.Paragraph(document)
'section.Blocks.Add(paragraph)
'Dim picture1 As New GemBox.Document.Picture(document, imgPersonalURL, 61, 53, GemBox.Document.LengthUnit.Pixel)
'paragraph.Inlines.Add(picture1)
' Get the first section and the first paragraph (or create them if necessary)
'**************************************************************
Dim firstSection As GemBox.Document.Section = document.Sections.FirstOrDefault()
If firstSection Is Nothing Then
firstSection = New GemBox.Document.Section(document)
document.Sections.Add(firstSection)
End If
Dim firstParagraph As GemBox.Document.Paragraph = firstSection.Blocks.OfType(Of GemBox.Document.Paragraph)().FirstOrDefault()
If firstParagraph Is Nothing Then
firstParagraph = New GemBox.Document.Paragraph(document)
firstSection.Blocks.Add(firstParagraph)
End If
Dim imageParagraph As New GemBox.Document.Paragraph(document)
Dim picture1 As New GemBox.Document.Picture(document, imgPersonalURL, 83, 100, GemBox.Document.LengthUnit.Pixel)
Dim layout3 As New GemBox.Document.FloatingLayout(
New GemBox.Document.HorizontalPosition(1.79, GemBox.Document.LengthUnit.Inch, GemBox.Document.HorizontalPositionAnchor.LeftMargin),
New GemBox.Document.VerticalPosition(2.55, GemBox.Document.LengthUnit.Inch, GemBox.Document.VerticalPositionAnchor.TopMargin),
picture1.Layout.Size)
'layout3.WrappingStyle = GemBox.Document.TextWrappingStyle.Through
picture1.Layout = layout3
imageParagraph.Inlines.Add(picture1)
firstSection.Blocks.Insert(0, imageParagraph)
document.Sections(0).Blocks.RemoveAt(9)
document.Save(pathDesti)
End If
Dim fileinfo As New FileInfo(pathDesti)
Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)