Documetos parametros, Alamacenes, RepEstado resultados(General)
This commit is contained in:
@@ -170,7 +170,16 @@ Partial Class RH_CatDocumentos
|
||||
chkEstatus.Checked = True
|
||||
chkRequerido.Checked = True
|
||||
|
||||
ActualizarDocumentacion = False
|
||||
ActualizarDocumentacion = False
|
||||
|
||||
CreatDTParametros()
|
||||
|
||||
GvParametros.DataSource = DTTempParametros
|
||||
GvParametros.DataBind()
|
||||
UpGvParametros.Update()
|
||||
|
||||
CveDocumentacion = -1
|
||||
|
||||
UpModalDocumentacion.Update()
|
||||
End Sub
|
||||
|
||||
@@ -237,8 +246,13 @@ Partial Class RH_CatDocumentos
|
||||
BtnAgregarDocumentoModal.Text = "Actualizar"
|
||||
|
||||
UpModalDocumentacion.Update()
|
||||
ActualizarDocumentacion = True
|
||||
|
||||
ActualizarDocumentacion = True
|
||||
|
||||
|
||||
|
||||
|
||||
CargaDatosParametro()
|
||||
|
||||
RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});")
|
||||
|
||||
End Sub
|
||||
@@ -319,13 +333,15 @@ Partial Class RH_CatDocumentos
|
||||
|
||||
Protected Sub BtnAgregarDocumentoModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumentoModal.Click
|
||||
|
||||
Dim objRH As New ClsEdocumentacion
|
||||
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
|
||||
@@ -337,30 +353,64 @@ Partial Class RH_CatDocumentos
|
||||
If ActualizarDocumentacion Then
|
||||
|
||||
_formato = GuardarArchivo(CveDocumentacion)
|
||||
If objRH.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
|
||||
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)
|
||||
CargaDocumentacion()
|
||||
End If
|
||||
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
|
||||
|
||||
Else
|
||||
If objRH.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 = objRH.DtResultados(0)(0).ToString.ToEntero
|
||||
_formato = GuardarArchivo(CveDocumentacion)
|
||||
If objRH.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
|
||||
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)
|
||||
CargaDocumentacion()
|
||||
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
|
||||
|
||||
|
||||
@@ -399,10 +449,226 @@ Partial Class RH_CatDocumentos
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user