Ruta dinamica de carpeta "Empresas" asignar valor desde el web config
This commit is contained in:
@@ -37,11 +37,11 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As DataTable)
|
||||
ViewState("DTHeaders") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#Region "UPLOAD"
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#Region "UPLOAD"
|
||||
Property CveDocumentacionElectronica As Integer
|
||||
Get
|
||||
If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
|
||||
@@ -53,8 +53,8 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As Integer)
|
||||
ViewState("CvePersonalClienteDocumentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Property
|
||||
|
||||
Property CveDocumentacion As Integer
|
||||
Get
|
||||
If ViewState("CveDocumentacion") Is Nothing Then
|
||||
@@ -66,8 +66,8 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As Integer)
|
||||
ViewState("CveDocumentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Property
|
||||
|
||||
Property Documentacion As String
|
||||
Get
|
||||
If ViewState("Documentacion") Is Nothing Then
|
||||
@@ -79,8 +79,8 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As String)
|
||||
ViewState("Documentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Property
|
||||
|
||||
Property AdjuntoDocumentacion As String
|
||||
Get
|
||||
If ViewState("AdjuntoDocumentacion") Is Nothing Then
|
||||
@@ -92,10 +92,10 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As String)
|
||||
ViewState("AdjuntoDocumentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Property DiasVigencia As Integer
|
||||
Get
|
||||
If ViewState("DiasVigencia") Is Nothing Then
|
||||
@@ -107,8 +107,8 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As Integer)
|
||||
ViewState("DiasVigencia") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Property
|
||||
|
||||
Property AplicaFechaVencimiento As Boolean
|
||||
Get
|
||||
If ViewState("AplicaFechaVencimiento") Is Nothing Then
|
||||
@@ -120,8 +120,8 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As Boolean)
|
||||
ViewState("AplicaFechaVencimiento") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Property
|
||||
|
||||
Private Property FechaVigencia As Date
|
||||
Get
|
||||
If ViewState("FechaVigencia") Is Nothing Then
|
||||
@@ -133,8 +133,8 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As Date)
|
||||
ViewState("FechaVigencia") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Property
|
||||
|
||||
Property Estatus As Integer
|
||||
Get
|
||||
If ViewState("Estatus") Is Nothing Then
|
||||
@@ -146,8 +146,8 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As Integer)
|
||||
ViewState("Estatus") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Property
|
||||
|
||||
Property ObservacionDocumentacion As String
|
||||
Get
|
||||
If ViewState("ObservacionDocumentacion") Is Nothing Then
|
||||
@@ -159,8 +159,8 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As String)
|
||||
ViewState("ObservacionDocumentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Property
|
||||
|
||||
Private Property FechaLimite As Date
|
||||
Get
|
||||
If ViewState("FechaLimite") Is Nothing Then
|
||||
@@ -173,9 +173,9 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
ViewState("FechaLimite") = value
|
||||
End Set
|
||||
|
||||
End Property
|
||||
|
||||
|
||||
End Property
|
||||
|
||||
|
||||
Property CveProveedor As Integer
|
||||
Get
|
||||
If ViewState("CveProveedor") Is Nothing Then
|
||||
@@ -187,17 +187,17 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Set(value As Integer)
|
||||
ViewState("CveProveedor") = value
|
||||
End Set
|
||||
End Property
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub Proveedores_RepDocumentacionProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaCombos()
|
||||
|
||||
'TxtFechaI.Text = Now.AddMonths(-3).ToString("dd/MM/yyyy")
|
||||
'TxtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||
|
||||
CargaCombos()
|
||||
|
||||
'TxtFechaI.Text = Now.AddMonths(-3).ToString("dd/MM/yyyy")
|
||||
'TxtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||
|
||||
TxtFechaI.Text = ""
|
||||
TxtFechaF.Text = ""
|
||||
|
||||
@@ -206,66 +206,66 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
'ExportaExcel()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
|
||||
|
||||
Private Sub CargaCombos()
|
||||
|
||||
|
||||
DdlProveedores.setEsWebService(True)
|
||||
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
|
||||
DdlProveedores.SelectedText = "Todos"
|
||||
DdlProveedores.SelectedValue = "-1"
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
||||
CargaDocumentacion()
|
||||
End Sub
|
||||
|
||||
|
||||
DdlProveedores.SelectedValue = "-1"
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
||||
CargaDocumentacion()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDocumentacion()
|
||||
|
||||
Dim CveProveedor As Integer = -1
|
||||
|
||||
Dim FechaInicio As Date
|
||||
Dim CveProveedor As Integer = -1
|
||||
|
||||
Dim FechaInicio As Date
|
||||
Dim FechaFin As Date
|
||||
|
||||
If TxtFechaI.Text = "" Then
|
||||
FechaInicio = MinFecha
|
||||
Else
|
||||
FechaInicio = TxtFechaI.Text.ToDate
|
||||
End If
|
||||
|
||||
If TxtFechaF.Text = "" Then
|
||||
FechaFin = MaxFecha
|
||||
Else
|
||||
FechaFin = TxtFechaF.Text.ToDate
|
||||
If TxtFechaI.Text = "" Then
|
||||
FechaInicio = MinFecha
|
||||
Else
|
||||
FechaInicio = TxtFechaI.Text.ToDate
|
||||
End If
|
||||
|
||||
If DdlProveedores.txtValue.Value.ToEntero > 0 Then
|
||||
CveProveedor = DdlProveedores.txtValue.Value.ToEntero
|
||||
If TxtFechaF.Text = "" Then
|
||||
FechaFin = MaxFecha
|
||||
Else
|
||||
FechaFin = TxtFechaF.Text.ToDate
|
||||
End If
|
||||
|
||||
If DdlProveedores.txtValue.Value.ToEntero > 0 Then
|
||||
CveProveedor = DdlProveedores.txtValue.Value.ToEntero
|
||||
End If
|
||||
|
||||
Dim obEDoc As New ClsEdocumentacion
|
||||
|
||||
If obEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero) Then
|
||||
GvDocumentos.DataSource = obEDoc.DtResultados
|
||||
Else
|
||||
GvDocumentos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
If obEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero) Then
|
||||
GvDocumentos.DataSource = obEDoc.DtResultados
|
||||
Else
|
||||
GvDocumentos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
obEDoc.Dispose()
|
||||
|
||||
GvDocumentos.DataBind()
|
||||
UPGvDocumentos.Update()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
UPGvDocumentos.Update()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound
|
||||
|
||||
|
||||
@@ -275,18 +275,18 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
|
||||
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 CveDocumentacionElectronica As Integer = e.Row.DataKey("CveDocumentacionElectronica").ToEntero
|
||||
|
||||
Dim ImgRechazar As LinkButton = e.Row.FCLinkButton("ImgRechazar")
|
||||
|
||||
Dim ImgAceptar As LinkButton = e.Row.FCLinkButton("ImgAceptar")
|
||||
|
||||
Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido"))
|
||||
'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
|
||||
'Dim RDBAcptar As RadioButton = e.Row.FCRadioButton("RDBAcptar")
|
||||
'Dim RDBRechazar As RadioButton = e.Row.FCRadioButton("RDBRechazar")
|
||||
|
||||
Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
|
||||
Dim CveDocumentacionElectronica As Integer = e.Row.DataKey("CveDocumentacionElectronica").ToEntero
|
||||
|
||||
Dim ImgRechazar As LinkButton = e.Row.FCLinkButton("ImgRechazar")
|
||||
|
||||
Dim ImgAceptar As LinkButton = e.Row.FCLinkButton("ImgAceptar")
|
||||
|
||||
Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido"))
|
||||
'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
|
||||
'Dim RDBAcptar As RadioButton = e.Row.FCRadioButton("RDBAcptar")
|
||||
'Dim RDBRechazar As RadioButton = e.Row.FCRadioButton("RDBRechazar")
|
||||
|
||||
Dim separado As Char() = ".".ToCharArray
|
||||
Dim array() As String = Adjunto.Split(separado)
|
||||
Dim extencion As String = ""
|
||||
@@ -296,10 +296,10 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
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)
|
||||
|
||||
|
||||
|
||||
txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False)
|
||||
|
||||
|
||||
|
||||
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
|
||||
@@ -312,8 +312,8 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
extencion = array(array.Length - 1)
|
||||
End If
|
||||
|
||||
'If e.Row.DBCampo("Estatus").ToString.ToEntero = 3 Then
|
||||
' RDBAcptar.Checked = True
|
||||
'If e.Row.DBCampo("Estatus").ToString.ToEntero = 3 Then
|
||||
' RDBAcptar.Checked = True
|
||||
'Else
|
||||
' chkEstatus.Checked = False
|
||||
'End If
|
||||
@@ -332,30 +332,30 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & e.Row.DataKey("CveProveedor") & "/" & Adjunto
|
||||
Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & e.Row.DataKey("CveProveedor") & "/" & Adjunto
|
||||
|
||||
If File.Exists(linkDescargaArchivo) Then
|
||||
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
|
||||
|
||||
|
||||
If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(2, 3) Then
|
||||
ImgRechazar.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(2) Then
|
||||
ImgAceptar.Visible = True
|
||||
End If
|
||||
|
||||
'If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then
|
||||
' chkEstatus.Checked = True
|
||||
'End If
|
||||
|
||||
Else
|
||||
End If
|
||||
|
||||
|
||||
If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(2, 3) Then
|
||||
ImgRechazar.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(2) Then
|
||||
ImgAceptar.Visible = True
|
||||
End If
|
||||
|
||||
'If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then
|
||||
' chkEstatus.Checked = True
|
||||
'End If
|
||||
|
||||
Else
|
||||
ImgDownLoad.Visible = False
|
||||
End If
|
||||
|
||||
@@ -370,116 +370,116 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
'chkEstatus.Checked = ImgDownLoad.Visible
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub ImgRechazar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Dim Obsebaciones As String = GvRow.FCTextBox("TxtObservaciones").Text
|
||||
If Obsebaciones.Trim.Length = 0 Then
|
||||
Alert("Debe de proporcionar una obserbación o motivo de rechazo.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Correo As String = GvRow.DataKey("ContactoMail")
|
||||
Dim Documentacion As String = GvRow.DataKey("Documentacion")
|
||||
Dim Obserbaciones As String = GvRow.FCTextBox("TxtObservaciones").Text
|
||||
|
||||
Dim Adjunto As String = GvRow.DataKey("Adjunto")
|
||||
Dim CveProveedor As Integer = GvRow.DataKey("CveProveedor").ToEntero
|
||||
Dim Archivo As String = UsuarioActual.Empresa.Ruta & $"Edoc\Proveedor\{CveProveedor}\{Adjunto}"
|
||||
|
||||
|
||||
Dim objEdoc As New ClsEdocumentacion
|
||||
Dim ErrorProceso As Boolean = False
|
||||
|
||||
objEdoc.IniciaTransacSQL()
|
||||
|
||||
If objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, 1,
|
||||
If(Obsebaciones.Trim.Length > 0, Obsebaciones, GvRow.DataKey("Observacion")), "-1",
|
||||
UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, GvRow.DataKey("FechaVigencia").ToDate) Then
|
||||
|
||||
Try
|
||||
File.Delete(Archivo)
|
||||
Catch ex As Exception
|
||||
ErrorProceso = True
|
||||
End Try
|
||||
|
||||
If Not ErrorProceso Then
|
||||
|
||||
Dim Cuerpo As String = $"<p>Por medio del presente correo se le notifica que el documento <b>{Documentacion}</b> ha sido rechazado por la siguiente causa: <b>{Obserbaciones}</b> por favor ingrese nuevamente al portal y agréguelo nuevamente. </p>
|
||||
<p>Atentamente:</p>
|
||||
<p>Saludos.</p>"
|
||||
|
||||
If Not MandaCorreo(Correo, $"{ UsuarioActual.Empresa.Empresa } documento Rechazado", Cuerpo) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
Alert($"El documento {GvRow.DataKey("Documentacion") } fue rechazado.")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
If ErrorProceso Then
|
||||
objEdoc.RollBack()
|
||||
Else
|
||||
objEdoc.Commit()
|
||||
End If
|
||||
|
||||
objEdoc.Dispose()
|
||||
|
||||
CargaDocumentacion()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ImgAceptar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Dim objEdoc As New ClsEdocumentacion
|
||||
|
||||
If objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, 3,
|
||||
"", "-1", UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, GvRow.DataKey("FechaVigencia").ToDate) Then
|
||||
Alert("Dcumento Aceptado.")
|
||||
End If
|
||||
|
||||
|
||||
objEdoc.Dispose()
|
||||
|
||||
CargaDocumentacion()
|
||||
End Sub
|
||||
|
||||
Private Function MandaCorreo(Para As String, Asunto As String, Body As String) As Boolean
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
Dim Mail As New ClsSisMail()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ImgRechazar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Dim Obsebaciones As String = GvRow.FCTextBox("TxtObservaciones").Text
|
||||
If Obsebaciones.Trim.Length = 0 Then
|
||||
Alert("Debe de proporcionar una obserbación o motivo de rechazo.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Correo As String = GvRow.DataKey("ContactoMail")
|
||||
Dim Documentacion As String = GvRow.DataKey("Documentacion")
|
||||
Dim Obserbaciones As String = GvRow.FCTextBox("TxtObservaciones").Text
|
||||
|
||||
Dim Adjunto As String = GvRow.DataKey("Adjunto")
|
||||
Dim CveProveedor As Integer = GvRow.DataKey("CveProveedor").ToEntero
|
||||
Dim Archivo As String = UsuarioActual.Empresa.Ruta & $"Edoc\Proveedor\{CveProveedor}\{Adjunto}"
|
||||
|
||||
|
||||
Dim objEdoc As New ClsEdocumentacion
|
||||
Dim ErrorProceso As Boolean = False
|
||||
|
||||
objEdoc.IniciaTransacSQL()
|
||||
|
||||
If objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, 1,
|
||||
If(Obsebaciones.Trim.Length > 0, Obsebaciones, GvRow.DataKey("Observacion")), "-1",
|
||||
UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, GvRow.DataKey("FechaVigencia").ToDate) Then
|
||||
|
||||
Try
|
||||
File.Delete(Archivo)
|
||||
Catch ex As Exception
|
||||
ErrorProceso = True
|
||||
End Try
|
||||
|
||||
If Not ErrorProceso Then
|
||||
|
||||
Dim Cuerpo As String = $"<p>Por medio del presente correo se le notifica que el documento <b>{Documentacion}</b> ha sido rechazado por la siguiente causa: <b>{Obserbaciones}</b> por favor ingrese nuevamente al portal y agréguelo nuevamente. </p>
|
||||
<p>Atentamente:</p>
|
||||
<p>Saludos.</p>"
|
||||
|
||||
If Not MandaCorreo(Correo, $"{ UsuarioActual.Empresa.Empresa } documento Rechazado", Cuerpo) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
Alert($"El documento {GvRow.DataKey("Documentacion") } fue rechazado.")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
If ErrorProceso Then
|
||||
objEdoc.RollBack()
|
||||
Else
|
||||
objEdoc.Commit()
|
||||
End If
|
||||
|
||||
objEdoc.Dispose()
|
||||
|
||||
CargaDocumentacion()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ImgAceptar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Dim objEdoc As New ClsEdocumentacion
|
||||
|
||||
If objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, 3,
|
||||
"", "-1", UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, GvRow.DataKey("FechaVigencia").ToDate) Then
|
||||
Alert("Dcumento Aceptado.")
|
||||
End If
|
||||
|
||||
|
||||
objEdoc.Dispose()
|
||||
|
||||
CargaDocumentacion()
|
||||
End Sub
|
||||
|
||||
Private Function MandaCorreo(Para As String, Asunto As String, Body As String) As Boolean
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
Dim Mail As New ClsSisMail()
|
||||
|
||||
Para = If(Para IsNot Nothing, Para, "")
|
||||
Asunto = If(Asunto IsNot Nothing, Asunto, "")
|
||||
Body = If(Body IsNot Nothing, Body, "")
|
||||
|
||||
Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail)
|
||||
|
||||
If Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=ListaArchivos) Then
|
||||
Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail)
|
||||
|
||||
If Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=ListaArchivos) Then
|
||||
Respuesta = True
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
' Dim chkEstatus As CheckBox
|
||||
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")
|
||||
@@ -516,95 +516,95 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
|
||||
RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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 TempCveDocumentacionElectronica As Integer = 0
|
||||
Dim objEdoc As New ClsEdocumentacion
|
||||
objEdoc.IniciaTransacSQL()
|
||||
|
||||
If CveDocumentacionElectronica = -1 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 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()
|
||||
|
||||
|
||||
CargaDocumentacion()
|
||||
|
||||
|
||||
|
||||
Dim TempCveDocumentacionElectronica As Integer = 0
|
||||
Dim objEdoc As New ClsEdocumentacion
|
||||
objEdoc.IniciaTransacSQL()
|
||||
|
||||
If CveDocumentacionElectronica = -1 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 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()
|
||||
|
||||
|
||||
CargaDocumentacion()
|
||||
|
||||
TxtFileDocumentacion.Text = ""
|
||||
UPModalUploadDoc.Update()
|
||||
|
||||
UPModalUploadDoc.Update()
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Error al cargar archivo", ex)
|
||||
End Try
|
||||
@@ -613,12 +613,12 @@ Partial Class Proveedores_RepDocumentacionProveedor
|
||||
|
||||
RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user