Form1.frm
上传用户:linhua1013
上传日期:2014-12-05
资源大小:375k
文件大小:19k
源码类别:

SQL Server

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form GongZuoXinXi 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   5460
  5.    ClientLeft      =   60
  6.    ClientTop       =   450
  7.    ClientWidth     =   5835
  8.    LinkTopic       =   "Form1"
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    ScaleHeight     =   5460
  12.    ScaleWidth      =   5835
  13.    Begin VB.CommandButton QuXiao_GZ 
  14.       Caption         =   "取  消"
  15.       Height          =   375
  16.       Left            =   3720
  17.       TabIndex        =   23
  18.       Top             =   4920
  19.       Width           =   975
  20.    End
  21.    Begin VB.CommandButton QueDing_GZ 
  22.       Caption         =   "添  加"
  23.       Height          =   375
  24.       Left            =   1200
  25.       TabIndex        =   22
  26.       Top             =   4920
  27.       Width           =   975
  28.    End
  29.    Begin VB.PictureBox Picture1 
  30.       Height          =   4695
  31.       Left            =   120
  32.       ScaleHeight     =   4635
  33.       ScaleWidth      =   5535
  34.       TabIndex        =   5
  35.       Top             =   120
  36.       Width           =   5600
  37.       Begin VB.PictureBox Picture2 
  38.          Height          =   2895
  39.          Left            =   120
  40.          ScaleHeight     =   2835
  41.          ScaleWidth      =   5235
  42.          TabIndex        =   7
  43.          Top             =   1320
  44.          Width           =   5295
  45.          Begin VB.Frame Frame2 
  46.             Caption         =   "工作信息"
  47.             Height          =   2655
  48.             Left            =   120
  49.             TabIndex        =   8
  50.             Top             =   120
  51.             Width           =   5000
  52.             Begin VB.TextBox Text_GZ 
  53.                Height          =   975
  54.                Index           =   4
  55.                Left            =   240
  56.                ScrollBars      =   2  'Vertical
  57.                TabIndex        =   21
  58.                Top             =   1560
  59.                Width           =   4455
  60.             End
  61.             Begin VB.ComboBox textNian_GZ 
  62.                Height          =   300
  63.                ItemData        =   "Form1.frx":0000
  64.                Left            =   1080
  65.                List            =   "Form1.frx":0002
  66.                TabIndex        =   16
  67.                Text            =   "1990"
  68.                Top             =   720
  69.                Width           =   975
  70.             End
  71.             Begin VB.ComboBox textYue_GZ 
  72.                Height          =   300
  73.                Left            =   2400
  74.                TabIndex        =   15
  75.                Text            =   "1"
  76.                Top             =   720
  77.                Width           =   735
  78.             End
  79.             Begin VB.ComboBox textRi_GZ 
  80.                Height          =   300
  81.                Left            =   3480
  82.                TabIndex        =   14
  83.                Text            =   "1"
  84.                Top             =   720
  85.                Width           =   735
  86.             End
  87.             Begin VB.TextBox Text_GZ 
  88.                Height          =   270
  89.                Index           =   2
  90.                Left            =   3600
  91.                TabIndex        =   12
  92.                Top             =   360
  93.                Width           =   1095
  94.             End
  95.             Begin VB.TextBox Text_GZ 
  96.                Height          =   270
  97.                Index           =   1
  98.                Left            =   1080
  99.                TabIndex        =   10
  100.                Top             =   330
  101.                Width           =   1095
  102.             End
  103.             Begin VB.Label Label15 
  104.                AutoSize        =   -1  'True
  105.                Caption         =   "*"
  106.                ForeColor       =   &H008080FF&
  107.                Height          =   180
  108.                Left            =   4800
  109.                TabIndex        =   33
  110.                Top             =   360
  111.                Width           =   90
  112.             End
  113.             Begin VB.Label Label11 
  114.                AutoSize        =   -1  'True
  115.                Caption         =   "*"
  116.                ForeColor       =   &H008080FF&
  117.                Height          =   180
  118.                Left            =   4680
  119.                TabIndex        =   29
  120.                Top             =   765
  121.                Width           =   90
  122.             End
  123.             Begin VB.Label Label9 
  124.                AutoSize        =   -1  'True
  125.                Caption         =   "*"
  126.                ForeColor       =   &H008080FF&
  127.                Height          =   180
  128.                Left            =   2280
  129.                TabIndex        =   28
  130.                Top             =   360
  131.                Width           =   90
  132.             End
  133.             Begin VB.Label Label8 
  134.                AutoSize        =   -1  'True
  135.                Caption         =   "工作评价:"
  136.                Height          =   180
  137.                Left            =   120
  138.                TabIndex        =   20
  139.                Top             =   1320
  140.                Width           =   900
  141.             End
  142.             Begin VB.Label Label16 
  143.                AutoSize        =   -1  'True
  144.                Caption         =   "年"
  145.                Height          =   180
  146.                Left            =   2160
  147.                TabIndex        =   19
  148.                Top             =   780
  149.                Width           =   180
  150.             End
  151.             Begin VB.Label Label17 
  152.                AutoSize        =   -1  'True
  153.                Caption         =   "月"
  154.                Height          =   180
  155.                Left            =   3240
  156.                TabIndex        =   18
  157.                Top             =   765
  158.                Width           =   180
  159.             End
  160.             Begin VB.Label Label20 
  161.                AutoSize        =   -1  'True
  162.                Caption         =   "日"
  163.                Height          =   180
  164.                Left            =   4320
  165.                TabIndex        =   17
  166.                Top             =   765
  167.                Width           =   180
  168.             End
  169.             Begin VB.Label Label7 
  170.                AutoSize        =   -1  'True
  171.                Caption         =   "工作时间:"
  172.                Height          =   180
  173.                Left            =   120
  174.                TabIndex        =   13
  175.                Top             =   840
  176.                Width           =   900
  177.             End
  178.             Begin VB.Label Label6 
  179.                AutoSize        =   -1  'True
  180.                Caption         =   "工作职位:"
  181.                Height          =   180
  182.                Left            =   2640
  183.                TabIndex        =   11
  184.                Top             =   390
  185.                Width           =   900
  186.             End
  187.             Begin VB.Label Label5 
  188.                AutoSize        =   -1  'True
  189.                Caption         =   "工作部门:"
  190.                Height          =   180
  191.                Left            =   120
  192.                TabIndex        =   9
  193.                Top             =   360
  194.                Width           =   900
  195.             End
  196.          End
  197.       End
  198.       Begin VB.Frame Frame1 
  199.          Caption         =   "基本信息"
  200.          Height          =   1095
  201.          Left            =   120
  202.          TabIndex        =   4
  203.          Top             =   120
  204.          Width           =   5295
  205.          Begin VB.TextBox ChuSheng_GZ 
  206.             BackColor       =   &H80000011&
  207.             Enabled         =   0   'False
  208.             Height          =   270
  209.             Left            =   3480
  210.             TabIndex        =   27
  211.             Top             =   600
  212.             Width           =   1695
  213.          End
  214.          Begin VB.TextBox XingBie_GZ 
  215.             BackColor       =   &H80000011&
  216.             Enabled         =   0   'False
  217.             Height          =   270
  218.             Left            =   1200
  219.             TabIndex        =   25
  220.             Top             =   600
  221.             Width           =   735
  222.          End
  223.          Begin VB.ComboBox YGbianhao_GZ 
  224.             Height          =   300
  225.             Left            =   1200
  226.             TabIndex        =   3
  227.             Top             =   200
  228.             Width           =   1455
  229.          End
  230.          Begin VB.TextBox XingMing_GZ 
  231.             BackColor       =   &H80000011&
  232.             Enabled         =   0   'False
  233.             Height          =   270
  234.             Left            =   4080
  235.             TabIndex        =   2
  236.             Top             =   200
  237.             Width           =   1095
  238.          End
  239.          Begin VB.Label Label4 
  240.             AutoSize        =   -1  'True
  241.             Caption         =   "出生年月:"
  242.             Height          =   180
  243.             Left            =   2400
  244.             TabIndex        =   26
  245.             Top             =   640
  246.             Width           =   900
  247.          End
  248.          Begin VB.Label Label10 
  249.             AutoSize        =   -1  'True
  250.             Caption         =   "*"
  251.             ForeColor       =   &H008080FF&
  252.             Height          =   180
  253.             Left            =   2760
  254.             TabIndex        =   24
  255.             Top             =   240
  256.             Width           =   90
  257.          End
  258.          Begin VB.Label Label3 
  259.             AutoSize        =   -1  'True
  260.             Caption         =   "性别:"
  261.             Height          =   180
  262.             Left            =   480
  263.             TabIndex        =   6
  264.             Top             =   640
  265.             Width           =   540
  266.          End
  267.          Begin VB.Label Label2 
  268.             AutoSize        =   -1  'True
  269.             Caption         =   "员工姓名:"
  270.             Height          =   180
  271.             Left            =   3120
  272.             TabIndex        =   0
  273.             Top             =   240
  274.             Width           =   900
  275.          End
  276.          Begin VB.Label Label1 
  277.             AutoSize        =   -1  'True
  278.             Caption         =   "员工编号:"
  279.             Height          =   180
  280.             Left            =   120
  281.             TabIndex        =   1
  282.             Top             =   240
  283.             Width           =   900
  284.          End
  285.       End
  286.       Begin VB.Label Label14 
  287.          AutoSize        =   -1  'True
  288.          Caption         =   "!相应的个人信息可以到员工基本信息处修改!"
  289.          Height          =   180
  290.          Left            =   240
  291.          TabIndex        =   32
  292.          Top             =   4320
  293.          Width           =   3780
  294.       End
  295.       Begin VB.Label Label13 
  296.          AutoSize        =   -1  'True
  297.          Caption         =   "为必填项"
  298.          Height          =   180
  299.          Left            =   4560
  300.          TabIndex        =   31
  301.          Top             =   4320
  302.          Width           =   720
  303.       End
  304.       Begin VB.Label Label12 
  305.          AutoSize        =   -1  'True
  306.          Caption         =   "*"
  307.          ForeColor       =   &H008080FF&
  308.          Height          =   180
  309.          Left            =   4320
  310.          TabIndex        =   30
  311.          Top             =   4320
  312.          Width           =   90
  313.       End
  314.    End
  315. End
  316. Attribute VB_Name = "GongZuoXinXi"
  317. Attribute VB_GlobalNameSpace = False
  318. Attribute VB_Creatable = False
  319. Attribute VB_PredeclaredId = True
  320. Attribute VB_Exposed = False
  321. Dim NianShu_GZ As Integer
  322. Dim YueShu_GZ As Integer
  323. Dim RiShu_GZ As Integer
  324. Dim LieShu_GZ As Integer
  325. 'Dim ShJzancun_GZ As String
  326. 'Dim ShJquzhi_GZ As Integer
  327. Dim QDShu As Integer
  328. Private Sub Form_Load()
  329.   Me.Height = 5970
  330.   Me.Width = 5940
  331.   NianShu_GZ = 1980
  332.   Do While NianShu_GZ < 2006
  333.      textNian_GZ.AddItem NianShu_GZ
  334.      NianShu_GZ = NianShu_GZ + 1
  335.   Loop
  336.   For YueShu_GZ = 1 To 12
  337.       textYue_GZ.AddItem YueShu_GZ
  338.   Next YueShu_GZ
  339.   For RiShu_GZ = 1 To 31
  340.       textRi_GZ.AddItem RiShu_GZ
  341.   Next RiShu_GZ
  342.   If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
  343.   GZbiaoCZ.CursorLocation = adUseClient
  344.   GZbiaoCZ.Open "select * from manappraise", MySQL, adOpenKeyset, adLockPessimistic
  345.   Do While Not GZbiaoCZ.EOF
  346.     YGbianhao_GZ.AddItem GZbiaoCZ.Fields(0)
  347.     GZbiaoCZ.MoveNext
  348.   Loop
  349.   GZbiaoCZ.MoveFirst
  350.   If ChakanGZ_PD Then
  351. '     BianHaoFuZhi (GZbiaoCZ)
  352.      GongZuoXinXi.Caption = "查看员工工作信息"
  353.      QueDing_GZ.Visible = False
  354.      QuXiao_GZ.Left = 2400
  355.      textFuZhi_GZ
  356.   ElseIf XiuGaiGZ_PD Then
  357. '     BianHaoFuZhi (GZbiaoCZ)
  358.      GongZuoXinXi.Caption = "修改员工工作信息"
  359.      QueDing_GZ.Caption = "修  改"
  360.      textFuZhi_GZ
  361.   ElseIf ShanChuGZ_PD Then
  362.      GongZuoXinXi.Caption = "删除员工工作信息"
  363.      QueDing_GZ.Caption = "删  除"
  364.      textFuZhi_GZ
  365.   ElseIf TianJiaGZ_PD Then
  366.      If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
  367.      ChaKanJB.Open "select ygid,ygname,ygsex from manrecord", MySQL, adOpenKeyset, adLockPessimistic
  368. '     BianHaoFuZhi (ChaKanJB)
  369.      YGbianhao_GZ.Clear
  370.      Do While Not ChaKanJB.EOF
  371.        YGbianhao_GZ.AddItem ChaKanJB.Fields(0)
  372.        ChaKanJB.MoveNext
  373.      Loop
  374.      ChaKanJB.MoveFirst
  375.      GongZuoXinXi.Caption = "添加员工工作信息"
  376.      QueDing_GZ.Caption = "添  加"
  377.      
  378.   End If
  379. End Sub
  380. Sub textFuZhi_GZ()
  381.   For LieShu_GZ = 1 To 4
  382.     If LieShu_GZ = 3 Then
  383.     Else
  384.       If GZbiaoCZ.Fields(LieShu_GZ) <> "" Then
  385.         Text_GZ(LieShu_GZ) = GZbiaoCZ.Fields(LieShu_GZ)
  386.       Else
  387.         Text_GZ(LieShu_GZ) = ""
  388.       End If
  389.     End If
  390.   Next LieShu_GZ
  391.   YGbianhao_GZ.Text = GZbiaoCZ.Fields(0)
  392.   JiBen_GZ (Trim(YGbianhao_GZ))
  393. '  Xingie_GZ.Text = GZbiaoCZ.Fields(2)
  394.   RiQiFuZhi (GZbiaoCZ.Fields(3))
  395.   textNian_GZ.Text = Nian
  396.   textYue_GZ.Text = Yue
  397.   RiFuZhi
  398.   textRi_GZ.Text = Ri
  399. End Sub
  400. Private Sub Form_Unload(Cancel As Integer)
  401.   Set ChaKanJB = Nothing
  402.   Set GZbiaoCZ = Nothing
  403. End Sub
  404. Private Sub QueDing_GZ_Click()
  405.   If QueDing_GZ.Caption = "修  改" Then
  406.     QDShu = MsgBox("确定修改相关项吗?", 51, "公司员工管理系统")
  407.     If QDShu = 6 Then
  408.        If Text_GZ(1) = "" Or Text_GZ(2) = "" Or textNian_GZ.Text = "" Or textYue_GZ.Text = "" Or textRi_GZ.Text = "" Then
  409.          MsgBox "红星号项目不能为空!", 48, "公司员工管理系统"
  410. '      If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
  411. '      ChaKanJB.Open "SELECT ygid,ygname,ygsex from manrecord where ygid='" & YGbianhao_GZ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
  412. '      If ChaKanJB.RecordCount = -1 Then
  413. '         MsgBox "不存在此编号的员工基本信息!请先添加相关的基本信息!", 48, "公司员工管理系统"
  414. '         ChaKanJB.Close
  415. '         Set ChaKanJB = Nothing
  416. '         Exit Sub
  417.        Else
  418. '         If Text_GZ(1) <> ChaKanJB.Fields(1) Or XingBie_GZ.Text <> ChaKanJB.Fields(2) Or Text_GZ(3) <> ChaKanJB.Fields(3) Then
  419. '           MsgBox "员工的基本信息与原始基本信息不符!", 48, "公司员工管理系统"
  420. '         Else
  421.            ShuJuFuZhi
  422.            GZbiaoCZ.Update
  423.        End If
  424. '      End If
  425.     End If
  426.   ElseIf QueDing_GZ.Caption = "删  除" Then
  427.     QDShu = MsgBox("确定删除此条记录吗?", 51, "公司员工管理系统")
  428.     If QDShu = 6 Then
  429.       GZbiaoCZ.Delete
  430. '      GZbiaoCZ.Update
  431. '      GZbiaoCZ.MoveNext
  432. '      If GZbiaoCZ.EOF Then GZbiaoCZ.MoveFirst
  433.       GZbiaoCZ.Close
  434.       GZbiaoCZ.Open "manappraise", MySQL, adOpenKeyset, adLockPessimistic
  435.       textFuZhi_GZ
  436.      End If
  437.   ElseIf QueDing_GZ.Caption = "添  加" Then
  438.      QDShu = MsgBox("确定添加此条记录吗?", 51, "公司员工管理系统")
  439.      If QDShu = 6 Then
  440.        If Text_GZ(1) = "" Or Text_GZ(2) = "" Or textNian_GZ.Text = "" Or textYue_GZ.Text = "" Or textRi_GZ.Text = "" Then
  441.          MsgBox "红星号项目不能为空!", 48, "公司员工管理系统"
  442. '       If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
  443. '       ChaKanJB.Open "SELECT ygid,ygname,ygsex from manrecord where ygid='" & YGbianhao_GZ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
  444. '       If ChaKanJB.RecordCount = -1 Then
  445. '         MsgBox "不存在此编号的员工基本信息!请先添加相关的基本信息!", 48, "公司员工管理系统"
  446. '         ChaKanJB.Close
  447. '         Set ChaKanJB = Nothing
  448.          Exit Sub
  449.        Else
  450.          If DengJibiaoCZ.State = adStateOpen Then DengJibiaoCZ.Close
  451.          DengJibiaoCZ.Open "select * from ranking where DJbusi='" & Text_GZ(2) & "'", MySQL, adOpenKeyset, adLockPessimistic
  452.          If DengJibiaoCZ.RecordCount = 0 Then
  453.            MsgBox "职位等级信息不存在!请先添加相关的等级信息!", 48, "公司员工管理系统"
  454.            Exit Sub
  455.          Else
  456.            If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
  457.            GZbiaoCZ.Open "select * from manappraise where wid='" & YGbianhao_GZ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
  458.            If GZbiaoCZ.RecordCount <> 0 Then
  459.              MsgBox "已经存在此编号员工的工作信息!" & vbCrLf & "你可以进行修改!", 48, "公司员工管理系统"
  460.              Exit Sub
  461.            End If
  462.          End If
  463.        End If
  464.        GZbiaoCZ.AddNew
  465.        ShuJuFuZhi
  466.        GZbiaoCZ.Update
  467.      End If
  468.   End If
  469. End Sub
  470. Private Sub QuXiao_GZ_Click()
  471.   Unload Me
  472. End Sub
  473. Private Sub textNian_GZ_Click()
  474.   RiShu = RiJS(Trim(Val(textNian_GZ)), Trim(Val(textYue_GZ)))
  475.   RiFuZhi
  476. End Sub
  477. Sub RiFuZhi()
  478.   textRi_GZ.Clear
  479.   For RiShu_GZ = 1 To RiShu
  480.     textRi_GZ.AddItem RiShu_GZ
  481.   Next RiShu_GZ
  482.   textRi_GZ.Text = Ri
  483. End Sub
  484. Private Sub textYue_GZ_Click()
  485.   RiShu = RiJS(Trim(Val(textNian_GZ)), Trim(Val(textYue_GZ)))
  486.   RiFuZhi
  487. End Sub
  488. Sub ShuJuFuZhi()
  489.   For LieShu_GZ = 1 To 4
  490.     If LieShu_GZ = 3 Then
  491.     Else
  492.        GZbiaoCZ.Fields(LieShu_GZ) = Text_GZ(LieShu_GZ)
  493.     End If
  494.   Next LieShu_GZ
  495. '  GZbiaoCZ.Fields(2) = XingBie_GZ.Text
  496.   GZbiaoCZ.Fields(0) = YGbianhao_GZ.Text
  497.   GZbiaoCZ.Fields(3) = textNian_GZ & "-" & textYue_GZ & "-" & textRi_GZ
  498. End Sub
  499. 'Sub BianHaoFuZhi(ShuJuBiao As ADODB.Recordset)
  500. '  YGbianhao_GZ.Clear
  501. '  Do While Not ShuJuBiao.EOF
  502. '    YGbianhao_GZ.AddItem ShuJuBiao.Fields(0)
  503. '    ShuJuBiao.MoveNext
  504. '  Loop
  505. '  ShuJuBiao.MoveFirst
  506. 'End Sub
  507. Private Sub YGbianhao_GZ_Click()
  508.   If TianJiaGZ_PD Then
  509.     JiBen_GZ (Trim(YGbianhao_GZ))
  510.   Else
  511.     If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
  512.     GZbiaoCZ.Open "SELECT * from manappraise where wid='" & YGbianhao_GZ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
  513.     textFuZhi_GZ
  514.   End If
  515. End Sub
  516. Sub JiBen_GZ(ChZhbianhao As String)
  517. '  Dim ChZhstr As String
  518.   If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
  519. '  ChZhstr = "select ygname,ygsex,ygbirthday from manrecord where ygid=" & ChZhbianhao
  520.   ChaKanJB.Open "select ygname,ygsex,ygbirthday from manrecord where ygid=" & ChZhbianhao, MySQL, adOpenKeyset, adLockPessimistic
  521.   XingMing_GZ = ChaKanJB.Fields(0)
  522.   XingBie_GZ = ChaKanJB.Fields(1)
  523.   ChuSheng_GZ = ChaKanJB.Fields(2)
  524. End Sub
  525. Private Sub YGbianhao_GZ_LostFocus()
  526.   If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
  527.   ChaKanJB.Open "select ygname,ygsex,ygbirthday from manrecord where ygid='" & YGbianhao_GZ & "'", MySQL, adOpenKeyset, adLockPessimistic
  528.   If ChaKanJB.RecordCount = 0 Then
  529.     MsgBox "没有此编号员工基本信息!请先添加员工基本信息!", 48, "公司员工管理系统"
  530.   Else
  531.     JiBen_GZ (Trim(YGbianhao_GZ))
  532.   End If
  533. End Sub