-- bandera de bloqueos por horas y días

This commit is contained in:
2024-11-22 14:14:59 -07:00
parent 3843d919e2
commit b6598b1748
2 changed files with 12 additions and 5 deletions

View File

@@ -62,6 +62,7 @@ Public Class ClsSisUsuarios
Public Property AsignarAutomaticamenteSubProyecto As Boolean Public Property AsignarAutomaticamenteSubProyecto As Boolean
Public Property AsignarAutomaticamenteOC As Boolean Public Property AsignarAutomaticamenteOC As Boolean
Public Property DescuentoAutorizado As Double Public Property DescuentoAutorizado As Double
Public Property AplicaRestriccionAcceso As Boolean
#End Region #End Region
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional UsuarioActual As Usuario = Nothing) Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional UsuarioActual As Usuario = Nothing)
@@ -507,6 +508,7 @@ Public Class ClsSisUsuarios
Me.AsignarAutomaticamenteSubProyecto = If(Data.Rows(0)("AsignarAutomaticamenteSubProyecto").ToString = "Si", True, False) Me.AsignarAutomaticamenteSubProyecto = If(Data.Rows(0)("AsignarAutomaticamenteSubProyecto").ToString = "Si", True, False)
Me.AsignarAutomaticamenteOC = If(Data.Rows(0)("AsignarAutomaticamenteOC").ToString = "Si", True, False) Me.AsignarAutomaticamenteOC = If(Data.Rows(0)("AsignarAutomaticamenteOC").ToString = "Si", True, False)
Me.DescuentoAutorizado = Data.Rows(0)("DescuentoAutorizado").ToString.ToDouble Me.DescuentoAutorizado = Data.Rows(0)("DescuentoAutorizado").ToString.ToDouble
AplicaRestriccionAcceso = If(Data.Rows(0)("AplicaRestriccionAcceso").ToString = "SI", True, False)
'Me.TipoControl = Data.Rows(0)("TipoControl").ToString.ToEntero 'Me.TipoControl = Data.Rows(0)("TipoControl").ToString.ToEntero
'Me.EsLogIn = Data.Rows(0)("EsLogIn").ToString.ToEntero 'Me.EsLogIn = Data.Rows(0)("EsLogIn").ToString.ToEntero
End If End If
@@ -551,7 +553,8 @@ Public Class ClsSisUsuarios
CvePersonal As Integer, CveVendedor As Integer, CambiarContraseña As Boolean, CvePersonal As Integer, CveVendedor As Integer, CambiarContraseña As Boolean,
CveUsuarioIng As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Optional Rol As String = "-1", Optional CveAlmacenAsignado As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False, CveUsuarioIng As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Optional Rol As String = "-1", Optional CveAlmacenAsignado As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False,
Optional CvePlataforma As Integer = -1, Optional CveClientePlataforma As Integer = -1, Optional CveProveedorPlataforma As Integer = -1, Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1", Optional CvePlataforma As Integer = -1, Optional CveClientePlataforma As Integer = -1, Optional CveProveedorPlataforma As Integer = -1, Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1",
Optional LimiteCreditoAutorizado As Decimal = 0, Optional PorcentajeMaximoAutorizacion As Decimal = 0, Optional DiasMaximoAutorizacion As Integer = 0, Optional Celular As String = "") As Integer Optional LimiteCreditoAutorizado As Decimal = 0, Optional PorcentajeMaximoAutorizacion As Decimal = 0,
Optional DiasMaximoAutorizacion As Integer = 0, Optional Celular As String = "", Optional AplicaRestriccionAcceso As Boolean = False) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_Sis_UsuarioAdd") DataAdapter("PA_Sis_UsuarioAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -576,6 +579,7 @@ Public Class ClsSisUsuarios
.Add("@PorcentajeMaximoAutorizacion", SqlDbType.Money).Value = PorcentajeMaximoAutorizacion .Add("@PorcentajeMaximoAutorizacion", SqlDbType.Money).Value = PorcentajeMaximoAutorizacion
.Add("@DiasMaximoAutorizacion", SqlDbType.Int).Value = DiasMaximoAutorizacion .Add("@DiasMaximoAutorizacion", SqlDbType.Int).Value = DiasMaximoAutorizacion
.Add("@Celular", SqlDbType.VarChar).Value = Celular .Add("@Celular", SqlDbType.VarChar).Value = Celular
.Add("@AplicaRestriccionAcceso", SqlDbType.Bit).Value = If(AplicaRestriccionAcceso, 1, 0)
.Add("@CveUsuario", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CveUsuario", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With
@@ -703,7 +707,9 @@ Public Class ClsSisUsuarios
End Function End Function
Public Function UpdateUsuario(Usuario As String, Nombre As String, CveRol As Integer, Correo As String, CvePersonal As Integer, Public Function UpdateUsuario(Usuario As String, Nombre As String, CveRol As Integer, Correo As String, CvePersonal As Integer,
CveVendedor As Integer, CambiarContraseña As Boolean, Activo As Boolean, CveEmpresa As Integer, CveUsuario As Integer, CveAlmacenAsignado As Integer, CveSubProyecto As Integer, Optional CveUsuarioModifico As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False, CveVendedor As Integer, CambiarContraseña As Boolean, Activo As Boolean, CveEmpresa As Integer, CveUsuario As Integer, CveAlmacenAsignado As Integer, CveSubProyecto As Integer, Optional CveUsuarioModifico As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False,
Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1", Optional LimiteCreditoAutorizado As Decimal = 0, Optional PorcentajeMaximoAutorizacion As Decimal = 0, Optional DiasMaximoAutorizacion As Integer = 0, Optional Celular As String = "") As Boolean Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1",
Optional LimiteCreditoAutorizado As Decimal = 0, Optional PorcentajeMaximoAutorizacion As Decimal = 0,
Optional DiasMaximoAutorizacion As Integer = 0, Optional Celular As String = "", Optional AplicaRestriccionAcceso As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Sis_UsuarioUpdate") DataAdapter("PA_Sis_UsuarioUpdate")
@@ -729,6 +735,7 @@ Public Class ClsSisUsuarios
.Add("@PorcentajeMaximoAutorizacion", SqlDbType.Money).Value = PorcentajeMaximoAutorizacion .Add("@PorcentajeMaximoAutorizacion", SqlDbType.Money).Value = PorcentajeMaximoAutorizacion
.Add("@DiasMaximoAutorizacion", SqlDbType.Int).Value = DiasMaximoAutorizacion .Add("@DiasMaximoAutorizacion", SqlDbType.Int).Value = DiasMaximoAutorizacion
.Add("@Celular", SqlDbType.VarChar).Value = Celular .Add("@Celular", SqlDbType.VarChar).Value = Celular
.Add("@AplicaRestriccionAcceso", SqlDbType.Bit).Value = If(AplicaRestriccionAcceso, 1, 0)
End With End With
Try Try

View File

@@ -605,7 +605,7 @@ Partial Class Sistemas_UsuarioDetalle
ChkCambiarContraseña.Checked = ObjUsuario.PolCambiarContraseña ChkCambiarContraseña.Checked = ObjUsuario.PolCambiarContraseña
ChkAsignarSubProyecto.Checked = ObjUsuario.AsignarAutomaticamenteSubProyecto ChkAsignarSubProyecto.Checked = ObjUsuario.AsignarAutomaticamenteSubProyecto
ChkAsignarOC.Checked = ObjUsuario.AsignarAutomaticamenteOC ChkAsignarOC.Checked = ObjUsuario.AsignarAutomaticamenteOC
ChkAplicaRestriccion.Checked = ObjUsuario.AplicaRestriccionAcceso
CargaBitacora() CargaBitacora()
LblFechaCaptura.Text = ObjUsuario.Fecha.ToShortDateString LblFechaCaptura.Text = ObjUsuario.Fecha.ToShortDateString
@@ -877,7 +877,7 @@ Partial Class Sistemas_UsuarioDetalle
End If End If
Next Next
Else Else
If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso, LimiteCreditoAutorizado:=TxtLimiteAutorizado.Text.ToDecimal(), PorcentajeMaximoAutorizacion:=TxtPorcentajeMaximoAutorizacion.Text.ToDecimal(), DiasMaximoAutorizacion:=TxtDiasVencidos.Text.ToEntero(), Celular:=TxtTelefono.Text.Trim()) Then If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso, LimiteCreditoAutorizado:=TxtLimiteAutorizado.Text.ToDecimal(), PorcentajeMaximoAutorizacion:=TxtPorcentajeMaximoAutorizacion.Text.ToDecimal(), DiasMaximoAutorizacion:=TxtDiasVencidos.Text.ToEntero(), Celular:=TxtTelefono.Text.Trim(), AplicaRestriccionAcceso:=ChkAplicaRestriccion.Checked) Then
TieneError = True TieneError = True
End If End If