Documentos Proveedor(No es auditoria, son los documentos de la pagia de cliente, detro de los tipos de documento le corresponde el modulo 4)
This commit is contained in:
@@ -2286,7 +2286,12 @@
|
|||||||
|
|
||||||
<ajax:TabPanel ID="TabDocs" runat="server" HeaderText="Documentación" CssClass="table table-hover table-advance Widthall" Visible="False">
|
<ajax:TabPanel ID="TabDocs" runat="server" HeaderText="Documentación" CssClass="table table-hover table-advance Widthall" Visible="False">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:GridView ID="GvDocs" AutoGenerateColumns="false" runat="server" GridLines="none" DataKeyNames="CveDocumentacion,Documentacion,Orden,CveDocumentacionElectronica,Adjunto,Estatus,Observacion,Fecha,FechaIng,Usuario,FechaLimite">
|
|
||||||
|
|
||||||
|
<asp:UpdatePanel runat="server" ID="UpDocumentos" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:GridView ID="GvDocs" AutoGenerateColumns="false" runat="server" GridLines="none"
|
||||||
|
DataKeyNames="CveDocumentacion,Documentacion,Orden,CveDocumentacionElectronica,Adjunto,Estatus,Observacion,Fecha,FechaIng,Usuario,FechaLimite,FechaVigencia,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="60px">
|
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="60px">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
@@ -2300,7 +2305,7 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Completo" ItemStyle-Width="40px">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Completo" ItemStyle-Width="40px">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:CheckBox ID="chkEstatus" runat="server" CssClass="make-switchsd" Checked='<%# Eval("Estatus").ToString = "1" %>'></asp:CheckBox>
|
<asp:CheckBox ID="chkEstatus" runat="server" CssClass="make-switchsd" Checked='<%# Eval("Estatus").ToString = "1" %>' Enabled="false"></asp:CheckBox>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Observaciones" ItemStyle-Width="100">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Observaciones" ItemStyle-Width="100">
|
||||||
@@ -2308,7 +2313,7 @@
|
|||||||
<asp:TextBox ID="TxtObservaciones" Width="300" MaxLength="100" runat="server" Text='<%# Eval("Observacion") %>'></asp:TextBox>
|
<asp:TextBox ID="TxtObservaciones" Width="300" MaxLength="100" runat="server" Text='<%# Eval("Observacion") %>'></asp:TextBox>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Fecha limite" ItemStyle-Width="100">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Fecha limite" ItemStyle-Width="100" Visible="false">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TxtFechaLimite" Width="100" onKeyPress="return handleInput(this.value)" MaxLength="100" runat="server" Text='<%# Eval("FechaLimite", "{0:d}") %>'></asp:TextBox>
|
<asp:TextBox ID="TxtFechaLimite" Width="100" onKeyPress="return handleInput(this.value)" MaxLength="100" runat="server" Text='<%# Eval("FechaLimite", "{0:d}") %>'></asp:TextBox>
|
||||||
<ajax:CalendarExtender runat="server" ID="Calendario6" TargetControlID="TxtFechaLimite" Enabled="True"></ajax:CalendarExtender>
|
<ajax:CalendarExtender runat="server" ID="Calendario6" TargetControlID="TxtFechaLimite" Enabled="True"></ajax:CalendarExtender>
|
||||||
@@ -2322,7 +2327,7 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="ImgUpload" runat="server" AlternateText="Editar" CausesValidation="False"
|
<asp:LinkButton ID="ImgUpload" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="UploadModal_ClickDocumentacion"
|
||||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-upload' ></i>" />
|
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-upload' ></i>" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
@@ -2331,15 +2336,22 @@
|
|||||||
<asp:Literal ID="ImgDownLoad" runat="server"></asp:Literal>
|
<asp:Literal ID="ImgDownLoad" runat="server"></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" Visible="false">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="Update_ClickDocumentacion"
|
<asp:LinkButton ID="LnkGVEliminar" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="LnkGVEliminar_Click"
|
||||||
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-check'></i>" />
|
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-check'></i>" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</ajax:TabPanel>
|
</ajax:TabPanel>
|
||||||
|
|
||||||
@@ -3997,6 +4009,55 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="ModalUploadDoc" class="modal ADS fade" role="dialog">
|
||||||
|
|
||||||
|
<div class="modal-dialog">
|
||||||
|
|
||||||
|
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalReferenciasVerificacion" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header ">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<asp:UpdatePanel ID="UpModalTitleUploadDocumento" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<asp:Literal ID="LtlModalUploadTitulo" runat="server"></asp:Literal></h4>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<asp:UpdatePanel runat="server" ID="UPModalUploadDoc" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<asp:TextBox ID="TxtFileDocumentacion" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:Button ID="btnUploadFileDoc" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" />
|
||||||
|
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<iframe id="my_iframe" style="display: none;"></iframe>
|
<iframe id="my_iframe" style="display: none;"></iframe>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="server">
|
||||||
|
|||||||
@@ -323,6 +323,159 @@ Partial Class Compras_Proveedores
|
|||||||
End Property
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
#Region " D O C U M E N T A C I O N"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Property CveDocumentacionElectronica As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
|
||||||
|
Return -1
|
||||||
|
Else
|
||||||
|
Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer)
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CvePersonalClienteDocumentacion") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Property CveDocumentacion As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("CveDocumentacion") Is Nothing Then
|
||||||
|
Return -1
|
||||||
|
Else
|
||||||
|
Return DirectCast(ViewState("CveDocumentacion"), Integer)
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveDocumentacion") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Property Documentacion As String
|
||||||
|
Get
|
||||||
|
If ViewState("Documentacion") Is Nothing Then
|
||||||
|
Return "-1"
|
||||||
|
Else
|
||||||
|
Return ViewState("Documentacion").ToString
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
ViewState("Documentacion") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Property AdjuntoDocumentacion As String
|
||||||
|
Get
|
||||||
|
If ViewState("AdjuntoDocumentacion") Is Nothing Then
|
||||||
|
Return ""
|
||||||
|
Else
|
||||||
|
Return ViewState("AdjuntoDocumentacion").ToString
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
ViewState("AdjuntoDocumentacion") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Property DiasVigencia As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("DiasVigencia") Is Nothing Then
|
||||||
|
Return 0
|
||||||
|
Else
|
||||||
|
Return DirectCast(ViewState("DiasVigencia"), Integer)
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("DiasVigencia") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Property AplicaFechaVencimiento As Boolean
|
||||||
|
Get
|
||||||
|
If ViewState("AplicaFechaVencimiento") Is Nothing Then
|
||||||
|
Return True
|
||||||
|
Else
|
||||||
|
Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean)
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("AplicaFechaVencimiento") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private Property FechaVigencia As Date
|
||||||
|
Get
|
||||||
|
If ViewState("FechaVigencia") Is Nothing Then
|
||||||
|
Return Nothing
|
||||||
|
Else
|
||||||
|
Return ViewState("FechaVigencia").ToString.ToDate
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Date)
|
||||||
|
ViewState("FechaVigencia") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Property Estatus As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("Estatus") Is Nothing Then
|
||||||
|
Return 0
|
||||||
|
Else
|
||||||
|
Return DirectCast(ViewState("Estatus"), Integer)
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("Estatus") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Property ObservacionDocumentacion As String
|
||||||
|
Get
|
||||||
|
If ViewState("ObservacionDocumentacion") Is Nothing Then
|
||||||
|
Return ""
|
||||||
|
Else
|
||||||
|
Return ViewState("ObservacionDocumentacion").ToString
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
ViewState("ObservacionDocumentacion") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private Property FechaLimite As Date
|
||||||
|
Get
|
||||||
|
If ViewState("FechaLimite") Is Nothing Then
|
||||||
|
Return Date.Now.AddDays(15)
|
||||||
|
Else
|
||||||
|
Return ViewState("FechaLimite").ToString.ToDate
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Date)
|
||||||
|
ViewState("FechaLimite") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Property DTDocumentacion As DataTable
|
||||||
|
Get
|
||||||
|
If ViewState("DTDocumentacion") Is Nothing Then
|
||||||
|
Return New DataTable
|
||||||
|
Else
|
||||||
|
Return DirectCast(ViewState("DTDocumentacion"), DataTable)
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As DataTable)
|
||||||
|
|
||||||
|
End Set
|
||||||
|
|
||||||
|
End Property
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
CountCuentasxPagar = 0
|
CountCuentasxPagar = 0
|
||||||
@@ -2541,9 +2694,10 @@ Partial Class Compras_Proveedores
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "D O C U M E N T A C I O N"
|
#Region "D O C U M E N T A C I O N"
|
||||||
|
|
||||||
Private Sub CargaDocs()
|
Private Sub CargaDocs()
|
||||||
Dim Edoc As New ClsEdocumentacion
|
Dim Edoc As New ClsEdocumentacion
|
||||||
If Edoc.DocumentacionElectronicaGet(-1, -1, CveProveedor, UsuarioActual.CveEmpresa, -1) Then
|
If Edoc.DocumentacionElectronicaGet(-1, -1, CveProveedor, UsuarioActual.CveEmpresa, -1, -1, 4) Then
|
||||||
GvDocs.DataSource = Edoc.DtResultados
|
GvDocs.DataSource = Edoc.DtResultados
|
||||||
Edoc.DocumentacionGet(-1, -1, 1, UsuarioActual.CveEmpresa)
|
Edoc.DocumentacionGet(-1, -1, 1, UsuarioActual.CveEmpresa)
|
||||||
' GVEDoc.DataSource = Edoc.DtResultados
|
' GVEDoc.DataSource = Edoc.DtResultados
|
||||||
@@ -2561,38 +2715,253 @@ Partial Class Compras_Proveedores
|
|||||||
GvDocs.HeaderRow.TableSection = TableRowSection.TableHeader
|
GvDocs.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||||
'RegistraScript("OrdenarGV();")
|
'RegistraScript("OrdenarGV();")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
UpDocumentos.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub Update_ClickDocumentacion(sender As Object, e As EventArgs)
|
Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
Dim activo As Boolean = False
|
|
||||||
|
|
||||||
Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToEntero
|
' Dim chkEstatus As CheckBox
|
||||||
Dim _Adjunto As String = GvRow.DataKey("Adjunto").ToString
|
CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
|
||||||
Dim _fechaLimite As Date = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
|
||||||
|
Documentacion = GvRow.DataKey("Documentacion")
|
||||||
Dim observaciones As String = GvRow.FCTextBox("TxtObservaciones").Text ' DirectCast(GvRow.FindControl("TxtObservaciones"), TextBox).Text
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
|
||||||
'Dim DDLEstatus As DropDownList = DirectCast(GvRow.FindControl("DDLEstatus"), DropDownList)
|
|
||||||
Dim chkCompleto As CheckBox = DirectCast(GvRow.FindControl("chkEstatus"), CheckBox)
|
|
||||||
Dim _Estatus As Integer
|
|
||||||
|
|
||||||
If chkCompleto.Checked Then _Estatus = 1 Else _Estatus = 0
|
|
||||||
|
|
||||||
|
|
||||||
Dim objRH As New ClsEdocumentacion
|
'DiasVigencia = GvRow.DataKey("DiasVigencia").ToString.ToEntero
|
||||||
|
Dim x As String = GvRow.DataKey("AplicaFechaVencimiento")
|
||||||
|
If GvRow.DataKey("AplicaFechaVencimiento") = "1" Then AplicaFechaVencimiento = True Else AplicaFechaVencimiento = False
|
||||||
|
|
||||||
If Not GvRow.DataKey("CveDocumentacionElectronica").ToEntero = -1 Then
|
If GvRow.DataKey("Adjunto").ToString.Length > 0 Then
|
||||||
If objRH.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, _CveDocumentacion, -1, -1, CveProveedor, _Estatus, observaciones, _Adjunto, UsuarioActual.CveUsuario, GvRow.FCTextBox("TxtFechaLimite").Text.ToDate) Then
|
FechaVigencia = GvRow.DataKey("Adjunto").ToString.ToDate
|
||||||
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
If objRH.DocumentacionElectronicaAdd(_CveDocumentacion, -1, -1, CveProveedor, _Estatus, observaciones, _Adjunto, UsuarioActual.CveUsuario, GvRow.FCTextBox("TxtFechaLimite").Text.ToDate) > 0 Then
|
FechaVigencia = Nothing
|
||||||
Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
objRH.Dispose()
|
|
||||||
|
Estatus = GvRow.DataKey("Estatus").ToEntero
|
||||||
|
|
||||||
|
'If chkEstatus.Checked Then
|
||||||
|
' Estatus = 1
|
||||||
|
'Else
|
||||||
|
' Estatus = 0
|
||||||
|
'End If
|
||||||
|
|
||||||
|
ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
|
||||||
|
FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
||||||
|
|
||||||
|
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
|
||||||
|
|
||||||
|
LtlModalUploadTitulo.Text = "Subir " & Documentacion
|
||||||
|
|
||||||
|
UpModalTitleUploadDocumento.Update()
|
||||||
|
|
||||||
|
RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});")
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub GvDocs_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocs.RowDataBound
|
||||||
|
|
||||||
|
|
||||||
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
|
||||||
|
Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString
|
||||||
|
|
||||||
|
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
|
||||||
|
Dim ImgUpload As LinkButton = e.Row.FCLinkButton("ImgUpload")
|
||||||
|
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
|
||||||
|
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
|
||||||
|
Dim ChkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
|
||||||
|
' Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
|
||||||
|
Dim CveDocumentacionElectronica As String = e.Row.DataKey("CveDocumentacionElectronica")
|
||||||
|
|
||||||
|
Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido"))
|
||||||
|
|
||||||
|
'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
|
||||||
|
Dim separado As Char() = ".".ToCharArray
|
||||||
|
Dim array() As String = Adjunto.Split(separado)
|
||||||
|
Dim extencion As String = ""
|
||||||
|
|
||||||
|
Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero
|
||||||
|
Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False)
|
||||||
|
Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False)
|
||||||
|
|
||||||
|
txtFechaLimite.Visible = If(AplicaDiasLimite, True, False)
|
||||||
|
' txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False)
|
||||||
|
|
||||||
|
If e.Row.DataKey("Estatus").ToEntero = 1 Then
|
||||||
|
ChkEstatus.Checked = True
|
||||||
|
Else
|
||||||
|
ChkEstatus.Checked = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
'If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then
|
||||||
|
' txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy")
|
||||||
|
' If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then
|
||||||
|
' txtFechaVigencia.ForeColor = Drawing.Color.Red
|
||||||
|
' End If
|
||||||
|
'End If
|
||||||
|
|
||||||
|
|
||||||
|
If array.Length > 0 Then
|
||||||
|
extencion = array(array.Length - 1)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then
|
||||||
|
' chkEstatus.Checked = True
|
||||||
|
ImgUpload.Visible = False
|
||||||
|
Else
|
||||||
|
'chkEstatus.Checked = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy")
|
||||||
|
|
||||||
|
'If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then
|
||||||
|
' txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy")
|
||||||
|
'End If
|
||||||
|
|
||||||
|
'Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');"
|
||||||
|
'RegistraScript(scripMascara, "scriptMascara")
|
||||||
|
|
||||||
|
If Adjunto.Trim.Length > 0 Then
|
||||||
|
|
||||||
|
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & CveProveedor & "/" & Adjunto
|
||||||
|
Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & CveProveedor & "/" & Adjunto
|
||||||
|
|
||||||
|
If File.Exists(linkDescargaArchivo) Then
|
||||||
|
ImgDownLoad.Visible = True
|
||||||
|
|
||||||
|
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, CveDocumentacionElectronica & "." & extencion)
|
||||||
|
Else
|
||||||
|
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, CveDocumentacionElectronica)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ImgDownLoad.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
ImgDownLoad.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
If requerido Then
|
||||||
|
ImgRequired.Text = " <a class='btn btn-circle btn-sm yelow' href='#' data-toggle='tooltip' title=' Requerido!' ><i class='fa fa-asterisk '></i></a>"
|
||||||
|
End If
|
||||||
|
|
||||||
|
'chkEstatus.Checked = ImgDownLoad.Visible
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click
|
||||||
|
|
||||||
|
Dim FileExtension As String = "-1"
|
||||||
|
Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
|
||||||
|
Dim Filename As String = ""
|
||||||
|
Dim ErrorProceso As Boolean = False
|
||||||
|
|
||||||
|
If AplicaFechaVencimiento And DiasVigencia > 0 Then
|
||||||
|
FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
|
||||||
|
End If
|
||||||
|
|
||||||
|
For Each fileItem As Archivo In Filesgral
|
||||||
|
|
||||||
|
Try
|
||||||
|
|
||||||
|
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||||
|
Dim tempArray() As String
|
||||||
|
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim objEdoc As New ClsEdocumentacion
|
||||||
|
objEdoc.IniciaTransacSQL()
|
||||||
|
|
||||||
|
If CveDocumentacionElectronica = -1 Then
|
||||||
|
|
||||||
|
CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 1, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia)
|
||||||
|
|
||||||
|
If CveDocumentacionElectronica > 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 1, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
|
||||||
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Else
|
||||||
|
If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 1, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
|
||||||
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If Not ErrorProceso = True Then
|
||||||
|
|
||||||
|
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & CveDocumentacionElectronica & "." & FileExtension
|
||||||
|
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Try
|
||||||
|
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") Then
|
||||||
|
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
|
||||||
|
File.Delete(rutaAdjuntoAnterior)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If System.IO.File.Exists(rutaDestino) Then
|
||||||
|
System.IO.File.Delete(rutaDestino)
|
||||||
|
End If
|
||||||
|
|
||||||
|
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
|
||||||
|
Catch ex As Exception
|
||||||
|
GuardaLog($"Error al gaurdar documento (moviendo archivo digital) --> Error{ ex.StackTrace}")
|
||||||
|
ErrorProceso = True
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If Not ErrorProceso Then
|
||||||
|
objEdoc.Commit()
|
||||||
|
Alert("Documento cargado correctamente")
|
||||||
|
Else
|
||||||
|
objEdoc.RollBack()
|
||||||
|
Alert("Error al cargar archivo", TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
objEdoc.Dispose()
|
||||||
|
|
||||||
|
CargaDocs()
|
||||||
|
|
||||||
|
|
||||||
|
TxtFileDocumentacion.Text = ""
|
||||||
|
UPModalUploadDoc.Update()
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Error al cargar archivo", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub LnkGVEliminar_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -5778,6 +6147,8 @@ Partial Class Compras_Proveedores
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ Catalogo Documentacion Tipo
|
|||||||
<asp:ListItem Selected="True" Value="-1">Seleccione uno</asp:ListItem>
|
<asp:ListItem Selected="True" Value="-1">Seleccione uno</asp:ListItem>
|
||||||
<asp:ListItem Value="1">Recursos Humanos</asp:ListItem>
|
<asp:ListItem Value="1">Recursos Humanos</asp:ListItem>
|
||||||
<asp:ListItem Value="2">Clientes</asp:ListItem>
|
<asp:ListItem Value="2">Clientes</asp:ListItem>
|
||||||
<asp:ListItem Value="3">Proveedor</asp:ListItem>
|
<asp:ListItem Value="4">Proveedor</asp:ListItem> <%-- Nota: EL tipo Tres es tipo Auditoria de documentos de proveedor usadon el portal prveedor y --%>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RfvEdocmodulo" InitialValue="-1" runat="server" ControlToValidate="DdlEdocmodulo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Modulo''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEdoc"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RfvEdocmodulo" InitialValue="-1" runat="server" ControlToValidate="DdlEdocmodulo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Modulo''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEdoc"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VcoEdocmodulo" runat="server" HighlightCssClass="vco" TargetControlID="RfvEdocmodulo"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VcoEdocmodulo" runat="server" HighlightCssClass="vco" TargetControlID="RfvEdocmodulo"></ajax:ValidatorCalloutExtender>
|
||||||
|
|||||||
@@ -19,6 +19,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user