VERSION 5.00
Object = "{C4DED68B-C40F-11D6-AD1A-000795CA0957}#39.0#0"; "pry_list.ocx"
Begin VB.Form fgrupos_usuarios 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Usuarios del grupo"
   ClientHeight    =   3510
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6360
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3510
   ScaleWidth      =   6360
   StartUpPosition =   2  'CenterScreen
   Begin pry_list.ctrl_listarray ctrl_list1 
      Height          =   2175
      Left            =   240
      TabIndex        =   4
      Top             =   360
      Width           =   5895
      _ExtentX        =   10398
      _ExtentY        =   3836
   End
   Begin VB.TextBox TXT_ID 
      Enabled         =   0   'False
      Height          =   285
      Left            =   120
      TabIndex        =   3
      Top             =   0
      Width           =   2175
   End
   Begin VB.TextBox TXT_NOMBRE 
      Enabled         =   0   'False
      Height          =   285
      Left            =   2520
      TabIndex        =   2
      Top             =   0
      Width           =   3615
   End
   Begin VB.CommandButton cmd_aceptar 
      Caption         =   "Grabar"
      Height          =   615
      Left            =   720
      Picture         =   "fgrupos_usuarios.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   2640
      Width           =   1455
   End
   Begin VB.CommandButton cmd_cancelar 
      Cancel          =   -1  'True
      Caption         =   "Cancelar"
      Height          =   615
      Left            =   3840
      Picture         =   "fgrupos_usuarios.frx":0532
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   2640
      Width           =   1455
   End
End
Attribute VB_Name = "fgrupos_usuarios"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public rs_grupos As ADODB.Recordset
Public rs_usergroup As ADODB.Recordset
Dim mobj_gruposusuarios As DB_SE_MANTENIMIENTOS.c_usuariogrupo
Dim mobj_cseguridad As DB_SE_MANTENIMIENTOS.c_seguridad

Private Sub CMD_ACEPTAR_Click()
Dim lm_grupos()
Dim i, lim As Integer
Dim ls_grupo As String
Dim ls_user As String

On Error GoTo errhandler

lm_grupos = ctrl_list1.llenar_matriz
lim = UBound(lm_grupos, 1) - 1
'borrar usuarios
ls_grupo = Trim(TXT_ID.Text)
mobj_gruposusuarios.borrarusuariosdelGrupo ls_grupo
'agregar usuarios nuevos
For i = 1 To lim
    ls_user = lm_grupos(i, 1)
    mobj_gruposusuarios.AgregarGrupoausuario ls_user, ls_grupo
Next
Unload Me

Exit Sub
errhandler:
    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Advertencia"

End Sub

Private Sub cmd_cancelar_Click()
Unload Me
End Sub

Private Sub Form_Activate()
Set mobj_gruposusuarios = New DB_SE_MANTENIMIENTOS.c_usuariogrupo

'Set rs_grupos = New ADODB.Recordset
'Set rs_usergroup = New ADODB.Recordset

'LSTR_CADE = "select USERID,USERNAME from VW_GRUPOSPOSIBLES where GROUPID='" + Trim(TXT_ID.Text) + "'"
'LSTR_CADE2 = "select userid,username from vw_usuariosgrupos where groupid='" + Trim(TXT_ID.Text) + "'"

Set rs_grupos = mobj_cseguridad.GRUPOSPOSIBLES_grupo(Trim(TXT_ID.Text))

Set rs_usergroup = mobj_cseguridad.usuariosgrupos_grupo(Trim(TXT_ID.Text))

ctrl_list1.llena_lista rs_grupos, rs_usergroup

End Sub

Private Sub Form_Load()
Set mobj_cseguridad = New DB_SE_MANTENIMIENTOS.c_seguridad
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set mobj_gruposusuarios = Nothing
Set mobj_cseguridad = Nothing
Set rs_grupos = Nothing
Set rs_usergroup = Nothing
End Sub

