F_ZhaoPin.frm
上传用户:xiao_xia32
上传日期:2022-07-21
资源大小:1174k
文件大小:22k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
  3. Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
  4. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  5. Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
  6. Begin VB.Form F_ZhaoPin 
  7.    BorderStyle     =   3  'Fixed Dialog
  8.    Caption         =   "招聘登记"
  9.    ClientHeight    =   5475
  10.    ClientLeft      =   1095
  11.    ClientTop       =   330
  12.    ClientWidth     =   9375
  13.    ControlBox      =   0   'False
  14.    KeyPreview      =   -1  'True
  15.    LinkTopic       =   "Form1"
  16.    LockControls    =   -1  'True
  17.    MaxButton       =   0   'False
  18.    MinButton       =   0   'False
  19.    Moveable        =   0   'False
  20.    ScaleHeight     =   5475
  21.    ScaleWidth      =   9375
  22.    StartUpPosition =   2  '屏幕中心
  23.    Begin VB.Frame Frame1 
  24.       Height          =   5175
  25.       Left            =   120
  26.       TabIndex        =   14
  27.       Top             =   120
  28.       Width           =   9135
  29.       Begin TabDlg.SSTab SSTab1 
  30.          Height          =   4695
  31.          Left            =   240
  32.          TabIndex        =   15
  33.          Top             =   360
  34.          Width           =   8655
  35.          _ExtentX        =   15266
  36.          _ExtentY        =   8281
  37.          _Version        =   393216
  38.          Tabs            =   2
  39.          TabHeight       =   520
  40.          TabCaption(0)   =   "编辑"
  41.          TabPicture(0)   =   "F_ZhaoPin.frx":0000
  42.          Tab(0).ControlEnabled=   -1  'True
  43.          Tab(0).Control(0)=   "Frame2"
  44.          Tab(0).Control(0).Enabled=   0   'False
  45.          Tab(0).Control(1)=   "Picture1"
  46.          Tab(0).Control(1).Enabled=   0   'False
  47.          Tab(0).ControlCount=   2
  48.          TabCaption(1)   =   "列表"
  49.          TabPicture(1)   =   "F_ZhaoPin.frx":001C
  50.          Tab(1).ControlEnabled=   0   'False
  51.          Tab(1).Control(0)=   "Frame3"
  52.          Tab(1).ControlCount=   1
  53.          Begin VB.PictureBox Picture1 
  54.             Appearance      =   0  'Flat
  55.             BorderStyle     =   0  'None
  56.             BeginProperty Font 
  57.                Name            =   "MS Sans Serif"
  58.                Size            =   8.25
  59.                Charset         =   0
  60.                Weight          =   400
  61.                Underline       =   0   'False
  62.                Italic          =   0   'False
  63.                Strikethrough   =   0   'False
  64.             EndProperty
  65.             ForeColor       =   &H80000008&
  66.             Height          =   420
  67.             Left            =   1680
  68.             ScaleHeight     =   420
  69.             ScaleWidth      =   6720
  70.             TabIndex        =   28
  71.             Top             =   4080
  72.             Width           =   6720
  73.             Begin Threed.SSCommand cmdClose 
  74.                Height          =   330
  75.                Left            =   5520
  76.                TabIndex        =   29
  77.                Top             =   0
  78.                Width           =   1095
  79.                _Version        =   65536
  80.                _ExtentX        =   1931
  81.                _ExtentY        =   573
  82.                _StockProps     =   78
  83.                Caption         =   "&Q.关 闭"
  84.                Font3D          =   1
  85.             End
  86.             Begin Threed.SSCommand CmdAdd 
  87.                Height          =   330
  88.                Left            =   720
  89.                TabIndex        =   9
  90.                Top             =   0
  91.                Width           =   1095
  92.                _Version        =   65536
  93.                _ExtentX        =   1931
  94.                _ExtentY        =   573
  95.                _StockProps     =   78
  96.                Caption         =   "&A.增 加"
  97.                Font3D          =   1
  98.             End
  99.             Begin Threed.SSCommand cmdEdit 
  100.                Height          =   330
  101.                Left            =   1920
  102.                TabIndex        =   10
  103.                Top             =   0
  104.                Width           =   1095
  105.                _Version        =   65536
  106.                _ExtentX        =   1931
  107.                _ExtentY        =   573
  108.                _StockProps     =   78
  109.                Caption         =   "&E.编 辑"
  110.                Font3D          =   1
  111.             End
  112.             Begin Threed.SSCommand CmdDelete 
  113.                Height          =   330
  114.                Left            =   3120
  115.                TabIndex        =   11
  116.                Top             =   0
  117.                Width           =   1095
  118.                _Version        =   65536
  119.                _ExtentX        =   1931
  120.                _ExtentY        =   573
  121.                _StockProps     =   78
  122.                Caption         =   "&D.删 除"
  123.                Font3D          =   1
  124.             End
  125.             Begin Threed.SSCommand cmdUpdate 
  126.                Height          =   330
  127.                Left            =   4320
  128.                TabIndex        =   30
  129.                Top             =   0
  130.                Width           =   1095
  131.                _Version        =   65536
  132.                _ExtentX        =   1931
  133.                _ExtentY        =   573
  134.                _StockProps     =   78
  135.                Caption         =   "&Y.保 存"
  136.                Font3D          =   1
  137.             End
  138.             Begin Threed.SSCommand cmdRefresh 
  139.                Height          =   330
  140.                Left            =   4320
  141.                TabIndex        =   12
  142.                Top             =   0
  143.                Width           =   1095
  144.                _Version        =   65536
  145.                _ExtentX        =   1931
  146.                _ExtentY        =   573
  147.                _StockProps     =   78
  148.                Caption         =   "&R.刷 新"
  149.                Font3D          =   1
  150.             End
  151.             Begin Threed.SSCommand cmdCancel 
  152.                Height          =   330
  153.                Left            =   5520
  154.                TabIndex        =   13
  155.                Top             =   0
  156.                Width           =   1095
  157.                _Version        =   65536
  158.                _ExtentX        =   1931
  159.                _ExtentY        =   573
  160.                _StockProps     =   78
  161.                Caption         =   "&C.取 消"
  162.                Font3D          =   1
  163.             End
  164.          End
  165.          Begin VB.Frame Frame3 
  166.             Height          =   4215
  167.             Left            =   -74880
  168.             TabIndex        =   25
  169.             Top             =   360
  170.             Width           =   8175
  171.             Begin MSDataGridLib.DataGrid DataGrid1 
  172.                Height          =   3855
  173.                Left            =   120
  174.                TabIndex        =   26
  175.                Top             =   240
  176.                Width           =   7695
  177.                _ExtentX        =   13573
  178.                _ExtentY        =   6800
  179.                _Version        =   393216
  180.                AllowUpdate     =   0   'False
  181.                HeadLines       =   1
  182.                RowHeight       =   14
  183.                BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  184.                   Name            =   "MS Sans Serif"
  185.                   Size            =   8.25
  186.                   Charset         =   0
  187.                   Weight          =   400
  188.                   Underline       =   0   'False
  189.                   Italic          =   0   'False
  190.                   Strikethrough   =   0   'False
  191.                EndProperty
  192.                BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  193.                   Name            =   "宋体"
  194.                   Size            =   9
  195.                   Charset         =   134
  196.                   Weight          =   400
  197.                   Underline       =   0   'False
  198.                   Italic          =   0   'False
  199.                   Strikethrough   =   0   'False
  200.                EndProperty
  201.                ColumnCount     =   2
  202.                BeginProperty Column00 
  203.                   DataField       =   ""
  204.                   Caption         =   ""
  205.                   BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  206.                      Type            =   0
  207.                      Format          =   ""
  208.                      HaveTrueFalseNull=   0
  209.                      FirstDayOfWeek  =   0
  210.                      FirstWeekOfYear =   0
  211.                      LCID            =   2052
  212.                      SubFormatType   =   0
  213.                   EndProperty
  214.                EndProperty
  215.                BeginProperty Column01 
  216.                   DataField       =   ""
  217.                   Caption         =   ""
  218.                   BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  219.                      Type            =   0
  220.                      Format          =   ""
  221.                      HaveTrueFalseNull=   0
  222.                      FirstDayOfWeek  =   0
  223.                      FirstWeekOfYear =   0
  224.                      LCID            =   2052
  225.                      SubFormatType   =   0
  226.                   EndProperty
  227.                EndProperty
  228.                SplitCount      =   1
  229.                BeginProperty Split0 
  230.                   BeginProperty Column00 
  231.                   EndProperty
  232.                   BeginProperty Column01 
  233.                   EndProperty
  234.                EndProperty
  235.             End
  236.          End
  237.          Begin VB.Frame Frame2 
  238.             Height          =   3495
  239.             Left            =   240
  240.             TabIndex        =   16
  241.             Top             =   480
  242.             Width           =   8055
  243.             Begin VB.ComboBox Combo2 
  244.                Appearance      =   0  'Flat
  245.                DataField       =   "岗位名称"
  246.                Height          =   300
  247.                Left            =   5640
  248.                TabIndex        =   4
  249.                Top             =   1680
  250.                Width           =   1815
  251.             End
  252.             Begin VB.ComboBox Combo1 
  253.                Appearance      =   0  'Flat
  254.                DataField       =   "所属部门"
  255.                Height          =   300
  256.                Left            =   1440
  257.                TabIndex        =   3
  258.                Top             =   1680
  259.                Width           =   1815
  260.             End
  261.             Begin VB.TextBox txtFields 
  262.                Appearance      =   0  'Flat
  263.                DataField       =   "招聘编号"
  264.                Height          =   285
  265.                Index           =   0
  266.                Left            =   1440
  267.                TabIndex        =   0
  268.                Top             =   480
  269.                Width           =   1815
  270.             End
  271.             Begin MSComCtl2.DTPicker DTPicker1 
  272.                DataField       =   "招聘日期"
  273.                Height          =   300
  274.                Left            =   1440
  275.                TabIndex        =   1
  276.                Top             =   1072
  277.                Width           =   1815
  278.                _ExtentX        =   3201
  279.                _ExtentY        =   529
  280.                _Version        =   393216
  281.                CheckBox        =   -1  'True
  282.                DateIsNull      =   -1  'True
  283.                Format          =   69402625
  284.                CurrentDate     =   36191
  285.             End
  286.             Begin VB.TextBox txtFields 
  287.                Appearance      =   0  'Flat
  288.                DataField       =   "招聘方式"
  289.                Height          =   285
  290.                Index           =   1
  291.                Left            =   5640
  292.                TabIndex        =   2
  293.                Top             =   1080
  294.                Width           =   1815
  295.             End
  296.             Begin VB.TextBox txtFields 
  297.                Appearance      =   0  'Flat
  298.                DataField       =   "岗位编号"
  299.                Enabled         =   0   'False
  300.                Height          =   285
  301.                Index           =   2
  302.                Left            =   1440
  303.                TabIndex        =   5
  304.                Top             =   2280
  305.                Width           =   1815
  306.             End
  307.             Begin VB.TextBox txtFields 
  308.                Appearance      =   0  'Flat
  309.                DataField       =   "应聘人数"
  310.                Height          =   285
  311.                Index           =   5
  312.                Left            =   5640
  313.                TabIndex        =   6
  314.                Top             =   2280
  315.                Width           =   1815
  316.             End
  317.             Begin VB.TextBox txtFields 
  318.                Appearance      =   0  'Flat
  319.                DataField       =   "招聘费"
  320.                Height          =   285
  321.                Index           =   6
  322.                Left            =   1440
  323.                TabIndex        =   7
  324.                Top             =   2880
  325.                Width           =   1815
  326.             End
  327.             Begin VB.TextBox txtFields 
  328.                Appearance      =   0  'Flat
  329.                DataField       =   "人均费用"
  330.                Enabled         =   0   'False
  331.                Height          =   285
  332.                Index           =   7
  333.                Left            =   5640
  334.                TabIndex        =   8
  335.                Top             =   2880
  336.                Width           =   1815
  337.             End
  338.             Begin VB.Label lblLabels 
  339.                Caption         =   "招聘编号"
  340.                Height          =   255
  341.                Index           =   8
  342.                Left            =   360
  343.                TabIndex        =   27
  344.                Top             =   480
  345.                Width           =   975
  346.             End
  347.             Begin VB.Label lblLabels 
  348.                Caption         =   "招聘日期"
  349.                Height          =   255
  350.                Index           =   0
  351.                Left            =   360
  352.                TabIndex        =   24
  353.                Top             =   1095
  354.                Width           =   975
  355.             End
  356.             Begin VB.Label lblLabels 
  357.                Caption         =   "招聘方式"
  358.                Height          =   255
  359.                Index           =   1
  360.                Left            =   3840
  361.                TabIndex        =   23
  362.                Top             =   1095
  363.                Width           =   855
  364.             End
  365.             Begin VB.Label lblLabels 
  366.                Caption         =   "岗位编号"
  367.                Height          =   255
  368.                Index           =   2
  369.                Left            =   360
  370.                TabIndex        =   22
  371.                Top             =   2295
  372.                Width           =   855
  373.             End
  374.             Begin VB.Label lblLabels 
  375.                Caption         =   "岗位名称"
  376.                Height          =   255
  377.                Index           =   3
  378.                Left            =   3840
  379.                TabIndex        =   21
  380.                Top             =   1710
  381.                Width           =   855
  382.             End
  383.             Begin VB.Label lblLabels 
  384.                Caption         =   "所属部门"
  385.                Height          =   255
  386.                Index           =   4
  387.                Left            =   360
  388.                TabIndex        =   20
  389.                Top             =   1710
  390.                Width           =   975
  391.             End
  392.             Begin VB.Label lblLabels 
  393.                Caption         =   "应聘人数"
  394.                Height          =   255
  395.                Index           =   5
  396.                Left            =   3840
  397.                TabIndex        =   19
  398.                Top             =   2295
  399.                Width           =   735
  400.             End
  401.             Begin VB.Label lblLabels 
  402.                Caption         =   "招聘费"
  403.                Height          =   255
  404.                Index           =   6
  405.                Left            =   360
  406.                TabIndex        =   18
  407.                Top             =   2895
  408.                Width           =   975
  409.             End
  410.             Begin VB.Label lblLabels 
  411.                Caption         =   "人均费用"
  412.                Height          =   255
  413.                Index           =   7
  414.                Left            =   3840
  415.                TabIndex        =   17
  416.                Top             =   2895
  417.                Width           =   1095
  418.             End
  419.          End
  420.       End
  421.    End
  422. End
  423. Attribute VB_Name = "F_ZhaoPin"
  424. Attribute VB_GlobalNameSpace = False
  425. Attribute VB_Creatable = False
  426. Attribute VB_PredeclaredId = True
  427. Attribute VB_Exposed = False
  428. Dim WithEvents adoPrimaryRS As Recordset
  429. Attribute adoPrimaryRS.VB_VarHelpID = -1
  430. Dim mvBookMark As Variant
  431. Dim mbEditFlag As Boolean
  432. Dim mbAddNewFlag As Boolean
  433. Private Sub Combo1_Click()
  434. Dim sql2 As String
  435. Combo2.Clear
  436. sql2 = "select  distinct 岗位名称  from 岗位说明  where 所属部门 = '" & Combo1.Text & "'"
  437. Set rs2 = db.Execute(sql2)
  438.    
  439. While Not rs2.EOF
  440.   Combo2.AddItem Trim(rs2("岗位名称"))
  441.    rs2.MoveNext
  442. Wend
  443. End Sub
  444. Private Sub Combo1_KeyPress(KeyAscii As Integer)
  445. If KeyAscii = vbKeyReturn Then
  446.     SendKeys "{TAB}"
  447. End If
  448. End Sub
  449. Private Sub Combo2_Click()
  450. Dim Sql3 As String
  451. Sql3 = "select  distinct 岗位编号 from 岗位说明  where 岗位名称 = '" & Combo2.Text & "'"
  452. Set rs3 = db.Execute(Sql3)
  453. If Not IsNull(rs3("岗位编号")) Then
  454. txtFields(2).Text = Trim(rs3("岗位编号"))
  455. End If
  456. End Sub
  457. Private Sub Combo2_KeyPress(KeyAscii As Integer)
  458. If KeyAscii = vbKeyReturn Then
  459.     SendKeys "{TAB}"
  460. End If
  461. End Sub
  462. Private Sub DTPicker1_KeyPress(KeyAscii As Integer)
  463. If KeyAscii = vbKeyReturn Then
  464.     SendKeys "{TAB}"
  465. End If
  466. End Sub
  467. Private Sub Form_Load()
  468. On Error Resume Next
  469.     For Each TextBox In Me.Controls
  470.         TextBox.Font.Name = "宋体"
  471.         TextBox.Font.Size = 9
  472.     Next
  473.   
  474.   Set adoPrimaryRS = New Recordset
  475.   adoPrimaryRS.Open "select * from 招聘登记", db, adOpenStatic, adLockOptimistic
  476.  Set DataGrid1.DataSource = adoPrimaryRS
  477.   
  478.   SetButtons True
  479.   Set DTPicker1.DataSource = adoPrimaryRS
  480.   
  481.   Dim oText As TextBox
  482.   'Bind the text boxes to the data provider
  483.   For Each oText In Me.txtFields
  484.     Set oText.DataSource = adoPrimaryRS
  485.   Next
  486.   
  487.   Set Combo1.DataSource = adoPrimaryRS
  488.   Set Combo2.DataSource = adoPrimaryRS
  489.   
  490.   Dim SqlBuMen As String
  491.    SqlBuMen = "select  distinct 部门名称 from 部门维护表"
  492.   Set RsBuMen = db.Execute(SqlBuMen)
  493.    
  494.   While Not RsBuMen.EOF
  495.      Combo1.AddItem Trim(RsBuMen("部门名称"))
  496.     RsBuMen.MoveNext
  497.   Wend
  498. End Sub
  499. Private Sub Form_Unload(Cancel As Integer)
  500.   Screen.MousePointer = vbDefault
  501. End Sub
  502. Private Sub cmdAdd_Click()
  503.   On Error GoTo AddErr
  504.   
  505.   
  506.  With adoPrimaryRS
  507.     If Not (.BOF And .EOF) Then
  508.       mvBookMark = .Bookmark
  509.     End If
  510.     .AddNew
  511.     mbAddNewFlag = True
  512.     SetButtons False
  513.   End With
  514.   Exit Sub
  515. AddErr:
  516.   MsgBox "增加操作有错误", vbExclamation + vbOKOnly, pTitle
  517.   
  518. End Sub
  519. Private Sub cmdDelete_Click()
  520.   On Error GoTo DeleteErr
  521.   If MsgBox("是否确认删除招聘信息?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  522.   With adoPrimaryRS
  523.     .Delete
  524.     .MoveNext
  525.     If .EOF Then .MoveLast
  526.   End With
  527.   Exit Sub
  528. DeleteErr:
  529.   MsgBox "删除操作有错误", vbExclamation + vbOKOnly, pTitle
  530. End Sub
  531. Private Sub cmdRefresh_Click()
  532.   'This is only needed for multi user apps
  533.   On Error GoTo RefreshErr
  534.   adoPrimaryRS.Requery
  535.   Exit Sub
  536. RefreshErr:
  537.    MsgBox "刷新操作有错误", vbExclamation + vbOKOnly, pTitle
  538. End Sub
  539. Private Sub cmdEdit_Click()
  540.   On Error GoTo EditErr
  541.   mbEditFlag = True
  542.   SetButtons False
  543.   Exit Sub
  544. EditErr:
  545.    MsgBox "更改操作有错误", vbExclamation + vbOKOnly, pTitle
  546. End Sub
  547. Private Sub cmdCancel_Click()
  548.  ' On Error Resume Next
  549.  On Error GoTo CancelErr
  550.   mbEditFlag = False
  551.   mbAddNewFlag = False
  552.   adoPrimaryRS.CancelUpdate
  553.   If mvBookMark > 0 Then
  554.    adoPrimaryRS.Bookmark = mvBookMark
  555.   Else
  556.    adoPrimaryRS.MoveFirst
  557.   End If
  558.  SetButtons True
  559.   Exit Sub
  560. CancelErr:
  561.    
  562.    MsgBox "取消操作有错误", vbExclamation + vbOKOnly, pTitle
  563. End Sub
  564. Private Sub cmdUpdate_Click()
  565.   On Error GoTo UpdateErr
  566.   If MsgBox("是否确认此操作?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  567.   adoPrimaryRS.UpdateBatch adAffectAll
  568.   If mbAddNewFlag Then
  569.     adoPrimaryRS.MoveLast              'move to the new record
  570.   End If
  571.   
  572.   mbEditFlag = False
  573.   mbAddNewFlag = False
  574.   SetButtons True
  575.   Exit Sub
  576. UpdateErr:
  577.    MsgBox "保存操作有错误", vbExclamation + vbOKOnly, pTitle
  578. End Sub
  579. Private Sub cmdClose_Click()
  580.   RSGL.Enabled = True
  581.   Unload Me
  582. End Sub
  583. Private Sub SetButtons(bVal As Boolean)
  584.   CmdAdd.Visible = bVal
  585.   cmdEdit.Visible = bVal
  586.   cmdUpdate.Visible = Not bVal
  587.   cmdCancel.Visible = Not bVal
  588.   CmdDelete.Visible = bVal
  589.   cmdClose.Visible = bVal
  590.   cmdRefresh.Visible = bVal
  591.   If bVal Then
  592.    Set DataGrid1.DataSource = adoPrimaryRS
  593.   Else
  594.    Set DataGrid1.DataSource = Nothing
  595.   End If
  596.   
  597.   txtFields(0).Enabled = Not bVal
  598.   txtFields(1).Enabled = Not bVal
  599.   txtFields(5).Enabled = Not bVal
  600.   txtFields(6).Enabled = Not bVal
  601.   Combo1.Enabled = Not bVal
  602.   Combo2.Enabled = Not bVal
  603.   DTPicker1.Enabled = Not bVal
  604.   
  605. End Sub
  606. Private Sub txtFields_Change(Index As Integer)
  607. If IsNumeric(txtFields(5).Text) And IsNumeric(txtFields(6).Text) Then
  608.  txtFields(7) = CDbl(txtFields(6)) / CDbl(txtFields(5))
  609. End If
  610. End Sub
  611. Private Sub txtFields_KeyPress(Index As Integer, KeyAscii As Integer)
  612. If KeyAscii = vbKeyReturn Then
  613.     SendKeys "{TAB}"
  614. End If
  615. End Sub
  616. Private Sub txtFields_LostFocus(Index As Integer)
  617. If Not IsNumeric(txtFields(5).Text) And (txtFields(5).Text <> "") Then
  618.     MsgBox "请在“应聘人数”中输入数字", vbExclamation + vbOKOnly, pTitle
  619.      txtFields(5).SetFocus
  620.      txtFields(5).SelLength = Len(txtFields(5))
  621.      txtFields(5).SelStart = 0
  622. End If
  623. If Not IsNumeric(txtFields(6).Text) And (txtFields(6).Text <> "") Then
  624.     MsgBox "请在“招聘费”中输入数字", vbExclamation + vbOKOnly, pTitle
  625.      txtFields(6).SetFocus
  626.      txtFields(6).SelLength = Len(txtFields(6))
  627.      txtFields(6).SelStart = 0
  628. End If
  629. End Sub