VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmUsers 
   BackColor       =   &H00404040&
   BorderStyle     =   0  'None
   Caption         =   "Usuários"
   ClientHeight    =   9015
   ClientLeft      =   3570
   ClientTop       =   4500
   ClientWidth     =   7605
   BeginProperty Font 
      Name            =   "Small Fonts"
      Size            =   6.75
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   601
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   507
   ShowInTaskbar   =   0   'False
   Begin Synapsis.AutoScroll ascBar 
      Align           =   4  'Align Right
      Height          =   8565
      Left            =   5070
      TabIndex        =   17
      Top             =   255
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   15108
      BackColor       =   4210752
      Begin VB.PictureBox picContainer 
         BackColor       =   &H00404040&
         BorderStyle     =   0  'None
         Height          =   7515
         Left            =   0
         ScaleHeight     =   7515
         ScaleWidth      =   2535
         TabIndex        =   18
         Top             =   0
         Width           =   2535
         Begin VB.TextBox txtUserFilter 
            Appearance      =   0  'Flat
            BackColor       =   &H00606060&
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00FFFFFF&
            Height          =   285
            Left            =   0
            TabIndex        =   32
            Top             =   1350
            Width           =   2490
         End
         Begin Synapsis.MicroHeader mhdDeco 
            Height          =   255
            Index           =   2
            Left            =   0
            TabIndex        =   33
            Top             =   1080
            Width           =   2565
            _ExtentX        =   4524
            _ExtentY        =   450
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   16769216
            Caption         =   "Pesquisa"
            UseIcons        =   0   'False
         End
         Begin VB.PictureBox picUserData 
            Appearance      =   0  'Flat
            BackColor       =   &H00404040&
            BorderStyle     =   0  'None
            ForeColor       =   &H80000008&
            Height          =   5730
            Left            =   0
            ScaleHeight     =   5730
            ScaleWidth      =   2535
            TabIndex        =   22
            Top             =   1755
            Width           =   2535
            Begin VB.TextBox txtData 
               Appearance      =   0  'Flat
               BackColor       =   &H00606060&
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   285
               Index           =   7
               Left            =   45
               TabIndex        =   7
               Top             =   3735
               Width           =   2445
            End
            Begin VB.OptionButton optLevel 
               BackColor       =   &H00404040&
               Caption         =   "Operator"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   4
               Left            =   1170
               TabIndex        =   11
               Top             =   4815
               Width           =   1185
            End
            Begin VB.OptionButton optLevel 
               BackColor       =   &H00404040&
               Caption         =   "Elder"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   3
               Left            =   1170
               TabIndex        =   10
               Top             =   4590
               Width           =   1185
            End
            Begin VB.OptionButton optLevel 
               BackColor       =   &H00404040&
               Caption         =   "Neonate"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   2
               Left            =   1170
               TabIndex        =   9
               Top             =   4365
               Width           =   1185
            End
            Begin VB.OptionButton optLevel 
               BackColor       =   &H00404040&
               Caption         =   "Guest User"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   1
               Left            =   1170
               TabIndex        =   8
               Top             =   4140
               Width           =   1185
            End
            Begin VB.CheckBox chkBanned 
               BackColor       =   &H00404040&
               Caption         =   "Banido"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H0000FFFF&
               Height          =   240
               Left            =   1170
               TabIndex        =   12
               Top             =   5040
               Width           =   915
            End
            Begin VB.TextBox txtData 
               Appearance      =   0  'Flat
               BackColor       =   &H00606060&
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   285
               Index           =   0
               Left            =   45
               TabIndex        =   0
               Top             =   540
               Width           =   2445
            End
            Begin VB.TextBox txtData 
               Appearance      =   0  'Flat
               BackColor       =   &H00606060&
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   285
               Index           =   1
               Left            =   45
               TabIndex        =   1
               Top             =   1125
               Width           =   1365
            End
            Begin VB.TextBox txtData 
               Appearance      =   0  'Flat
               BackColor       =   &H00606060&
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   570
               Index           =   2
               Left            =   45
               MultiLine       =   -1  'True
               TabIndex        =   3
               Top             =   1710
               Width           =   2445
            End
            Begin VB.TextBox txtData 
               Appearance      =   0  'Flat
               BackColor       =   &H00606060&
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   285
               Index           =   3
               Left            =   45
               TabIndex        =   4
               Top             =   2565
               Width           =   2445
            End
            Begin VB.TextBox txtData 
               Appearance      =   0  'Flat
               BackColor       =   &H00606060&
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   285
               Index           =   4
               Left            =   45
               TabIndex        =   5
               Top             =   3150
               Width           =   1095
            End
            Begin VB.TextBox txtData 
               Appearance      =   0  'Flat
               BackColor       =   &H00606060&
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   285
               Index           =   5
               Left            =   1170
               TabIndex        =   6
               Top             =   3150
               Width           =   1320
            End
            Begin VB.CommandButton cmdUpdate 
               BackColor       =   &H00808080&
               Caption         =   "Gravar"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   285
               Left            =   1170
               Style           =   1  'Graphical
               TabIndex        =   13
               Top             =   5445
               Width           =   1320
            End
            Begin VB.TextBox txtData 
               Appearance      =   0  'Flat
               BackColor       =   &H00606060&
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   285
               Index           =   6
               Left            =   1440
               TabIndex        =   2
               Top             =   1125
               Width           =   1050
            End
            Begin Synapsis.MicroHeader mhdDeco 
               Height          =   255
               Index           =   1
               Left            =   0
               TabIndex        =   31
               Top             =   0
               Width           =   2565
               _ExtentX        =   4524
               _ExtentY        =   450
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   16769216
               Caption         =   "Informações do Usuário"
               UseIcons        =   0   'False
            End
            Begin VB.Label lblDeco 
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "Crédito"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   8
               Left            =   45
               TabIndex        =   34
               Top             =   3510
               Width           =   615
            End
            Begin VB.Label lblDeco 
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "eMail"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   3
               Left            =   45
               TabIndex        =   30
               Top             =   2340
               Width           =   450
            End
            Begin VB.Label lblDeco 
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "Nome"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   0
               Left            =   45
               TabIndex        =   29
               Top             =   315
               Width           =   480
            End
            Begin VB.Label lblDeco 
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "Alias"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   1
               Left            =   45
               TabIndex        =   28
               Top             =   900
               Width           =   405
            End
            Begin VB.Label lblDeco 
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "Endereço"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   2
               Left            =   45
               TabIndex        =   27
               Top             =   1485
               Width           =   780
            End
            Begin VB.Label lblDeco 
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "Telefone"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   4
               Left            =   45
               TabIndex        =   26
               Top             =   2925
               Width           =   735
            End
            Begin VB.Label lblDeco 
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "ICQ"
               BeginProperty Font 
                  Name            =   "Small Fonts"
                  Size            =   6.75
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   165
               Index           =   5
               Left            =   1170
               TabIndex        =   25
               Top             =   2970
               Width           =   300
            End
            Begin VB.Label lblDeco 
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "Nível"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   6
               Left            =   45
               TabIndex        =   24
               Top             =   4095
               Width           =   405
            End
            Begin VB.Label lblDeco 
               Alignment       =   1  'Right Justify
               AutoSize        =   -1  'True
               BackStyle       =   0  'Transparent
               Caption         =   "Nascimento"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   195
               Index           =   7
               Left            =   1500
               TabIndex        =   23
               Top             =   900
               Width           =   990
            End
         End
         Begin Synapsis.MicroHeader mhdDeco 
            Height          =   255
            Index           =   0
            Left            =   0
            TabIndex        =   21
            Top             =   360
            Width           =   2565
            _ExtentX        =   4524
            _ExtentY        =   450
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   16769216
            Caption         =   "Cadastro"
            UseIcons        =   0   'False
         End
         Begin VB.CheckBox chkAll 
            BackColor       =   &H00808080&
            Caption         =   "Selecionar Todos"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   90
            Style           =   1  'Graphical
            TabIndex        =   20
            Top             =   45
            Width           =   2355
         End
         Begin VB.ListBox lstVerbs0 
            Appearance      =   0  'Flat
            BackColor       =   &H00404040&
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00D0D0D0&
            Height          =   510
            Index           =   0
            IntegralHeight  =   0   'False
            ItemData        =   "frmUsers.frx":0000
            Left            =   -45
            List            =   "frmUsers.frx":000A
            TabIndex        =   19
            Top             =   585
            Width           =   2625
         End
      End
   End
   Begin Synapsis.MicroFooter mcfMain 
      Align           =   2  'Align Bottom
      Height          =   195
      Left            =   0
      TabIndex        =   15
      Top             =   8820
      Width           =   7605
      _ExtentX        =   13414
      _ExtentY        =   344
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Small Fonts"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "[DEL] Exclui, [INS] Cria novo. List por padrão vazia: Utilize [Pesquisa] sem parâmetros para carregar."
   End
   Begin Synapsis.MicroHeader mchMain 
      Align           =   1  'Align Top
      Height          =   255
      Left            =   0
      TabIndex        =   14
      Top             =   0
      Width           =   7605
      _ExtentX        =   13414
      _ExtentY        =   450
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "Usuários"
   End
   Begin MSComctlLib.ListView lstItems 
      DragIcon        =   "frmUsers.frx":002C
      Height          =   6945
      Left            =   135
      TabIndex        =   16
      Tag             =   "MainUserList"
      Top             =   360
      Width           =   4785
      _ExtentX        =   8440
      _ExtentY        =   12250
      View            =   3
      LabelEdit       =   1
      MultiSelect     =   -1  'True
      LabelWrap       =   -1  'True
      HideSelection   =   0   'False
      FullRowSelect   =   -1  'True
      _Version        =   393217
      SmallIcons      =   "imlUser"
      ForeColor       =   16777215
      BackColor       =   6316128
      Appearance      =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   6
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "ID"
         Object.Width           =   38100
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "Alias"
         Object.Width           =   38100
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "Nome"
         Object.Width           =   38100
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Text            =   "Idade"
         Object.Width           =   38100
      EndProperty
      BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   4
         Text            =   "Banido"
         Object.Width           =   38100
      EndProperty
      BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   5
         Text            =   "Crédito"
         Object.Width           =   38100
      EndProperty
   End
   Begin MSComctlLib.ImageList imlUser 
      Left            =   405
      Top             =   3240
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   15
      ImageHeight     =   19
      MaskColor       =   6316128
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   2
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUsers.frx":08F6
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUsers.frx":0CD8
            Key             =   ""
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmUsers"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub chkAll_Click()
On Error GoTo pschkAll_ClickErr 'EHCG.UID.pschkAll_Click

Dim uItem As ListItem

    For Each uItem In Me.lstItems.ListItems
    uItem.Selected = (chkAll.Value = 1)
    Next uItem

Exit Sub
pschkAll_ClickErr:
Err.Raise Err.number, Err.Source, "ps.chkAll_Click (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Sub cmdUpdate_Click()
On Error GoTo pscmdUpdate_ClickErr 'EHCG.UID.pscmdUpdate_Click

Dim uUser As New User

    If Me.Tag <> "" Then
    Set uUser = Data.Users.Item("N" & Me.Tag)
    Else
    uUser.OnParse = True
    End If

uUser.Name = Me.txtData(0)
uUser.Alias = Me.txtData(1)
uUser.Adress = Me.txtData(2)
uUser.Email = Me.txtData(3)
uUser.Phone = Me.txtData(4)
uUser.Icq = ValidNum(Me.txtData(5))
uUser.Birth = ValidDate(Me.txtData(6))
uUser.Credit = ValidNum(Me.txtData(7))

    If Me.optLevel(1) Then Set uUser.User_class = Data.User_Classes.SeekID(1)
    If Me.optLevel(2) Then Set uUser.User_class = Data.User_Classes.SeekID(2)
    If Me.optLevel(3) Then Set uUser.User_class = Data.User_Classes.SeekID(3)
    If Me.optLevel(4) Then Set uUser.User_class = Data.User_Classes.SeekID(4)

uUser.Banned = Me.chkBanned * -1

    If Me.Tag = "" Then
    uUser.OnParse = False
    Data.Users.Add uUser
    End If

Status IIf(Me.Tag <> "", "A alteração", "A Inclusão") & " dos dados cadastrais do usuário ocorreu com sucesso!", uSTSuccess

Me.UpdateItem uUser.ID
If Me.txtUserFilter <> "" Then MDIMain.txtUserFilter = Me.txtUserFilter
MDIMain.PopulateUserList
LoadItemData (0)

Exit Sub
pscmdUpdate_ClickErr:

Status Err.Description, uSTError
End Sub
Private Sub Form_GotFocus()
On Error GoTo psForm_GotFocusErr 'EHCG.UID.psForm_GotFocus

Me.mchMain.Focus = True

Exit Sub
psForm_GotFocusErr:
Err.Raise Err.number, Err.Source, "ps.Form_GotFocus (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Sub Form_Load()
On Error GoTo psForm_LoadErr 'EHCG.UID.psForm_Load

ApplyLanguage Me

Data.UserListLoaded = True
Me.Visible = True
' Call PopulateList
LoadItemData 0

Status "Lista de usuários: Digite [Enter] no campo de pesquisa para exibir o conteúdo do cadastro.", uSTMessage

Exit Sub
psForm_LoadErr:
Err.Raise Err.number, Err.Source, "ps.Form_Load (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Sub Form_LostFocus()
On Error GoTo psForm_LostFocusErr 'EHCG.UID.psForm_LostFocus

Me.mchMain.Focus = False

Exit Sub
psForm_LostFocusErr:
Err.Raise Err.number, Err.Source, "ps.Form_LostFocus (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Sub Form_Resize()
On Error GoTo psForm_ResizeErr 'EHCG.UID.psForm_Resize

    With Me.lstItems
    .Left = 0
    .Top = Me.mchMain.Height
    .Width = Me.ScaleWidth - Me.ascBar.Width
    .Height = Me.ScaleHeight - Me.mcfMain.Height - Me.mchMain.Height
    End With

Exit Sub
psForm_ResizeErr:
Err.Raise Err.number, Err.Source, "ps.Form_Resize (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Sub PopulateList()
On Error GoTo sPopulateListErr 'EHCG.UID.sPopulateList

Dim lUser As User, Count As Long, uLItem As ListItem, uParm As String, uValid As Long
uParm = Me.txtUserFilter

Me.lstItems.ListItems.Clear

    For Count = 1 To Data.Users.Count
    Set lUser = Data.Users.Item(Count)

        If uParm <> "" Then
            If InStr(UCase(lUser.Alias), UCase(uParm)) <> 0 Or _
            InStr(UCase(CStr(lUser.Phone)), UCase(uParm)) <> 0 Or _
            InStr(UCase(lUser.Adress), UCase(uParm)) <> 0 Or _
            InStr(UCase(lUser.Name), UCase(uParm)) <> 0 Then
            Set uLItem = Me.lstItems.ListItems.Add
            Call Me.PopulateItem(uLItem, lUser)
            uValid = uValid + 1
            End If

        Else
        Set uLItem = Me.lstItems.ListItems.Add
        Call PopulateItem(uLItem, lUser)
        uValid = uValid + 1

        End If

    Next Count

ListViewAutoSize Me.lstItems
Me.chkAll.Value = 0

Exit Sub
sPopulateListErr:
Err.Raise Err.number, Err.Source, "s.PopulateList (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Sub PopulateItem(uLItem As ListItem, lUser As User)
On Error GoTo sPopulateItemErr 'EHCG.UID.sPopulateItem

Dim uAge As Byte

    If TypeName(uLItem) = "Nothing" Then
    Exit Sub
    End If

    uLItem.Tag = lUser.ID
    uLItem.Text = Format$(lUser.ID, "00000")
    uLItem.SubItems(1) = lUser.Alias
    uLItem.SubItems(2) = lUser.Name
    uAge = DateDiff("YYYY", CDate(lUser.Birth), Date)

        If DateSerial(Year(Now), Month(CDate(lUser.Birth)), Day(CDate(lUser.Birth))) > Now() Then uAge = uAge - 1

    uLItem.SubItems(3) = Format$(uAge, "0 Anos")
    uLItem.SubItems(4) = IIf(lUser.Banned, "Sim", "")
    uLItem.SubItems(5) = IIf(lUser.Credit <> 0, Format$(lUser.Credit, "0.00"), "")

        If lUser.Banned Then
        uLItem.ForeColor = 0
        uLItem.Ghosted = True
        uLItem.Bold = False
        uLItem.ListSubItems(1).ForeColor = 0
        uLItem.ListSubItems(2).ForeColor = 0
        uLItem.ListSubItems(3).ForeColor = 0
        uLItem.ListSubItems(4).ForeColor = 0
        uLItem.ListSubItems(5).ForeColor = 0
        End If

    If uAge < 18 Then
    uLItem.SmallIcon = 1
    Else
    uLItem.SmallIcon = 2
    End If

Exit Sub
sPopulateItemErr:
Err.Raise Err.number, Err.Source, "s.PopulateItem (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error GoTo psForm_UnloadErr 'EHCG.UID.psForm_Unload

Data.UserListLoaded = False

Exit Sub
psForm_UnloadErr:
Err.Raise Err.number, Err.Source, "ps.Form_Unload (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Sub lstItems_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
On Error GoTo pslstItems_ColumnClickErr 'EHCG.UID.pslstItems_ColumnClick

    With Me.lstItems
    .Sorted = True

        If (.SortKey = ColumnHeader.Index - 1) Then

            If .SortOrder <> lvwAscending Then
            .SortOrder = lvwAscending
            Else
            .SortOrder = lvwDescending
            End If

        Else
        .SortOrder = lvwAscending

        End If

    .SortKey = ColumnHeader.Index - 1
    End With

Exit Sub
pslstItems_ColumnClickErr:
Err.Raise Err.number, Err.Source, "ps.lstItems_ColumnClick (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Sub UpdateItem(ByVal uId As String)
On Error GoTo sUpdateItemErr 'EHCG.UID.sUpdateItem

Dim uItem As ListItem, lUser As User, uFound As Boolean, Count As Long
Dim uList1 As String, uList2 As String

restart:

    For Each uItem In Me.lstItems.ListItems

        If InStr(uId, uItem.Tag) <> 0 Then

            If TypeName(Data.Users.Item("N" & uItem.Tag)) = "Nothing" Then 'Excluido.
            uId = Replace(uId, uItem.Tag, "")
            Me.lstItems.ListItems.Remove (uItem.Index)
            GoTo restart

            Else
            Set lUser = Data.Users.Item("N" & uItem.Tag)
            uId = Replace(uId, uItem.Tag, "")
            Call PopulateItem(uItem, lUser)

            End If

        End If

    Next uItem

uList1 = uId

    Do
    uList2 = Replace(uList1, "||", "|")

        If uList2 = uList1 Then Exit Do

    Loop


    If Left$(uList1, 1) = "|" Then uList1 = Right$(uList1, Len(uList1) - 1)
    If Right$(uList1, 1) = "|" Then uList1 = Left$(uList1, Len(uList1) - 1)


    If uList1 <> "" Then 'Ainda existem itens: Provavelmente, novas adições. Vamos, então, criá-los.

    Count = 0

        Do
        uList2 = ParseDataBlock(uList1, Count, "|")

            If uList2 = "" Then Exit Do

        Set uItem = Me.lstItems.ListItems.Add
        uItem.Tag = uList2

        Count = Count + 1

        Loop

    GoTo restart

    End If

Exit Sub
sUpdateItemErr:
Err.Raise Err.number, Err.Source, "s.UpdateItem (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Sub lstItems_ItemClick(ByVal Item As MSComctlLib.ListItem)
On Error GoTo pslstItems_ItemClickErr 'EHCG.UID.pslstItems_ItemClick

Me.chkAll.Value = 0
LoadItemData (Item.Tag)

Exit Sub
pslstItems_ItemClickErr:
Err.Raise Err.number, Err.Source, "ps.lstItems_ItemClick (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Sub lstItems_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo pslstItems_KeyDownErr 'EHCG.UID.pslstItems_KeyDown

    Select Case KeyCode
    Case 46 'exclusão.
    Call DeleteSelected

    Case 45
    Call LoadItemData(0)
    Me.txtData(0).SetFocus

    End Select

Exit Sub
pslstItems_KeyDownErr:
Err.Raise Err.number, Err.Source, "ps.lstItems_KeyDown (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Function GetSelectedList() As String
On Error GoTo pfGetSelectedListErr 'EHCG.UID.pfGetSelectedList

Dim uTmp As String, uItem As ListItem

    For Each uItem In Me.lstItems.ListItems

        If uItem.Selected Then
        uTmp = uTmp & IIf(uTmp <> "", "|", "") & _
        uItem.Tag
        End If

    Next uItem

GetSelectedList = uTmp

Exit Function
pfGetSelectedListErr:
Err.Raise Err.number, Err.Source, "pf.GetSelectedList (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Function
Sub DeleteSelected()
On Error GoTo sDeleteSelectedErr 'EHCG.UID.sDeleteSelected

Dim uList As String, uItem As String, uCounter As Long

uList = GetSelectedList

If uList = "" Then Exit Sub

    Do
    uItem = ParseDataBlock(uList, uCounter, "|")

        If uItem = "" Then Exit Do

    Data.Users.Remove uItem
    uCounter = uCounter + 1
    Loop

UpdateItem uList
MDIMain.PopulateUserList
LoadItemData (0)

Status "A exclusão ocorreu com sucesso!", uSTSuccess

Exit Sub
sDeleteSelectedErr:
Status Err.Description, uSTError

End Sub
Private Sub lstItems_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
On Error GoTo pslstItems_MouseDownErr 'EHCG.UID.pslstItems_MouseDown

Me.chkAll.Value = 0

    If TypeName(lstItems.HitTest(x, y)) <> "Nothing" Then
    DragList Me.lstItems, x, y
    LoadItemData lstItems.HitTest(x, y).Tag
    End If

Exit Sub
pslstItems_MouseDownErr:
Err.Raise Err.number, Err.Source, "ps.lstItems_MouseDown (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Sub lstVerbs0_Click(Index As Integer)
On Error GoTo pslstVerbs0_ClickErr 'EHCG.UID.pslstVerbs0_Click

Dim Counter As Long, uItem As Long, ID As String

    For Counter = 0 To Me.lstVerbs0(Index).ListCount - 1

        If Me.lstVerbs0(Index).Selected(Counter) Then
        Me.lstVerbs0(Index).Selected(Counter) = False
        uItem = Counter
        Counter = Me.lstVerbs0(Index).ListCount - 1
        End If

    Next Counter

ID = Index & "." & uItem

    Select Case ID

    Case "0.0" 'Cadastro.Incluir
    LoadItemData (0)

    Case "0.1" 'Cadastro.Excluir
    DeleteSelected

    End Select

Exit Sub
pslstVerbs0_ClickErr:
Err.Raise Err.number, Err.Source, "ps.lstVerbs0_Click (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Sub GenericSend(ByVal uParm As String)
On Error GoTo sGenericSendErr 'EHCG.UID.sGenericSend

Dim uList As String, uCounter As Long, uItem As String

    If chkAll.Value = 1 Then
    SendBroadcast uParm

    Else
    uList = GetSelectedList

        If uList = "" Then Exit Sub

        Do
        uItem = ParseDataBlock(uList, uCounter, "|")

            If uItem = "" Then Exit Do

        Send GetIP(uItem), uParm
        uCounter = uCounter + 1
        Loop

    End If

Exit Sub
sGenericSendErr:
Err.Raise Err.number, Err.Source, "s.GenericSend (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Private Sub txtUserFilter_KeyPress(KeyAscii As Integer)
On Error GoTo pstxtUserFilter_KeyPressErr 'EHCG.UID.pstxtUserFilter_KeyPress

    If KeyAscii = 13 Then
    Call Me.PopulateList
    End If

Exit Sub
pstxtUserFilter_KeyPressErr:
Err.Raise Err.number, Err.Source, "ps.txtUserFilter_KeyPress (" & Err.number & ": " & Err.Description & ")", Err.HelpFile, Err.HelpContext

End Sub
Sub LoadItemData(ByVal Index As Long)
On Error Resume Next

Dim uTmpUser As New User

    If TypeName(Data.Users.Item("N" & Index)) <> "Nothing" Then
    Set uTmpUser = Data.Users.Item("N" & Index)
    Me.Tag = Index
    Me.txtData(0) = uTmpUser.Name
    Me.txtData(1) = uTmpUser.Alias
    Me.txtData(2) = uTmpUser.Adress
    Me.txtData(3) = uTmpUser.Email
    Me.txtData(4) = uTmpUser.Phone
    Me.txtData(5) = IIf(uTmpUser.Icq <> 0, uTmpUser.Icq, "")
    Me.txtData(6) = IIf(Year(uTmpUser.Birth) <> 1899, uTmpUser.Birth, "")
    Me.txtData(7) = IIf(uTmpUser.Credit <> 0, uTmpUser.Credit, "")
    Me.optLevel(uTmpUser.User_class.ID) = 1
    Me.chkBanned = uTmpUser.Banned * -1

    Else
    Me.Tag = ""
    Me.txtData(0) = ""
    Me.txtData(1) = ""
    Me.txtData(2) = ""
    Me.txtData(3) = ""
    Me.txtData(4) = ""
    Me.txtData(5) = ""
    Me.txtData(6) = ""
    Me.txtData(7) = ""
    Me.optLevel(2) = 1
    Me.chkBanned = 0

    End If

Exit Sub
sLoadUserDataErr:
Err.Raise Err.number, Err.Source, "s.LoadUserData:" & vbCrLf & "Error: " & Err.number & vbCrLf & "Description: " & Err.Description & vbCrLf, Err.HelpFile, Err.HelpContext

End Sub

