This commit is contained in:
2021-06-02 19:16:41 -07:00
4 changed files with 124 additions and 44 deletions

View File

@@ -61,6 +61,8 @@
<td>CLABE:</td>
<td>
<asp:TextBox ID="TxtCLABE" runat="server" MaxLength="18" Width="200px"></asp:TextBox></td>
<asp:RegularExpressionValidator runat="server" id="REVTxtCLABE" controltovalidate="TxtCLABE" validationexpression="^\s*(?:[0-9]{18})\s*$" errormessage="La CLABE debe de tener una longitud de 18 caracteres" ValidationGroup="GrpGuardar" />
<ajax:ValidatorCalloutExtender ID="CVETxtCLABE" runat="server" HighlightCssClass="vco" TargetControlID="REVTxtCLABE" Width="300px"></ajax:ValidatorCalloutExtender>
</tr>
<tr>

View File

@@ -384,30 +384,34 @@ Partial Class Vta_CatDocumentosClientes
If ActualizarDocumentacion Then
_formato = GuardarArchivo(CveDocumentacion)
If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, UsuarioActual.Empresa.CveEmpresa, TxtDiasLimite.Text.ToEntero, If(ChkAplicaDiasLimite.Checked, 1, 0), If(ChkAplicaFechaVencimiento.Checked, 1, 0)) Then
If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, If(ChkAplicaDiasLimite.Checked, 1, 0), If(ChkAplicaFechaVencimiento.Checked, 1, 0), UsuarioActual.CveEmpresa) Then
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion"))
Alert("Documento Actualizado correctamente.", TipoMensaje.MsgInformacion)
CargaDocumentacion()
End If
Else
If objRH.DocumentacionAdd(Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, If(ChkAplicaDiasLimite.Checked, 1, 0), If(ChkAplicaFechaVencimiento.Checked, 1, 0), UsuarioActual.Empresa.CveEmpresa) Then
If objRH.DocumentacionAdd(Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, If(ChkAplicaDiasLimite.Checked, 1, 0), If(ChkAplicaFechaVencimiento.Checked, 1, 0), UsuarioActual.CveEmpresa) Then
CveDocumentacion = objRH.DtResultados(0)(0).ToString.ToEntero
_formato = GuardarArchivo(CveDocumentacion)
If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, If(ChkAplicaDiasLimite.Checked, 1, 0), If(ChkAplicaFechaVencimiento.Checked, 1, 0), UsuarioActual.Empresa.CveEmpresa) Then
If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, If(ChkAplicaDiasLimite.Checked, 1, 0), If(ChkAplicaFechaVencimiento.Checked, 1, 0), UsuarioActual.CveEmpresa) Then
End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion"))
Alert("Documento agregado correctamente.", TipoMensaje.MsgInformacion)
CargaDocumentacion()
End If
End If
objRH.Dispose()
ActualizarDocumentacion = False
CargaDocumentacion()
End Sub

View File

@@ -171,6 +171,13 @@
width: 100%;
height: 250px;
}
.orange{
color:orange;
background-color:orange;
}
</style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
@@ -3940,7 +3947,7 @@
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50px">
<ItemTemplate>
<asp:LinkButton ID="ImgDownLoadFormato" CssClass="btn btn-circle btn-sm orange" OnClick="DownLoadFormato_ClickDocumentacion" runat="server"
<asp:LinkButton ID="ImgDownLoadFormato" CssClass="btn btn-circle btn-sm orange" OnClick="DownLoadFormato_ClickDocumentacion" runat="server"
Text="<i class='fa fa-download' style='color:white' title='Descargar formato'></i>" CausesValidation="False" />
</ItemTemplate>
</asp:TemplateField>
@@ -3953,10 +3960,9 @@
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px">
<ItemTemplate>
<%--<asp:Literal ID="ImgDownLoad" runat="server"></asp:Literal>--%>
<ItemTemplate>
<asp:LinkButton ID="LnkDownLoadDoc" CssClass="btn btn-circle btn-sm blue" OnClick="DownLoad_ClickDocumentacion" runat="server"
Text="<i class='fa fa-download' style='color:white' title='Descargar formato'></i>" CausesValidation="False" />
Text="<i class='fa fa-download' style='color:white' title='Descargar Documento'></i>" CausesValidation="False" />
</ItemTemplate>
</asp:TemplateField>

View File

@@ -6826,10 +6826,12 @@ Partial Class Clientes
UPGvDocumentosCliente.Update()
'UpGvDocumentosFirma2.Update()
End Sub
Public Sub UploadModal_ClickDocumentacionFirmaContrato(sender As Object, e As EventArgs)
Public Sub UploadModal_ClickDocumentacionFirmaContrato(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim chkEstatus As CheckBox
CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero()
CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString().ToEntero()
Documentacion = GvRow.DataKey("Documentacion")
@@ -6849,7 +6851,29 @@ Partial Class Clientes
UpTituloFirma.Update()
RegistraScript("$('#ModalUploadFirmaContratoDocumento').modal({ backdrop: 'static', keyboard: false});")
GvdocumentosEventosDescarga()
End Sub
Private Sub GvdocumentosEventosDescarga()
For Each GvRow As GridViewRow In GvDocumentosCliente.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
Dim LnkDownLoadDoc As LinkButton = GvRow.FCLinkButton("LnkDownLoadDoc")
Dim ImgDownLoadFormato As LinkButton = GvRow.FCLinkButton("ImgDownLoadFormato")
ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoadFormato)
ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkDownLoadDoc)
End If
Next
End Sub
Private Sub GuardarDocumentosClientes(Optional _CveDocumentacionExcluir As Integer = -1)
Dim hasError As Boolean = True
@@ -7072,18 +7096,38 @@ Partial Class Clientes
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Adjunto As String = GvRow.DataKey("Adjunto")
Dim stringDescargaDocumento As String = ""
If GvRow.DataKey("Documentacion") = "Pagaré" AndAlso UsuarioActual.CveEmpresa = 140 Then
stringDescargaDocumento = ModExtensiones.DirectorioBaseEmpresas & String.Format("Empresas\{0}\Formatos\Pagaré.docx", UsuarioActual.CveEmpresa)
Dim stringDescargaDocumento As String = ""
If GvRow.DataKey("Documentacion") = "Pagaré" AndAlso UsuarioActual.CveEmpresa = 140 Then
stringDescargaDocumento = ModExtensiones.DirectorioBaseEmpresas & String.Format("Empresas\{0}\Formatos\Pagaré.docx", UsuarioActual.CveEmpresa)
TxtDireccionAval.Text = ""
TxtAval.Text = ""
RegistraScript("$('#ModalDivPagare').modal('show')")
Else
stringDescargaDocumento = ModExtensiones.DirectorioBaseEmpresas & String.Format("Empresas\{0}\DocElectronica\Clientes\{1}\{2}", UsuarioActual.CveEmpresa, CveCliente, Adjunto)
End If
linkDescargaPagare = stringDescargaDocumento
TxtDireccionAval.Text = ""
TxtAval.Text = ""
RegistraScript("$('#ModalDivPagare').modal('show')")
stringDescargaDocumento = ModExtensiones.DirectorioBaseEmpresas & String.Format("Empresas\{0}\DocElectronica\Clientes\{1}\{2}", UsuarioActual.CveEmpresa, CveCliente, Adjunto)
linkDescargaPagare = stringDescargaDocumento
Dim File = New FileInfo(linkDescargaPagare)
If File.Exists Then
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + File.Name)
Response.AddHeader("Content-Length", File.Length.ToString())
Response.ContentType = "text/octet-stream"
Response.Flush()
Response.TransmitFile(File.FullName)
Response.End()
End If
End If
End Sub
Protected Sub ImprimirPagare(sender As Object, e As EventArgs) Handles BtnAgregarPagare.Click
@@ -7153,7 +7197,7 @@ Partial Class Clientes
Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString()
Dim ImgDownLoadFormato As LinkButton = e.Row.FCLinkButton("ImgDownLoadFormato")
'Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
Dim LnkDownLoadDoc As LinkButton = e.Row.FCLinkButton("LnkDownLoadDoc")
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
@@ -7204,11 +7248,13 @@ Partial Class Clientes
End If
If documentacionFormato = "" Then
'ImgDownLoadFormato.Visible = False
ImgDownLoadFormato.Visible = False
LnkDownLoadDoc.Visible = False
Else
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & CveDocumentacion & "" & documentacionFormato
LnkDownLoadDoc.Visible = True
Else
LnkDownLoadDoc.Visible = True
ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoadFormato)
End If
txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString().ToDate().ToString("dd/MM/yyyy")
@@ -7221,6 +7267,7 @@ Partial Class Clientes
LnkDownLoadDoc.Visible = True
ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkDownLoadDoc)
'If extencion.Length > 0 Then
' ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga, CveCliente & Documentacion & "." & extencion)
'Else
@@ -7261,6 +7308,7 @@ Partial Class Clientes
Dim PathRoot As String = Server.MapPath("/")
Dim PathSource As String
Dim pathDesti As String
Dim fname As String = ""
PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & documento
pathDesti = PathRoot & "Temp\" & CveCliente & documento
@@ -7269,26 +7317,46 @@ Partial Class Clientes
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(-1, UsuarioActual.CveEmpresa)) ' Pendiente
objRH.Dispose()
objDoc.Guardar(pathDesti)
File.Copy(PathSource, pathDesti)
Dim fileinfo As New FileInfo(pathDesti)
fname = fileinfo.Name
Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
baseUrl = baseUrl & "/temp/" & fileinfo.Name
RegistraDescargaJavaScript(baseUrl)
If fileinfo.Extension.ToUpper = ".XLS" Or fileinfo.Extension.ToUpper = ".XLSX" Then
Try
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(-1, UsuarioActual.CveEmpresa)) ' Pendiente
objRH.Dispose()
objDoc.Guardar(pathDesti)
Catch ex As Exception
End Try
End If
Dim FileD = New FileInfo(pathDesti)
If FileD.Exists Then
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + FileD.Name)
Response.AddHeader("Content-Length", FileD.Length.ToString())
Response.ContentType = "text/octet-stream"
Response.Flush()
Response.TransmitFile(FileD.FullName)
Response.End()
End If
End Sub