Documentacion proveedores
This commit is contained in:
@@ -839,7 +839,7 @@
|
||||
|
||||
<asp:TemplateField ControlStyle-CssClass="template" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100" HeaderText="Vencimiento" HeaderStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlVencimiento" runat="server" Text='<%# Eval("Vencimiento") %>'></asp:Literal>
|
||||
<asp:Literal ID="LtlVencimiento" runat="server" Text='<%# Eval("Vencimiento", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
|
||||
</asp:TemplateField>
|
||||
@@ -905,6 +905,12 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<%-- <asp:TemplateField ControlStyle-CssClass="template" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="275" HeaderText="CveDocumentacionElectronica">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCveDocumentacionElectronica" runat="server" Text='<%# Eval("CveDocumentacionElectronica") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
|
||||
<%-- <asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgE" OnClick="Update_ClickDocumentacion" runat="server" AlternateText="Editar" ToolTip="Aplicar Cambios" CausesValidation="False"
|
||||
|
||||
@@ -107,6 +107,145 @@ Partial Class Portal_PortalProveedor
|
||||
|
||||
#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
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
|
||||
If Not IsPostBack Then
|
||||
@@ -1289,138 +1428,6 @@ Partial Class Portal_PortalProveedor
|
||||
End Sub
|
||||
|
||||
|
||||
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
|
||||
|
||||
Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -1479,7 +1486,7 @@ Partial Class Portal_PortalProveedor
|
||||
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
|
||||
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
|
||||
Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
|
||||
Dim Documentacion As String = e.Row.DataKey("Documentacion")
|
||||
Dim CveDocumentacionElectronica As String = e.Row.DataKey("CveDocumentacionElectronica")
|
||||
|
||||
Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido"))
|
||||
|
||||
@@ -1537,9 +1544,9 @@ Partial Class Portal_PortalProveedor
|
||||
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, Documentacion & "." & extencion)
|
||||
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, Documentacion)
|
||||
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
|
||||
@@ -1564,7 +1571,8 @@ Partial Class Portal_PortalProveedor
|
||||
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
|
||||
@@ -1575,55 +1583,150 @@ Partial Class Portal_PortalProveedor
|
||||
|
||||
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 rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & Documentacion & "." & FileExtension
|
||||
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
|
||||
|
||||
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)
|
||||
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
||||
|
||||
|
||||
|
||||
|
||||
Dim objEdoc As New ClsEdocumentacion
|
||||
objEdoc.IniciaTransacSQL()
|
||||
|
||||
If CveDocumentacionElectronica = -1 Then
|
||||
If objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then
|
||||
|
||||
CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia)
|
||||
|
||||
If CveDocumentacionElectronica > 0 Then
|
||||
|
||||
|
||||
If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
|
||||
|
||||
|
||||
Else
|
||||
If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, 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()
|
||||
|
||||
'GuardarDocumentos(CveDocumentacion)
|
||||
|
||||
CargaDocumentacion()
|
||||
|
||||
TxtFileDocumentacion.Text = ""
|
||||
UPModalUploadDoc.Update()
|
||||
|
||||
|
||||
Alert("Archivo cargado correctamente.")
|
||||
UPModalUploadDoc.Update()
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Error al cargar archivo", ex)
|
||||
End Try
|
||||
|
||||
Next
|
||||
|
||||
RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
|
||||
RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
|
||||
|
||||
|
||||
'Dim FileExtension As String = "-1"
|
||||
'Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
|
||||
'Dim Filename As String = ""
|
||||
|
||||
'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 rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & Documentacion & "." & FileExtension
|
||||
' Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
|
||||
|
||||
' 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)
|
||||
|
||||
|
||||
' Dim objEdoc As New ClsEdocumentacion
|
||||
|
||||
' If CveDocumentacionElectronica = -1 Then
|
||||
' If objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then
|
||||
|
||||
' End If
|
||||
' Else
|
||||
' If objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
|
||||
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' objEdoc.Dispose()
|
||||
|
||||
' 'GuardarDocumentos(CveDocumentacion)
|
||||
' CargaDocumentacion()
|
||||
|
||||
' TxtFileDocumentacion.Text = ""
|
||||
' UPModalUploadDoc.Update()
|
||||
|
||||
|
||||
' Alert("Archivo cargado correctamente.")
|
||||
' Catch ex As Exception
|
||||
' OnError("Error al cargar archivo", ex)
|
||||
' End Try
|
||||
|
||||
'Next
|
||||
|
||||
'RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user