Cambio en GLOBAL Almacen
This commit is contained in:
@@ -7503,20 +7503,48 @@ Namespace Modelos
|
||||
HttpContext.Current.Application("GlobalDTSeccionAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTAlmacen(CveEmpresa As Integer) As DataTable
|
||||
Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable
|
||||
Get
|
||||
If CveEmpresa <> -1 Then
|
||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
|
||||
GlobalDTAlmacen = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
Else
|
||||
GlobalDTAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTAlmacen"), DataTable)
|
||||
Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa)
|
||||
'sino existe, recarga los datos
|
||||
If HttpContext.Current.Application(AppNombre) Is Nothing Then
|
||||
Dim ObjUsr As New ClsInventarios
|
||||
If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados
|
||||
ObjUsr.Dispose()
|
||||
End If
|
||||
|
||||
Dim Str As New StringBuilder
|
||||
Str.Append("1=1 AND ")
|
||||
If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
|
||||
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
|
||||
If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
|
||||
If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
|
||||
|
||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
|
||||
GlobalDTAlmacen = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
HttpContext.Current.Application("GlobalDTAlmacen") = value
|
||||
Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa)
|
||||
HttpContext.Current.Application(AppNombre) = value
|
||||
End Set
|
||||
'Get
|
||||
|
||||
' Dim Str As New StringBuilder
|
||||
' Str.Append("1=1 AND ")
|
||||
' If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
|
||||
' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
|
||||
' If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
|
||||
' If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
|
||||
|
||||
' Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
|
||||
' GlobalDTAlmacen = Dv.ToTable
|
||||
' Dv.Dispose()
|
||||
|
||||
'End Get
|
||||
'Set(value As DataTable)
|
||||
' Application("GlobalDTAlmacen") = value
|
||||
'End Set
|
||||
End Property
|
||||
Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1) As DataTable
|
||||
Get
|
||||
|
||||
@@ -215,11 +215,11 @@ Partial Class Inventarios_CatAlmacenes
|
||||
|
||||
Private Sub RecargaGlobalAlmacenes()
|
||||
GlobalDTAlmacen(UsuarioActual.CveEmpresa) = Nothing
|
||||
'Dim ObjAlmacen As New ClsInventarios
|
||||
'If ObjAlmacen.GetAlmacenes(-1, -1, -1, -1) Then
|
||||
' GlobalDTAlmacen(-1) = ObjAlmacen.DtResultados
|
||||
'End If
|
||||
'ObjAlmacen.Dispose()
|
||||
Dim ObjAlmacen As New ClsInventarios
|
||||
If ObjAlmacen.GetAlmacenes(-1, -1, -1, -1) Then
|
||||
HttpContext.Current.Application("GlobalDTAlmacen") = ObjAlmacen.DtResultados
|
||||
End If
|
||||
ObjAlmacen.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub RecargaGlobalAlmacenesUsuarios()
|
||||
|
||||
Reference in New Issue
Block a user