675 lines
21 KiB
VB.net
675 lines
21 KiB
VB.net
|
|
|
|
Imports System.Data
|
|
Imports System.Linq
|
|
Imports Extensiones
|
|
Imports System.IO
|
|
|
|
Partial Class RH_CatDocumentos
|
|
Inherits ClsPaginas
|
|
|
|
Private 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)
|
|
ViewState("DTDocumentacion") = 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 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
|
|
|
|
Private Property DocumentacionTipo As String
|
|
Get
|
|
If ViewState("DocumentacionTipo") Is Nothing Then
|
|
Return ""
|
|
Else
|
|
Return ViewState("DocumentacionTipo").ToString
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Private Property CveDocumentacionTipo As Integer
|
|
Get
|
|
If ViewState("CveDocumentacionTipo") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("CveDocumentacionTipo"), Integer)
|
|
End If
|
|
End Get
|
|
|
|
Set(value As Integer)
|
|
ViewState("CveDocumentacionTipo") = 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
|
|
|
|
Property Estatus As Boolean
|
|
Get
|
|
If ViewState("Estatus") Is Nothing Then
|
|
Return 0
|
|
Else
|
|
Return DirectCast(ViewState("Estatus"), Boolean)
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("Estatus") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Property DocumentacionFormato As String
|
|
Get
|
|
If ViewState("DocumentacionFormato") Is Nothing Then
|
|
Return ""
|
|
Else
|
|
Return ViewState("DocumentacionFormato").ToString
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("DocumentacionFormato") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property Requerido As Boolean
|
|
Get
|
|
If ViewState("Requerido") Is Nothing Then
|
|
Return True
|
|
Else
|
|
Return DirectCast(ViewState("Requerido"), Boolean)
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("Requerido") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Property Orden As Integer
|
|
Get
|
|
If ViewState("Orden") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return DirectCast(ViewState("Orden"), Integer)
|
|
End If
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("Orden") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
cargaDocumentacion()
|
|
cargaComboDocumentacion()
|
|
End If
|
|
End Sub
|
|
|
|
|
|
#Region "D O C U M E N T A C I O N"
|
|
|
|
Protected Sub BtnAgregarDocumento_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumento.Click
|
|
resetFormDocumentacion()
|
|
RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});")
|
|
End Sub
|
|
|
|
Private Sub ResetFormDocumentacion()
|
|
|
|
Txtdocumentacion.Text = ""
|
|
TxtOrden.Text = ""
|
|
BtnAgregarDocumentoModal.Text = "Agregar"
|
|
LtlTituloModalDocumentacion.Text = "Agregar documentación"
|
|
'TxtDocumentacionFormato.Text = ""
|
|
DdlDocumentacionTipo.SelectedIndex = 0
|
|
chkEstatus.Checked = True
|
|
chkRequerido.Checked = True
|
|
|
|
ActualizarDocumentacion = False
|
|
|
|
CreatDTParametros()
|
|
|
|
GvParametros.DataSource = DTTempParametros
|
|
GvParametros.DataBind()
|
|
UpGvParametros.Update()
|
|
|
|
CveDocumentacion = -1
|
|
|
|
UpModalDocumentacion.Update()
|
|
End Sub
|
|
|
|
Private Sub CargaDocumentacion()
|
|
|
|
Dim objRH As New ClsEdocumentacion
|
|
|
|
If objRH.DocumentacionGet(-1, -1, -1, UsuarioActual.Empresa.CveEmpresa) Then
|
|
|
|
DTDocumentacion = objRH.DtResultados
|
|
GvDocumentos.DataSource = objRH.DtResultados
|
|
Else
|
|
DTDocumentacion = Nothing
|
|
GvDocumentos.DataSource = Nothing
|
|
End If
|
|
|
|
objRH.Dispose()
|
|
GvDocumentos.DataBind()
|
|
UPGvDocumentos.Update()
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaComboDocumentacion()
|
|
Dim objDocumentacion As New ClsEdocumentacion
|
|
|
|
If objDocumentacion.DocumentacionTipoGet(UsuarioActual.CveEmpresa) Then
|
|
|
|
DdlDocumentacionTipo.DataSource = objDocumentacion.DtResultados
|
|
|
|
End If
|
|
|
|
objDocumentacion.Dispose()
|
|
DdlDocumentacionTipo.DataBind()
|
|
DdlDocumentacionTipo.Items.Insert(0, New ListItem("Seleccione un tipo", "-1"))
|
|
End Sub
|
|
|
|
Public Sub Edit_ClickDocumentacion(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
CveDocumentacion = GvRow.DataKey("CveDocumentacion")
|
|
Documentacion = GvRow.DataKey("Documentacion")
|
|
DocumentacionFormato = GvRow.DataKey("DocumentacionFormato")
|
|
CveDocumentacionTipo = GvRow.DataKey("CveDocumentacionTipo")
|
|
DocumentacionTipo = GvRow.DataKey("DocumentacionTipo")
|
|
Orden = GvRow.DataKey("Orden")
|
|
Estatus = GvRow.DataKey("Estatus")
|
|
Requerido = GvRow.DataKey("Requerido")
|
|
|
|
Txtdocumentacion.Text = Documentacion
|
|
TxtOrden.Text = Orden
|
|
|
|
TxtDiasLimite.Text = GvRow.DataKey("DiasLimite")
|
|
ChkAplicaDiasLimite.Checked = GvRow.DataKey("AplicaDiasLimite")
|
|
ChkAplicaFechaVencimiento.Checked = GvRow.DataKey("AplicaFechaVencimiento")
|
|
|
|
|
|
DdlDocumentacionTipo.SelectedValueExist(CveDocumentacionTipo)
|
|
chkEstatus.Checked = Estatus
|
|
chkRequerido.Checked = Requerido
|
|
|
|
|
|
LtlTituloModalDocumentacion.Text = "Actualizar Documento: " & Documentacion
|
|
BtnAgregarDocumentoModal.Text = "Actualizar"
|
|
|
|
UpModalDocumentacion.Update()
|
|
ActualizarDocumentacion = True
|
|
|
|
|
|
|
|
|
|
CargaDatosParametro()
|
|
|
|
RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});")
|
|
|
|
End Sub
|
|
|
|
Private Function GuardarArchivo(_CveDocumentacion As Integer) As String
|
|
|
|
Dim respuesta As String = ""
|
|
|
|
Dim FileExtension As String = "-1"
|
|
Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
|
|
Dim Filename As String = ""
|
|
|
|
For Each fileItem As Archivo In Filesgral
|
|
Try
|
|
respuesta = fileItem.filenameO
|
|
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 & "Formatos\" & _CveDocumentacion & "_" & fileItem.filenameO
|
|
Dim docAnterior As String = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & DocumentacionFormato
|
|
|
|
If DocumentacionFormato.Trim.Length > 0 Then
|
|
If File.Exists(docAnterior) Then
|
|
File.Delete(docAnterior)
|
|
End If
|
|
End If
|
|
|
|
If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "\Formatos") Then
|
|
Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "\Formatos")
|
|
|
|
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
|
|
OnError("Error al cargar archivo", ex)
|
|
End Try
|
|
TxtFileDocumentacion.Text = ""
|
|
UpModalDocumentacion.Update()
|
|
Next
|
|
|
|
|
|
Return respuesta
|
|
End Function
|
|
|
|
Public Sub Remove_ClickDocumentacion(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion")
|
|
Dim _documetacionFormato As String = GvRow.DataKey("DocumentacionFormato")
|
|
|
|
|
|
|
|
Dim objEdoc As New ClsEdocumentacion
|
|
|
|
If objEdoc.DocumentacionRemove(_CveDocumentacion, UsuarioActual.Empresa.CveEmpresa) Then
|
|
EliminarDocumentoDisco(_documetacionFormato)
|
|
Alert("Documento eliminado correctamente", TipoMensaje.MsgInformacion)
|
|
cargaDocumentacion()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub EliminarDocumentoDisco(documento As String)
|
|
|
|
Dim archivo As String = UsuarioActual.Empresa.Ruta & "Formatos\" & documento
|
|
|
|
If File.Exists(archivo) Then
|
|
File.Delete(archivo)
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub BtnAgregarDocumentoModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumentoModal.Click
|
|
|
|
Dim ObjEdoc As New ClsEdocumentacion
|
|
Dim intCompleto As Integer = 0
|
|
Dim _estatus As Integer = 0
|
|
Dim _requerido As Integer = 0
|
|
Dim _formato As String = ""
|
|
|
|
Dim ErrorProceso As Boolean = True
|
|
|
|
|
|
If chkEstatus.Checked Then
|
|
_estatus = 1
|
|
End If
|
|
|
|
If chkRequerido.Checked Then
|
|
_requerido = 1
|
|
End If
|
|
|
|
If ActualizarDocumentacion Then
|
|
|
|
_formato = GuardarArchivo(CveDocumentacion)
|
|
If ObjEdoc.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa) Then
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion"))
|
|
Alert("Documento Actualizado correctamente.", TipoMensaje.MsgInformacion)
|
|
ErrorProceso = False
|
|
End If
|
|
|
|
Else
|
|
|
|
ObjEdoc.IniciaTransacSQL()
|
|
|
|
If ObjEdoc.DocumentacionAdd(Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa) Then
|
|
|
|
CveDocumentacion = ObjEdoc.DtResultados(0)(0).ToString.ToEntero
|
|
_formato = GuardarArchivo(CveDocumentacion)
|
|
|
|
If ObjEdoc.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa) Then
|
|
|
|
End If
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion"))
|
|
Alert("Documento agregado correctamente.", TipoMensaje.MsgInformacion)
|
|
|
|
|
|
If GvParametros.Rows.Count > 0 Then
|
|
|
|
For Each GvRow As GridViewRow In GvParametros.Rows
|
|
|
|
If Not ObjEdoc.AddDocumentacionParametros(CveDocumentacion, GvRow.DataKey("Parametro"), GvRow.DataKey("Descripcion"), UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
|
|
ErrorProceso = True
|
|
Exit For
|
|
Else
|
|
ErrorProceso = False
|
|
End If
|
|
|
|
Next
|
|
|
|
Else
|
|
ErrorProceso = False
|
|
End If
|
|
|
|
If Not ErrorProceso Then
|
|
ObjEdoc.Commit()
|
|
Else
|
|
ObjEdoc.RollBack()
|
|
End If
|
|
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
ObjEdoc.Dispose()
|
|
|
|
ActualizarDocumentacion = False
|
|
|
|
CargaDocumentacion()
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString.ToEntero
|
|
Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString
|
|
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
|
|
Dim separado As Char() = {"."}
|
|
Dim array() As String = DocumetacionFormato.Split(separado)
|
|
Dim extencion As String = ""
|
|
|
|
If array.Length > 0 Then
|
|
extencion = array(array.Length - 1)
|
|
End If
|
|
|
|
If DocumetacionFormato.Trim.Length > 0 Then
|
|
|
|
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & _CveDocumentacion & "_" & DocumetacionFormato
|
|
Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato
|
|
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 Formato'></i></a>", linkDescarga, DocumetacionFormato)
|
|
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 Formato'></i></a>", linkDescarga, DocumetacionFormato)
|
|
End If
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
|
|
Else
|
|
ImgDownLoad.Visible = False
|
|
End If
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
|
|
Property DTTempParametros As DataTable
|
|
|
|
Get
|
|
|
|
If ViewState("DTTempParametros") Is Nothing Then
|
|
Return New DataTable
|
|
Else
|
|
Return DirectCast(ViewState("DTTempParametros"), DataTable)
|
|
End If
|
|
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTTempParametros") = value
|
|
End Set
|
|
|
|
End Property
|
|
|
|
|
|
|
|
Property IndexParametro As Integer
|
|
|
|
Get
|
|
If ViewState("IndexParametro") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return ViewState("IndexParametro").ToString.ToEntero
|
|
End If
|
|
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("IndexParametro") = value
|
|
End Set
|
|
|
|
End Property
|
|
|
|
Property CveDocumentacionParametro As Integer
|
|
|
|
Get
|
|
If ViewState("CveDocumentacionParametro") Is Nothing Then
|
|
Return -1
|
|
Else
|
|
Return ViewState("CveDocumentacionParametro").ToString.ToEntero
|
|
End If
|
|
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveDocumentacionParametro") = value
|
|
End Set
|
|
|
|
End Property
|
|
|
|
Private Sub CargaDatosParametro()
|
|
|
|
If CveDocumentacion > 0 Then
|
|
|
|
Dim ObjDoc As New ClsEdocumentacion
|
|
|
|
If ObjDoc.GetDocumentacionParametros(-1, CveDocumentacion, UsuarioActual.CveEmpresa) Then
|
|
GvParametros.DataSource = ObjDoc.DtResultados
|
|
End If
|
|
|
|
ObjDoc.Dispose()
|
|
GvParametros.DataBind()
|
|
|
|
Else
|
|
GvParametros.DataSource = DTTempParametros
|
|
GvParametros.DataBind()
|
|
End If
|
|
|
|
UpGvParametros.Update()
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub CreatDTParametros()
|
|
|
|
Dim DT As New DataTable
|
|
|
|
DT.Columns.Add("CveDocumentacionParametro", GetType(Integer))
|
|
DT.Columns.Add("CveDocumentacion", GetType(Integer))
|
|
DT.Columns.Add("Documentacion", GetType(String))
|
|
DT.Columns.Add("Parametro", GetType(String))
|
|
DT.Columns.Add("Descripcion", GetType(String))
|
|
DT.Columns.Add("CveUsuario", GetType(Integer))
|
|
DT.Columns.Add("Nombre", GetType(String))
|
|
DT.Columns.Add("FechaIng", GetType(Date))
|
|
DT.Columns.Add("CveEmpresa", GetType(Integer))
|
|
|
|
DT.AcceptChanges()
|
|
|
|
DTTempParametros = DT
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub LnkEliminarParametro_Click(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
Dim CveDocumentacionParametroEliminar As Integer = GvRow.DataKey("CveDocumentacionParametro").ToEntero
|
|
Dim IndexEliminar As Integer = GvRow.RowIndex
|
|
|
|
If CveDocumentacion > 0 Then
|
|
|
|
Dim ObjDoc As New ClsEdocumentacion
|
|
If ObjDoc.RemoveDocumentacionParametros(CveDocumentacionParametroEliminar, UsuarioActual.CveEmpresa) Then
|
|
Alert("Parametro eliminado correctamente.")
|
|
End If
|
|
ObjDoc.Dispose()
|
|
|
|
|
|
Else
|
|
Dim DRow As DataRow = DTTempParametros(IndexEliminar)
|
|
DRow.Delete()
|
|
DTTempParametros.AcceptChanges()
|
|
Alert("Parametro eliminado correctamente.")
|
|
End If
|
|
|
|
|
|
CargaDatosParametro()
|
|
|
|
|
|
End Sub
|
|
|
|
Protected Sub LnkParametroEditar_Click(sender As Object, e As EventArgs)
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
|
|
If CveDocumentacion > 0 Then
|
|
CveDocumentacionParametro = GvRow.DataKey("CveDocumentacionParametro").ToString.ToEntero
|
|
IndexParametro = -1
|
|
Else
|
|
CveDocumentacionParametro = -1
|
|
IndexParametro = GvRow.RowIndex
|
|
End If
|
|
|
|
TxtParametro.Text = GvRow.DataKey("Parametro")
|
|
TxtParametroDescripcion.Text = GvRow.DataKey("Descripcion")
|
|
|
|
UpModalParametros.Update()
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('show');", "DVParametros"))
|
|
IndexParametro = -1
|
|
|
|
End Sub
|
|
|
|
Protected Sub BtnGuardarParametro_Click(sender As Object, e As EventArgs)
|
|
|
|
Dim ErrorProceso As Boolean = True
|
|
|
|
|
|
If CveDocumentacion > 0 Then
|
|
|
|
Dim ObjDoc As New ClsEdocumentacion
|
|
|
|
|
|
If CveDocumentacionParametro > 0 Then
|
|
If ObjDoc.UpdateDocumentacionParametros(CveDocumentacionParametro, CveDocumentacion, TxtParametro.Text.Trim, TxtParametroDescripcion.Text.Trim, UsuarioActual.CveEmpresa) Then
|
|
Alert("Parametro actualizado correctamente.")
|
|
ErrorProceso = False
|
|
End If
|
|
Else
|
|
If ObjDoc.AddDocumentacionParametros(CveDocumentacion, TxtParametro.Text.Trim, TxtParametroDescripcion.Text.Trim, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
|
|
Alert("Parametro agregado correctamente.")
|
|
ErrorProceso = False
|
|
End If
|
|
End If
|
|
|
|
|
|
ObjDoc.Dispose()
|
|
|
|
Else
|
|
If IndexParametro > 0 Then
|
|
Dim Drow As DataRow = DTTempParametros(IndexParametro)
|
|
Drow("Parametro") = TxtParametro.Text
|
|
Drow("Descripcion") = TxtParametroDescripcion.Text
|
|
'Editar Row en base a index
|
|
ErrorProceso = False
|
|
Alert("Parametro actualizado correctamente.")
|
|
Else
|
|
|
|
Dim Drow As DataRow = DTTempParametros.NewRow
|
|
Drow("Parametro") = TxtParametro.Text
|
|
Drow("Descripcion") = TxtParametroDescripcion.Text
|
|
|
|
|
|
DTTempParametros.Rows.Add(Drow)
|
|
Alert("Parametro agregado correctamente.")
|
|
ErrorProceso = False
|
|
'Agreagr Row
|
|
End If
|
|
DTTempParametros.AcceptChanges()
|
|
End If
|
|
|
|
If ErrorProceso = False Then
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "DVParametros"))
|
|
End If
|
|
|
|
CargaDatosParametro()
|
|
|
|
End Sub
|
|
|
|
Protected Sub LnkAgregarParametro_Click(sender As Object, e As EventArgs)
|
|
|
|
|
|
TxtParametro.Text = ""
|
|
TxtParametroDescripcion.Text = ""
|
|
|
|
CveDocumentacionParametro = -1
|
|
IndexParametro = -1
|
|
|
|
UpModalParametros.Update()
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('show');", "DVParametros"))
|
|
|
|
End Sub
|
|
End Class
|
|
|