AF Documentos, AF fecha iamgen, Correciones eFacturas solicitudes pdf sobre escritura
This commit is contained in:
546
AF/AF.aspx.vb
546
AF/AF.aspx.vb
@@ -7,8 +7,7 @@ Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports ZXing
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Partial Class AF_AF
|
||||
Partial Class AF_AF
|
||||
Inherits ClsPaginas
|
||||
|
||||
'Configuración
|
||||
@@ -388,6 +387,9 @@ Partial Class AF_AF
|
||||
CargaPlagaEnfermedad()
|
||||
ModalidadesPaginaAF()
|
||||
|
||||
CargaDocumentacion()
|
||||
|
||||
|
||||
'Configuración de Modalidad Update
|
||||
BtnGuardar.Text = "Guardar Cambios"
|
||||
LtlTitulo.Text = "Consulta del Activo Fijo:"
|
||||
@@ -940,7 +942,7 @@ Partial Class AF_AF
|
||||
TxtValorCompra.Text = ObjActivoFijo.ValorCompra.ToString.FormatoNumero
|
||||
TxtFechaCompra.Text = ObjActivoFijo.FechaCompra.ToShortDateString
|
||||
TxtValorCompraMN.Text = ObjActivoFijo.ValorCompraMN.ToString.FormatoNumero
|
||||
If ObjActivoFijo.ValorCompra <> ObjActivoFijo.ValorCompraMN Then DivValorCompraMN.visible = True
|
||||
If ObjActivoFijo.ValorCompra <> ObjActivoFijo.ValorCompraMN Then DivValorCompraMN.Visible = True
|
||||
|
||||
TxtFechaBaja.Text = If(ObjActivoFijo.FechaBaja = New Date(1900, 1, 1), "", ObjActivoFijo.FechaBaja.ToString("dd/MM/yyyy"))
|
||||
|
||||
@@ -4947,39 +4949,531 @@ Partial Class AF_AF
|
||||
RegistraScript("$('#ModalContaCuenta').modal('show');")
|
||||
|
||||
End Sub
|
||||
#Region "D O C U M E N T O S"
|
||||
|
||||
Private Property DTDocumentacion As DataTable
|
||||
Get
|
||||
If ViewState("DTDocumentacion") Is Nothing Then
|
||||
ViewState("DTDocumentacion") = New DataTable
|
||||
End If
|
||||
Return DirectCast(ViewState("DTDocumentacion"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDocumentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DocumentoParametros As String
|
||||
Get
|
||||
If ViewState("DocumentoParametros") Is Nothing Then
|
||||
Return ""
|
||||
Else
|
||||
Return ViewState("DocumentoParametros").ToString
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("DocumentoParametros") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
'Private Sub CargaDocumentacion()
|
||||
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 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 ActualizarDocumentacion As Boolean
|
||||
Get
|
||||
If ViewState("ActualizarDocumentacion") Is Nothing Then
|
||||
Return True
|
||||
Else
|
||||
Return DirectCast(ViewState("ActualizarDocumentacion"), Boolean)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("ActualizarDocumentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' If CveActivoFijo > 0 Then
|
||||
' Dim objRH As New ClsEdocumentacion()
|
||||
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
|
||||
|
||||
' If objRH.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, -1) Then
|
||||
' DTDocumentacion = objRH.DtResultados
|
||||
' End If
|
||||
Private Property FechaLimite As Date
|
||||
Get
|
||||
If ViewState("FechaLimite") Is Nothing Then
|
||||
Return NowADS().AddDays(15)
|
||||
Else
|
||||
Return ViewState("FechaLimite").ToString().ToDate
|
||||
End If
|
||||
End Get
|
||||
Set(value As Date)
|
||||
ViewState("FechaLimite") = value
|
||||
End Set
|
||||
|
||||
' If DTDocumentacion.FiltraParametros(" CveDocumentacionTipo = 7 ").Rows.Count > 0 Then
|
||||
' GvDocumentosFirma.DataSource = DTDocumentacion.FiltraParametros(" CveDocumentacionTipo = 7 ")
|
||||
' Else
|
||||
' GvDocumentosFirma.DataSource = Nothing
|
||||
' End If
|
||||
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 Sub CargaDocumentacion()
|
||||
|
||||
If CveActivoFijo > 0 Then
|
||||
Dim objRH As New ClsEdocumentacion()
|
||||
|
||||
If objRH.DocumentacionElectronicaGet(-1, -1, -1, UsuarioActual.Empresa.CveEmpresa, -1, CveActivoFijo:=CveActivoFijo, Modulo:=9) Then
|
||||
DTDocumentacion = objRH.DtResultados
|
||||
End If
|
||||
|
||||
If DTDocumentacion.Rows.Count > 0 Then
|
||||
GvDocumentos.DataSource = DTDocumentacion
|
||||
Else
|
||||
GvDocumentos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
objRH.Dispose()
|
||||
|
||||
GvDocumentos.DataBind()
|
||||
|
||||
UpGvDocumentos.Update()
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound
|
||||
|
||||
|
||||
' If DTDocumentacion.FiltraParametros(" Modulo = 7 ").Rows.Count > 0 Then
|
||||
' GVMaterialidad.DataSource = DTDocumentacion.FiltraParametros(" Modulo = 7 ")
|
||||
' Else
|
||||
' GVMaterialidad.DataSource = Nothing
|
||||
' End If
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
' GVMaterialidad.DataBind()
|
||||
' GvDocumentosFirma.DataBind()
|
||||
Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString()
|
||||
Dim ImgDownLoadFormato As LinkButton = e.Row.FCLinkButton("ImgDownLoadFormato")
|
||||
|
||||
Dim ImgDownLoad As LinkButton = e.Row.FCLinkButton("ImgDownLoad")
|
||||
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
|
||||
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
|
||||
Dim requerido As Boolean = If(e.Row.DBCampo("Requerido").ToUpper = "TRUE", True, False)
|
||||
Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
|
||||
Dim documentacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString()
|
||||
Dim Documentacion As String = e.Row.DBCampo("Documentacion").ToString()
|
||||
Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString().ToEntero()
|
||||
Dim separado As Char() = ".".ToString().ToCharArray
|
||||
Dim array() As String = Adjunto.Split(separado)
|
||||
Dim extencion As String = ""
|
||||
Dim existeAdjunto As Boolean = False
|
||||
Dim TxtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
|
||||
' FechaVigencia
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
||||
Dim scripMascara As String = " $('#" & TxtFechaVigencia.ClientID & "').mask('00/00/0000');"
|
||||
RegistraScript(scripMascara)
|
||||
If array.Length > 0 Then
|
||||
extencion = array(array.Length - 1)
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Estatus").ToString().ToEntero() = 1 Then
|
||||
chkEstatus.Checked = True
|
||||
Else
|
||||
chkEstatus.Checked = False
|
||||
End If
|
||||
|
||||
If documentacionFormato = "" Then
|
||||
ImgDownLoadFormato.Visible = False
|
||||
Else
|
||||
Dim linkDescarga As String = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & CveDocumentacion & "" & documentacionFormato
|
||||
ImgDownLoadFormato.Visible = True
|
||||
ScriptManager.GetCurrent(Me.Page).RegisterPostBackControl(ImgDownLoadFormato)
|
||||
End If
|
||||
|
||||
txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString().ToDate.ToString("dd/MM/yyyy")
|
||||
|
||||
If Adjunto.Trim.Length > 0 Then
|
||||
|
||||
Dim linkDescarga As String = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/AF/" & CveActivoFijo & "/" & Adjunto
|
||||
Dim linkDescargaArchivo As String = UsuarioActual.Empresa.Ruta & "AF/" & CveActivoFijo & "/" & Adjunto
|
||||
|
||||
If File.Exists(linkDescargaArchivo) Then
|
||||
|
||||
ImgDownLoad.Visible = True
|
||||
ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoad)
|
||||
|
||||
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>"
|
||||
Else
|
||||
' ImgRequired.Text = " <a class='btn btn-circle btn-sm grey-salt' href='#' data-toggle='tooltip' title='No obligatorio' ><i class='fa fa-asterisk '></i></a>"
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero()
|
||||
Dim DocumentacionFormato As String = CveDocumentacion & "_" & GvRow.DataKey("DocumentacionFormato")
|
||||
|
||||
|
||||
DescarFormato(DocumentacionFormato)
|
||||
|
||||
'Dim ObjEdoc As New ClsEdocumentacion
|
||||
|
||||
'If ObjEdoc.GetDocumentacionParametros(-1, CveDocumentacion, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjEdoc.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
' GvParametros.DataSource = ObjEdoc.DtResultados
|
||||
' ObjEdoc.Dispose()
|
||||
|
||||
' GvParametros.DataBind()
|
||||
' UpGvParametros.Update()
|
||||
|
||||
' DocumentoParametros = DocumentacionFormato
|
||||
' RegistraScript("$('#DVDescargaDocumentoParametrosModal').modal('show')")
|
||||
|
||||
' Else
|
||||
' ObjEdoc.Dispose()
|
||||
' DescarFormato(DocumentacionFormato)
|
||||
' End If
|
||||
'Else
|
||||
' ObjEdoc.Dispose()
|
||||
'End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub DescarFormato(documento As String)
|
||||
|
||||
Dim PathRoot As String = AppDomain.CurrentDomain.BaseDirectory
|
||||
Dim PathSource As String
|
||||
Dim pathDesti As String
|
||||
|
||||
PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & documento
|
||||
pathDesti = PathRoot & "Temp\" & CveActivoFijo & documento
|
||||
|
||||
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
|
||||
'objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(CvePersonal, UsuarioActual.CveEmpresa))
|
||||
'objRH.Dispose()
|
||||
|
||||
'objDoc.Guardar(pathDesti)
|
||||
|
||||
Dim fileinfo As New FileInfo(pathDesti)
|
||||
|
||||
Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
|
||||
DescargarArchivo(fileinfo.FullName)
|
||||
'baseUrl = baseUrl & "/temp/" & fileinfo.Name
|
||||
'RegistraScript("Download('" & baseUrl & "')")
|
||||
|
||||
End Sub
|
||||
|
||||
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")
|
||||
AdjuntoDocumentacion = GvRow.DataKey("Adjunto").ToString()
|
||||
|
||||
chkEstatus = GvRow.FCCheckBox("chkEstatus")
|
||||
|
||||
|
||||
|
||||
ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
|
||||
FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
|
||||
|
||||
AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
|
||||
|
||||
LtlTitulofirmaContrato.Text = "Subir " & Documentacion
|
||||
|
||||
UpTituloFirma.Update()
|
||||
|
||||
RegistraScript("$('#ModalUploadFirmaContratoDocumento').modal({ backdrop: 'static', keyboard: false});")
|
||||
End Sub
|
||||
Protected Sub ImgDownLoad_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Dim Adjunto As String = GvRow.DataKey("Adjunto").ToString()
|
||||
Dim ArchivoPath As String = UsuarioActual.Empresa.Ruta & "AF/" & CveActivoFijo & "/" & Adjunto
|
||||
|
||||
DescargarArchivo(ArchivoPath)
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DescargarArchivo(rutaArchivo As String)
|
||||
|
||||
If System.IO.File.Exists(rutaArchivo) Then
|
||||
|
||||
Dim nombreArchivo As String = System.IO.Path.GetFileName(rutaArchivo)
|
||||
Response.Clear()
|
||||
Response.ContentType = "application/octet-stream"
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename=" & nombreArchivo)
|
||||
Response.AddHeader("Content-Length", New System.IO.FileInfo(rutaArchivo).Length.ToString())
|
||||
Response.WriteFile(rutaArchivo)
|
||||
Response.End()
|
||||
|
||||
Else
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkDescargaFormatoParametros_Click(sender As Object, e As EventArgs)
|
||||
|
||||
'Dim ListaTagsDocumentost As New List(Of TagsDocumentos)
|
||||
'Dim ObjRH As New ClsRH
|
||||
'ListaTagsDocumentost = ObjRH.GetDatosTagsDocumentos(CvePersonal, UsuarioActual.CveEmpresa)
|
||||
'ObjRH.Dispose()
|
||||
|
||||
'For Each GvRow As GridViewRow In GvParametros.Rows
|
||||
|
||||
' If GvRow.FCTextBox("TxtParametro").Text.Trim.Length > 0 Then
|
||||
' ListaTagsDocumentost.Add(New TagsDocumentos(GvRow.DataKey("Parametro"), GvRow.FCTextBox("TxtParametro").Text))
|
||||
' End If
|
||||
'Next
|
||||
'Dim PathRoot As String = AppDomain.CurrentDomain.BaseDirectory
|
||||
'Dim PathSource As String
|
||||
'Dim pathDesti As String
|
||||
|
||||
'PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & DocumentoParametros
|
||||
'pathDesti = PathRoot & "Temp\" & CveActivoFijo & DocumentoParametros
|
||||
|
||||
'If File.Exists(pathDesti) Then
|
||||
' File.Delete(pathDesti)
|
||||
'End If
|
||||
|
||||
'File.Copy(PathSource, pathDesti)
|
||||
|
||||
'Dim objDoc As New clsGemBoxDocument(pathDesti)
|
||||
'objDoc.SustituirTags(ListaTagsDocumentost)
|
||||
'objDoc.Guardar(pathDesti)
|
||||
|
||||
'Dim fileinfo As New FileInfo(pathDesti)
|
||||
|
||||
'Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
|
||||
'baseUrl = baseUrl & "/temp/" & fileinfo.Name
|
||||
|
||||
'RegistraScript("$('#DVDescargaDocumentoParametrosModal').modal('hide')", "500")
|
||||
'RegistraScript("Download('" & baseUrl & "')")
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnModalFirmaContratoDocumentoUpload_Click(sender As Object, e As EventArgs) Handles BtnModalFirmaContratoDocumentoUpload.Click
|
||||
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Archivo) = TxtFileFirmaContrato.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
|
||||
|
||||
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 & "AF\" & CveActivoFijo & "\" & Documentacion & "." & FileExtension
|
||||
Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "AF\" & CveActivoFijo & "\" & AdjuntoDocumentacion
|
||||
|
||||
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "AF\" & CveActivoFijo & "\") Then
|
||||
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "AF\" & CveActivoFijo & "\")
|
||||
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 objRH As New ClsEdocumentacion
|
||||
|
||||
|
||||
If CveDocumentacionElectronica = -1 Then
|
||||
If objRH.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, -1, 1, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, CveActivoFijo:=CveActivoFijo) > 0 Then
|
||||
|
||||
End If
|
||||
Else
|
||||
If objRH.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, -1, 1, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, CveActivoFijo:=CveActivoFijo) Then
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
objRH.Dispose()
|
||||
|
||||
GuardarDocumentosFirmaContrato(CveDocumentacion)
|
||||
'CargaDocumentacion()
|
||||
|
||||
|
||||
TxtFileFirmaContrato.Text = ""
|
||||
UpModalFirmaContratoDocumento.Update()
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Error al cargar archivo", ex)
|
||||
End Try
|
||||
|
||||
Next
|
||||
RegistraScript("$('#ModalUploadFirmaContratoDocumento').modal('hide')", "hidemodal7")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub GuardarDocumentosFirmaContrato(Optional _CveDocumentacionExcluir As Integer = -1)
|
||||
|
||||
Dim hasError As Boolean = True
|
||||
Dim objDocumentos As New ClsEdocumentacion
|
||||
|
||||
For Each dRow As GridViewRow In GvDocumentos.Rows
|
||||
|
||||
|
||||
Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString().ToEntero()
|
||||
Dim _Adjunto As String = dRow.DataKey("Adjunto")
|
||||
'Dim _Documentacion As String = dRow.DataKey("Documentacion")
|
||||
Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero()
|
||||
Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones")
|
||||
Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite")
|
||||
Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia")
|
||||
Dim chkEstatus As CheckBox = dRow.FCCheckBox("chkEstatus")
|
||||
Dim _estatus As Integer
|
||||
|
||||
_estatus = If(dRow.DataKey("Estatus").ToString().ToUpper = "TRUE", 1, 0)
|
||||
|
||||
Dim _FechaVigencia As Date
|
||||
Dim _FechaLimite As Date
|
||||
|
||||
Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString().ToEntero()
|
||||
Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString() = "1", True, False)
|
||||
Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString() = "1", True, False)
|
||||
|
||||
If _TxtFechaVigencia.Text.Length = 10 Then
|
||||
_FechaVigencia = _TxtFechaVigencia.Text.ToDate
|
||||
Else
|
||||
_FechaVigencia = Nothing
|
||||
End If
|
||||
|
||||
If Not AplicaDiasLimite Then
|
||||
_FechaLimite = MinFecha
|
||||
Else
|
||||
_FechaLimite = _TxtFechaLimite.Text.ToDate
|
||||
End If
|
||||
|
||||
If Not AplicaFechaVencimiento Then
|
||||
_FechaVigencia = MinFecha
|
||||
End If
|
||||
|
||||
|
||||
If Not _CveDocumentacionExcluir = _CveDocumentacion Then
|
||||
Try
|
||||
If _CveDocumentacionElectronica = -1 Then
|
||||
|
||||
If objDocumentos.DocumentacionElectronicaAdd(_CveDocumentacion, -1, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia, CveActivoFijo:=CveActivoFijo) > 0 Then
|
||||
Else
|
||||
hasError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Else
|
||||
If objDocumentos.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, -1, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia, CveActivoFijo:=CveActivoFijo) Then
|
||||
Else
|
||||
hasError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
hasError = False
|
||||
Catch ex As Exception
|
||||
hasError = True
|
||||
Exit For
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
|
||||
'refrescar grid datos investigacion
|
||||
CargaDocumentacion()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
' UpMaterialidad.Update()
|
||||
' UPGvDocumentosFirma.Update()
|
||||
' UpGvDocumentosFirma2.Update()
|
||||
' End If
|
||||
|
||||
'End Sub
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user