RH Gafetes acciones
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -3898,38 +3898,91 @@ Partial Class RH_Personal
|
||||
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
|
||||
Dim PathSource As String = UsuarioActual.Empresa.Ruta & "Formatos\Gafete.docx"
|
||||
If File.Exists(PathSource) 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", ""))
|
||||
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 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(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")
|
||||
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()
|
||||
|
||||
|
||||
|
||||
objDoc.Guardar(pathDesti)
|
||||
|
||||
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
|
||||
ObjPersonal.Dispose()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub GenerarPDFGastosXComp(Optional Formato As String = "PDF")
|
||||
If CvePersonal > 0 Then
|
||||
|
||||
Reference in New Issue
Block a user