main_rsgl_pxgl_lr.frm
上传用户:wd52qq
上传日期:2022-07-24
资源大小:5366k
文件大小:11k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
  3. Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
  4. Begin VB.Form main_rsgl_pxgl_lr 
  5.    BorderStyle     =   3  'Fixed Dialog
  6.    Caption         =   "Form1"
  7.    ClientHeight    =   3465
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   7290
  11.    Icon            =   "main_rsgl_pxgl_lr.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3465
  16.    ScaleWidth      =   7290
  17.    ShowInTaskbar   =   0   'False
  18.    StartUpPosition =   2  '屏幕中心
  19.    Begin VB.CommandButton Command2 
  20.       Caption         =   "取消"
  21.       Height          =   390
  22.       Left            =   3870
  23.       TabIndex        =   18
  24.       Top             =   2970
  25.       Width           =   1770
  26.    End
  27.    Begin VB.CommandButton Command1 
  28.       Caption         =   "确定"
  29.       Height          =   390
  30.       Left            =   1980
  31.       TabIndex        =   17
  32.       Top             =   2970
  33.       Width           =   1770
  34.    End
  35.    Begin VB.Frame Frame1 
  36.       Height          =   2940
  37.       Left            =   15
  38.       TabIndex        =   0
  39.       Top             =   -60
  40.       Width           =   7275
  41.       Begin VB.TextBox Text1 
  42.          Height          =   330
  43.          Index           =   6
  44.          Left            =   4755
  45.          Locked          =   -1  'True
  46.          TabIndex        =   20
  47.          Text            =   "0"
  48.          Top             =   1380
  49.          Width           =   2400
  50.       End
  51.       Begin VB.TextBox Text1 
  52.          Height          =   330
  53.          Index           =   5
  54.          Left            =   990
  55.          TabIndex        =   19
  56.          Top             =   1380
  57.          Width           =   2730
  58.       End
  59.       Begin VB.TextBox Text1 
  60.          Enabled         =   0   'False
  61.          Height          =   330
  62.          Index           =   0
  63.          Left            =   990
  64.          TabIndex        =   7
  65.          Top             =   225
  66.          Width           =   2730
  67.       End
  68.       Begin VB.TextBox Text1 
  69.          Enabled         =   0   'False
  70.          Height          =   330
  71.          Index           =   1
  72.          Left            =   4755
  73.          TabIndex        =   6
  74.          Top             =   255
  75.          Width           =   2400
  76.       End
  77.       Begin VB.TextBox Text1 
  78.          Height          =   330
  79.          Index           =   2
  80.          Left            =   4755
  81.          Locked          =   -1  'True
  82.          TabIndex        =   4
  83.          Text            =   "0"
  84.          Top             =   630
  85.          Width           =   2400
  86.       End
  87.       Begin VB.TextBox Text1 
  88.          Height          =   330
  89.          Index           =   3
  90.          Left            =   990
  91.          Locked          =   -1  'True
  92.          TabIndex        =   3
  93.          Text            =   "0"
  94.          Top             =   990
  95.          Width           =   2730
  96.       End
  97.       Begin VB.TextBox Text1 
  98.          Height          =   330
  99.          Index           =   4
  100.          Left            =   4755
  101.          Locked          =   -1  'True
  102.          TabIndex        =   2
  103.          Text            =   "0"
  104.          Top             =   1005
  105.          Width           =   2400
  106.       End
  107.       Begin VB.TextBox Text1 
  108.          Height          =   1050
  109.          Index           =   7
  110.          Left            =   975
  111.          MultiLine       =   -1  'True
  112.          ScrollBars      =   2  'Vertical
  113.          TabIndex        =   1
  114.          Top             =   1770
  115.          Width           =   6165
  116.       End
  117.       Begin MSDataListLib.DataCombo DataCombo1 
  118.          Bindings        =   "main_rsgl_pxgl_lr.frx":000C
  119.          Height          =   330
  120.          Left            =   990
  121.          TabIndex        =   5
  122.          Top             =   600
  123.          Width           =   2730
  124.          _ExtentX        =   4815
  125.          _ExtentY        =   582
  126.          _Version        =   393216
  127.          ListField       =   "课程名称"
  128.          BoundColumn     =   "课程编号"
  129.          Text            =   ""
  130.       End
  131.       Begin VB.Label Label9 
  132.          BackStyle       =   0  'Transparent
  133.          Caption         =   "备注:"
  134.          Height          =   255
  135.          Left            =   405
  136.          TabIndex        =   16
  137.          Top             =   1875
  138.          Width           =   555
  139.       End
  140.       Begin VB.Label Label1 
  141.          BackStyle       =   0  'Transparent
  142.          Caption         =   "员工编号:"
  143.          Height          =   255
  144.          Left            =   75
  145.          TabIndex        =   15
  146.          Top             =   315
  147.          Width           =   1005
  148.       End
  149.       Begin VB.Label Label2 
  150.          BackStyle       =   0  'Transparent
  151.          Caption         =   "员工姓名:"
  152.          Height          =   255
  153.          Left            =   3795
  154.          TabIndex        =   14
  155.          Top             =   315
  156.          Width           =   1005
  157.       End
  158.       Begin VB.Label Label3 
  159.          BackStyle       =   0  'Transparent
  160.          Caption         =   "课程名称:"
  161.          Height          =   255
  162.          Left            =   75
  163.          TabIndex        =   13
  164.          Top             =   705
  165.          Width           =   1005
  166.       End
  167.       Begin VB.Label Label4 
  168.          BackStyle       =   0  'Transparent
  169.          Caption         =   "时数:"
  170.          Height          =   255
  171.          Left            =   4170
  172.          TabIndex        =   12
  173.          Top             =   690
  174.          Width           =   555
  175.       End
  176.       Begin VB.Label Label5 
  177.          BackStyle       =   0  'Transparent
  178.          Caption         =   "开始时间:"
  179.          Height          =   255
  180.          Left            =   60
  181.          TabIndex        =   11
  182.          Top             =   1080
  183.          Width           =   1005
  184.       End
  185.       Begin VB.Label Label6 
  186.          BackStyle       =   0  'Transparent
  187.          Caption         =   "结束时间:"
  188.          Height          =   255
  189.          Left            =   3825
  190.          TabIndex        =   10
  191.          Top             =   1080
  192.          Width           =   1005
  193.       End
  194.       Begin VB.Label Label7 
  195.          BackStyle       =   0  'Transparent
  196.          Caption         =   "成绩:"
  197.          Height          =   255
  198.          Left            =   420
  199.          TabIndex        =   9
  200.          Top             =   1425
  201.          Width           =   555
  202.       End
  203.       Begin VB.Label Label8 
  204.          BackStyle       =   0  'Transparent
  205.          Caption         =   "费用:"
  206.          Height          =   255
  207.          Left            =   4200
  208.          TabIndex        =   8
  209.          Top             =   1425
  210.          Width           =   555
  211.       End
  212.    End
  213.    Begin MSAdodcLib.Adodc Adodc1 
  214.       Height          =   330
  215.       Left            =   0
  216.       Top             =   0
  217.       Visible         =   0   'False
  218.       Width           =   2040
  219.       _ExtentX        =   3598
  220.       _ExtentY        =   582
  221.       ConnectMode     =   0
  222.       CursorLocation  =   3
  223.       IsolationLevel  =   -1
  224.       ConnectionTimeout=   15
  225.       CommandTimeout  =   30
  226.       CursorType      =   3
  227.       LockType        =   3
  228.       CommandType     =   2
  229.       CursorOptions   =   0
  230.       CacheSize       =   50
  231.       MaxRecords      =   0
  232.       BOFAction       =   0
  233.       EOFAction       =   0
  234.       ConnectStringType=   1
  235.       Appearance      =   1
  236.       BackColor       =   -2147483643
  237.       ForeColor       =   -2147483640
  238.       Orientation     =   0
  239.       Enabled         =   -1
  240.       Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  241.       OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  242.       OLEDBFile       =   ""
  243.       DataSourceName  =   ""
  244.       OtherAttributes =   ""
  245.       UserName        =   ""
  246.       Password        =   ""
  247.       RecordSource    =   "培训课程表"
  248.       Caption         =   "Adodc1"
  249.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  250.          Name            =   "宋体"
  251.          Size            =   9
  252.          Charset         =   134
  253.          Weight          =   400
  254.          Underline       =   0   'False
  255.          Italic          =   0   'False
  256.          Strikethrough   =   0   'False
  257.       EndProperty
  258.       _Version        =   393216
  259.    End
  260. End
  261. Attribute VB_Name = "main_rsgl_pxgl_lr"
  262. Attribute VB_GlobalNameSpace = False
  263. Attribute VB_Creatable = False
  264. Attribute VB_PredeclaredId = True
  265. Attribute VB_Exposed = False
  266. Dim rs As New ADODB.Recordset
  267. Private Sub DataCombo1_Change()
  268.   rs.Open "select * from 培训课程表 where 课程编号='" + DataCombo1.BoundText + "'", Cnn, adOpenKeyset, adLockOptimistic
  269.   If rs.RecordCount > 0 Then
  270.     Text1(2) = rs.Fields("授课时数")
  271.     Text1(3) = rs.Fields("开课时间")
  272.     Text1(4) = rs.Fields("结束时间")
  273.     Text1(6) = rs.Fields("费用")
  274.   End If
  275.   rs.Close
  276. End Sub
  277. Private Sub DataCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
  278.   If KeyCode = vbKeyReturn Then Text1(5).SetFocus
  279. End Sub
  280. Private Sub Form_Activate()
  281.   DataCombo1.SetFocus
  282. End Sub
  283. Private Sub Form_Load()
  284.   If blnAddPX = True Then
  285.     Me.Caption = "培训信息添加"
  286.   Else
  287.     Me.Caption = "培训信息修改"
  288.     With main_rsgl_pxgl.Adodc1.Recordset
  289.      If .RecordCount > 0 Then
  290.         Text1(0) = .Fields("员工编号")
  291.         Text1(1) = .Fields("员工姓名")
  292.         DataCombo1 = .Fields("课程名称")
  293.         Text1(2) = .Fields("时数")
  294.         Text1(3) = .Fields("开始时间")
  295.         Text1(4) = .Fields("结束时间")
  296.         Text1(5) = .Fields("成绩")
  297.         Text1(6) = .Fields("费用")
  298.         Text1(7) = .Fields("备注")
  299.     End If
  300.    End With
  301.   End If
  302. End Sub
  303. Private Sub Text1_KeyDown(index As Integer, KeyCode As Integer, Shift As Integer)
  304.   If KeyCode = vbKeyReturn And index = 2 Then DTP1.SetFocus
  305.   If KeyCode = vbKeyReturn And index = 5 Then Text1(7).SetFocus
  306.   If KeyCode = vbKeyReturn And index = 7 Then Command1.SetFocus
  307. End Sub
  308. Private Sub Command1_Click()
  309.   If DataCombo1.text = "" Then
  310.     MsgBox "请选择课程!", , "提示"
  311.     Exit Sub
  312.   End If
  313.   If blnAddPX = True Then
  314.     Cnn.Execute ("insert into 培训表(员工编号,员工姓名,课程名称,时数,开始时间,结束时间,成绩,费用,备注) " _
  315.      & "values('" + Text1(0) + "','" + Text1(1) + "','" + DataCombo1 + "'," + Text1(2) + ",'" + _
  316.      Text1(3) + "','" + Text1(4) + "','" + Text1(5) + "'," + Text1(6) + ",'" + Text1(7) + "')")
  317.   Else
  318.     Cnn.Execute ("update 培训表 set 课程名称='" + DataCombo1 + "',时数=" + Text1(2) + ",开始时间='" + _
  319.     Text1(3) + "',结束时间='" + Text1(4) + "',成绩='" + Text1(5) + "',费用=" + Text1(6) + _
  320.     ",备注='" + Text1(7) + "'where 员工编号='" + Text1(0) + "'and 课程名称='" + DataCombo1 + "'")
  321.   End If
  322.   main_rsgl_pxgl.Adodc1.Refresh
  323.   Unload Me
  324. End Sub
  325. Private Sub Command2_Click()
  326.   Unload Me
  327. End Sub