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

📄 frmuser.frm

📁 OA编程 源代码
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmUser 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00E0E0E0&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "用户属性"
   ClientHeight    =   5580
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6060
   Icon            =   "frmUser.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5580
   ScaleWidth      =   6060
   StartUpPosition =   2  'CenterScreen
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   2  'Align Bottom
      Height          =   570
      Left            =   0
      TabIndex        =   18
      Top             =   5010
      Width           =   6060
      _ExtentX        =   10689
      _ExtentY        =   1005
      ButtonWidth     =   2090
      ButtonHeight    =   1005
      Style           =   1
      TextAlignment   =   1
      ImageList       =   "ImgList"
      DisabledImageList=   "ImgList"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   4
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "权限组"
            Key             =   "CmdGroup"
            ImageIndex      =   8
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "确  定"
            Key             =   "CmdOK"
            ImageIndex      =   5
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "取  消"
            Key             =   "CmdCancel"
            ImageIndex      =   7
         EndProperty
      EndProperty
   End
   Begin VB.Frame Frame2 
      BackColor       =   &H00E0E0E0&
      Caption         =   "附加信息"
      Height          =   1635
      Left            =   0
      TabIndex        =   13
      Top             =   3375
      Width           =   6045
      Begin VB.TextBox Txtyhsf 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   1530
         TabIndex        =   17
         Top             =   840
         Width           =   4155
      End
      Begin VB.TextBox TxtQzmm 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   1530
         TabIndex        =   16
         Top             =   330
         Width           =   4185
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "签字密码:"
         Height          =   180
         Index           =   2
         Left            =   600
         TabIndex        =   15
         Top             =   420
         Width           =   810
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "用户身份:"
         Height          =   180
         Index           =   1
         Left            =   600
         TabIndex        =   14
         Top             =   960
         Width           =   810
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00E0E0E0&
      Caption         =   "基本信息"
      Height          =   3285
      Left            =   0
      TabIndex        =   0
      Top             =   15
      Width           =   6045
      Begin VB.TextBox Text2 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   1530
         TabIndex        =   5
         Top             =   1260
         Width           =   4215
      End
      Begin VB.TextBox Text4 
         Appearance      =   0  'Flat
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   1530
         PasswordChar    =   "*"
         TabIndex        =   4
         Top             =   2190
         Width           =   4215
      End
      Begin VB.TextBox Text3 
         Appearance      =   0  'Flat
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   1530
         PasswordChar    =   "*"
         TabIndex        =   3
         Top             =   1710
         Width           =   4215
      End
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   1530
         TabIndex        =   2
         Top             =   810
         Width           =   4215
      End
      Begin VB.TextBox Text5 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   1530
         TabIndex        =   1
         Top             =   2730
         Width           =   4215
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "确认密码:"
         Height          =   180
         Left            =   660
         TabIndex        =   12
         Top             =   2340
         Width           =   810
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "密码:"
         Height          =   180
         Left            =   1020
         TabIndex        =   11
         Top             =   1860
         Width           =   450
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "用户名(中文):"
         Height          =   180
         Left            =   300
         TabIndex        =   10
         Top             =   1380
         Width           =   1170
      End
      Begin VB.Label label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "部门:"
         Height          =   180
         Left            =   1020
         TabIndex        =   9
         Top             =   900
         Width           =   450
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "用户名(英文):"
         Height          =   180
         Left            =   300
         TabIndex        =   8
         Top             =   420
         Width           =   1170
      End
      Begin VB.Label lblName 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   1680
         TabIndex        =   7
         Top             =   360
         Width           =   120
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "内线电话:"
         Height          =   180
         Index           =   0
         Left            =   660
         TabIndex        =   6
         Top             =   2820
         Width           =   810
      End
   End
   Begin MSComctlLib.ImageList ImgList 
      Left            =   0
      Top             =   0
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   32
      ImageHeight     =   32
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   10
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUser.frx":0E42
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUser.frx":171C
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUser.frx":1A36
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUser.frx":2310
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUser.frx":2BEA
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUser.frx":38C4
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUser.frx":4716
            Key             =   ""
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUser.frx":4A30
            Key             =   ""
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUser.frx":530A
            Key             =   ""
         EndProperty
         BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmUser.frx":5FE4
            Key             =   ""
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit



Private Sub CmdOk_Click()
    On Error GoTo err
    Dim str As String
    Dim Pcry As Object
    Dim Mstr As String
    Dim tempPsw As String
    
     '判断输入的数据是否正确
    If Trim(Text1.Text) = "" Then
        MsgBox "部门不能为空!", 48, "用户管理器"
        Exit Sub
    ElseIf Trim(Text2.Text) = "" Then
        MsgBox "用户名不能为空!", 48, "用户管理器"
        Exit Sub
    End If
    
    If lstrlen(Trim(Text1.Text)) > 50 Then
        MsgBox "部门最多只能输入25个汉字!", 48, "用户管理器"
        Exit Sub
    End If
    
    If lstrlen(Trim(Text2.Text)) > 50 Then
        MsgBox "用户名最多只能输入25个汉字!", 48, "用户管理器"
        Exit Sub
    End If
    
    If lstrlen(Trim(Text3.Text)) > 50 Then
        MsgBox "用户密码最多只能输入50个字符!", 48, "用户管理器"
        Exit Sub
    End If
    
    If Trim(Text3.Text) <> Trim(Text4.Text) Then
        MsgBox "新密码未被正确确认,请确保[确认密码]与[新密码]完全相同!", 48, "用户管理器"
        Exit Sub
    End If
    
    If Trim(TxtQzmm.Text) = "" Or Trim(Txtyhsf.Text) = "" Then
        MsgBox "签字密码或用户身份不能为空!"
        Exit Sub
    End If
    
    tempPsw = Trim(Text3.Text)
    If tempPsw = "" Then
    str = "update groupuser set deparment_c='" & Trim(Text1.Text) & "',username_c='"
    str = str & Trim(Text2.Text) & "',password='',tagpsw='" & TxtQzmm.Text & "',field1='" & Txtyhsf.Text & "',phoneNo='"
    str = str & Trim(Text5.Text) & "' where username='" & Trim(lblName.Caption) & "'"
    Pubsaconn.Execute str, 64
    
    Else
    Set Pcry = CreateObject("Crypt.clsCrypt")
    Mstr = Pcry.Encode(tempPsw)
    str = "update groupuser set deparment_c='" & Trim(Text1.Text) & "',username_c='"
    str = str & Trim(Text2.Text) & "',password='" & Mstr & "',tagpsw='" & TxtQzmm.Text & "',field1='" & Txtyhsf.Text & "',phoneNo='"
    str = str & Trim(Text5.Text) & "' where username='" & Trim(lblName.Caption) & "'"
    Pubsaconn.Execute str, 64
    Set Pcry = Nothing
    End If
    
    Unload Me
Exit Sub
err:
MsgBox err.Description, 64
Unload Me
End Sub

Private Sub Form_Load()
Dim str As String
On Error Resume Next
    lblName.Caption = frmUserMain.GrdUser.TextMatrix(frmUserMain.GrdUser.RowSel, 0)
    str = "select distinct username,deparment_c,username_c,password,phoneNo,tagpsw,field1 from groupuser where username='" & Trim(frmUserMain.GrdUser.TextMatrix(frmUserMain.GrdUser.RowSel, 0)) & "'"
    Set RstUser = Pubsaconn.Execute(str)
    Text1.Text = Trim(RstUser("deparment_c"))
    Text2.Text = Trim(RstUser("username_c"))
    Text3.Text = Trim(RstUser("password"))
    Text4.Text = Trim(RstUser("password"))
    Text5.Text = Trim(RstUser("phoneNo"))
    TxtQzmm.Text = Trim(RstUser("tagpsw"))
    Txtyhsf.Text = Trim(RstUser("field1"))
        '换皮肤
    Call LoadSkin(Me)
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
    Select Case Button.Key
    Case "CmdGroup"
        frmGroup.Show 1
    Case "CmdOK"
        Call CmdOk_Click
    Case "CmdCancel"
        Unload Me
    End Select
End Sub

⌨️ 快捷键说明

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