⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main_mima.frm

📁 一个比较完整的数据库编程技巧”洗浴管理系统“
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomctl.ocx"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form main_mima 
   BackColor       =   &H00C0C0C0&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "洗浴管理系统  版本:V1.00"
   ClientHeight    =   3855
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6150
   Icon            =   "main_mima.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3855
   ScaleWidth      =   6150
   StartUpPosition =   2  '屏幕中心
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   5355
      Top             =   15
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   32
      ImageHeight     =   32
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   2
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "main_mima.frx":000C
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "main_mima.frx":08E8
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   4380
      Top             =   2550
      Visible         =   0   'False
      Width           =   1530
      _ExtentX        =   2699
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=XYGLXT"
      OLEDBString     =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=XYGLXT"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from 权限信息表"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSComctlLib.ListView ListView1 
      Height          =   2520
      Left            =   150
      TabIndex        =   8
      Top             =   420
      Width           =   5835
      _ExtentX        =   10292
      _ExtentY        =   4445
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      _Version        =   393217
      Icons           =   "ImageList1"
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   0
   End
   Begin VB.Frame Frame2 
      Height          =   45
      Left            =   150
      TabIndex        =   7
      Top             =   375
      Width           =   5880
   End
   Begin VB.CommandButton Comend 
      BackColor       =   &H00C0C0C0&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   400
      Left            =   4635
      Picture         =   "main_mima.frx":11C4
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   3375
      Width           =   1350
   End
   Begin VB.CommandButton Comyes 
      BackColor       =   &H00C0C0C0&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   400
      Left            =   3285
      MaskColor       =   &H00FF8080&
      Picture         =   "main_mima.frx":2B7E
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   3375
      UseMaskColor    =   -1  'True
      Width           =   1350
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H00FFFF00&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      IMEMode         =   3  'DISABLE
      Left            =   915
      MaxLength       =   6
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   3435
      Width           =   1965
   End
   Begin VB.Label czy 
      BackStyle       =   0  'Transparent
      Caption         =   "CZY"
      Height          =   195
      Left            =   900
      TabIndex        =   9
      Top             =   3075
      Width           =   2040
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "洗浴管理系统"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   390
      Left            =   3330
      TabIndex        =   6
      Top             =   15
      Width           =   1980
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "在下面选择用来登录的身份:"
      Height          =   420
      Left            =   180
      TabIndex        =   5
      Top             =   90
      Width           =   2955
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "密  码:         "
      Height          =   300
      Left            =   195
      TabIndex        =   4
      Top             =   3495
      Width           =   855
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "操作员:                    "
      Height          =   195
      Left            =   210
      TabIndex        =   3
      Top             =   3060
      Width           =   3690
   End
End
Attribute VB_Name = "main_mima"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim itmX As ListItem     '定义一个ListItem对象
Dim TIM, a As Integer     '定义整型变量
Dim myval, key, list As String     '定义字符串变量
Private Sub Form_Activate()
  '设置窗体标题栏内容
'  Me.Caption = App.Title & "  " & App.Major & "." & App.Minor & "." & App.Revision
  '查询权限信息
  Adodc1.RecordSource = "select * from 权限信息表 "
  Adodc1.Refresh
  If Adodc1.Recordset.RecordCount = 0 Then     '当记录为零时
     MsgBox ("您还没有设置操作员密码和权限,请设置操作员密码和权限!")
     '调入frm_main主窗体
     Load frm_main
     frm_main.Show
     Unload Me
  Else
     ListView1.SetFocus     'ListView1获得焦点
     Adodc1.Recordset.MoveFirst     '移到第一条记录
     czy.Caption = Trim(Adodc1.Recordset.Fields("操作员名称"))     '赋值给czy.caption
     Do While Adodc1.Recordset.EOF = False
     key = Trim(Adodc1.Recordset.Fields("操作员名称"))     '赋值给key变量
     Set itmX = ListView1.ListItems.Add(, , key, 1)
     Adodc1.Recordset.MoveNext     '移到下一条记录
     Loop
  End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
 frm_main.Enabled = True     '设置frm_main有效
End Sub
Private Sub ListView1_Click()
 If ListView1.ListItems.Count > 0 Then     '当ListItems对象的集合大于零时
  list = ListView1.SelectedItem     '赋值给list变量
  '按操作员名称查询权限信息
  Adodc1.RecordSource = "select * from 权限信息表 where 操作员名称='" + list + "'"
  Adodc1.Refresh
  If Adodc1.Recordset.RecordCount > 0 Then     '当记录大于零时
   czy.Caption = Trim(Adodc1.Recordset.Fields("操作员名称"))     '赋值给czy.caption
  End If
 End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = vbKeyReturn Then Comyes.SetFocus     '按回车键comyes获得焦点
End Sub
Private Sub comyes_Click()
 Dim MESSAGE As String     '定义一个字符串变量
 '按操作员名称查询权限信息
 Adodc1.RecordSource = "select * from 权限信息表 where 操作员名称 = '" + Trim(czy.Caption) + "'"
 Adodc1.Refresh
 '假如czy.caption不等于空并且text1.text等于数据库中的密码,那么
 If czy.Caption <> "" And Text1.Text = Trim(Adodc1.Recordset.Fields("密码")) Then
  '设置操作员权限
  If Adodc1.Recordset.Fields("基本信息管理") = 0 Then frm_main.jbxxgl.Enabled = True Else frm_main.jbxxgl.Enabled = False
  If Adodc1.Recordset.Fields("前台信息管理") = 0 Then
     frm_main.qtxxgl.Enabled = True
     frm_main.Toolbar1.Buttons(1).Enabled = True
     frm_main.Toolbar1.Buttons(3).Enabled = True
     frm_main.Toolbar1.Buttons(5).Enabled = True
    Else
     frm_main.qtxxgl.Enabled = False
     frm_main.Toolbar1.Buttons(1).Enabled = False
     frm_main.Toolbar1.Buttons(3).Enabled = False
     frm_main.Toolbar1.Buttons(5).Enabled = False
  End If
  If Adodc1.Recordset.Fields("后台信息管理") = 0 Then
     frm_main.htxxgl.Enabled = True
     frm_main.Toolbar1.Buttons(7).Enabled = True
    Else
     frm_main.htxxgl.Enabled = False
     frm_main.Toolbar1.Buttons(7).Enabled = False
  End If
  If Adodc1.Recordset.Fields("经理查询系统") = 0 Then
     frm_main.jlcxxt.Enabled = True
     frm_main.Toolbar1.Buttons(9).Enabled = True
     frm_main.Toolbar1.Buttons(11).Enabled = True
    Else
     frm_main.jlcxxt.Enabled = False
     frm_main.Toolbar1.Buttons(9).Enabled = False
     frm_main.Toolbar1.Buttons(11).Enabled = False
  End If
  If Adodc1.Recordset.Fields("系统维护") = 0 Then
     frm_main.xtwh.Enabled = True
     frm_main.Toolbar1.Buttons(13).Enabled = True
    Else
     frm_main.xtwh.Enabled = False
     frm_main.Toolbar1.Buttons(13).Enabled = False
  End If
  '调入frm_main主窗体
  Load frm_main
  frm_main.Show
  frm_main.St1.Panels(3).Text = czy.Caption     '赋值给frm_main.St1.Panels(3).Text
  Unload Me
 Else
  '输入三次错误的密码,系统自动退出
  If TIM = 3 Then
   MESSAGE = MsgBox("密码输入错误,请向系统管理员查询!", 0, "系统提示")
   If MESSAGE = vbOK Then End
  End If
  If czy.Caption = "" Then
    MsgBox "请选择操作员!", , "系统提示"
    ListView1.SetFocus     'ListView1获得焦点
   Else
    If Text1.Text <> Adodc1.Recordset.Fields("密码") Then
     MsgBox "密码错误,请重新输入密码!", , "系统提示"
     TIM = TIM + 1     '记录输入次数
     Text1.SetFocus    'text1获得焦点
    End If
  End If
 End If
End Sub
Private Sub comend_Click()
  End
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -