main_rsgl_htgl_lr.frm
上传用户:ake0106
上传日期:2022-07-23
资源大小:4052k
文件大小:13k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
  3. Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
  4. Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
  5. Begin VB.Form main_rsgl_htgl_lr 
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "Form1"
  8.    ClientHeight    =   4080
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   7290
  12.    Icon            =   "main_rsgl_htgl_lr.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4080
  17.    ScaleWidth      =   7290
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   2  '屏幕中心
  20.    Begin VB.CommandButton Command2 
  21.       Caption         =   "取消"
  22.       Height          =   390
  23.       Left            =   3765
  24.       TabIndex        =   20
  25.       Top             =   3525
  26.       Width           =   1770
  27.    End
  28.    Begin VB.CommandButton Command1 
  29.       Caption         =   "确定"
  30.       Height          =   390
  31.       Left            =   1875
  32.       TabIndex        =   19
  33.       Top             =   3525
  34.       Width           =   1770
  35.    End
  36.    Begin VB.Frame Frame1 
  37.       Height          =   3405
  38.       Left            =   15
  39.       TabIndex        =   0
  40.       Top             =   -60
  41.       Width           =   7275
  42.       Begin VB.TextBox Text1 
  43.          Height          =   330
  44.          Index           =   6
  45.          Left            =   4755
  46.          TabIndex        =   22
  47.          Top             =   1740
  48.          Width           =   2400
  49.       End
  50.       Begin VB.TextBox Text1 
  51.          Height          =   330
  52.          Index           =   5
  53.          Left            =   1140
  54.          TabIndex        =   21
  55.          Top             =   1740
  56.          Width           =   2535
  57.       End
  58.       Begin VB.TextBox Text1 
  59.          Height          =   330
  60.          Index           =   0
  61.          Left            =   1140
  62.          Locked          =   -1  'True
  63.          TabIndex        =   8
  64.          Top             =   225
  65.          Width           =   2535
  66.       End
  67.       Begin VB.TextBox Text1 
  68.          Enabled         =   0   'False
  69.          Height          =   330
  70.          Index           =   1
  71.          Left            =   4755
  72.          Locked          =   -1  'True
  73.          TabIndex        =   7
  74.          Top             =   255
  75.          Width           =   2400
  76.       End
  77.       Begin VB.TextBox Text1 
  78.          Enabled         =   0   'False
  79.          Height          =   330
  80.          Index           =   2
  81.          Left            =   4755
  82.          Locked          =   -1  'True
  83.          TabIndex        =   5
  84.          Top             =   630
  85.          Width           =   2400
  86.       End
  87.       Begin VB.TextBox Text1 
  88.          Height          =   330
  89.          Index           =   3
  90.          Left            =   1140
  91.          TabIndex        =   3
  92.          Top             =   1365
  93.          Width           =   2535
  94.       End
  95.       Begin VB.TextBox Text1 
  96.          Height          =   330
  97.          Index           =   4
  98.          Left            =   4755
  99.          TabIndex        =   2
  100.          Top             =   1365
  101.          Width           =   2400
  102.       End
  103.       Begin VB.TextBox Text1 
  104.          Height          =   1110
  105.          Index           =   7
  106.          Left            =   1140
  107.          MultiLine       =   -1  'True
  108.          ScrollBars      =   2  'Vertical
  109.          TabIndex        =   1
  110.          Top             =   2130
  111.          Width           =   6015
  112.       End
  113.       Begin MSComCtl2.DTPicker DTP1 
  114.          Height          =   330
  115.          Left            =   1140
  116.          TabIndex        =   4
  117.          Top             =   1005
  118.          Width           =   2535
  119.          _ExtentX        =   4471
  120.          _ExtentY        =   582
  121.          _Version        =   393216
  122.          Format          =   48168961
  123.          CurrentDate     =   38698
  124.       End
  125.       Begin MSDataListLib.DataCombo DataCombo1 
  126.          Bindings        =   "main_rsgl_htgl_lr.frx":000C
  127.          Height          =   330
  128.          Left            =   1140
  129.          TabIndex        =   6
  130.          Top             =   615
  131.          Width           =   2535
  132.          _ExtentX        =   4471
  133.          _ExtentY        =   582
  134.          _Version        =   393216
  135.          ListField       =   "合同类型"
  136.          Text            =   ""
  137.       End
  138.       Begin MSComCtl2.DTPicker DTP2 
  139.          Height          =   300
  140.          Left            =   4755
  141.          TabIndex        =   17
  142.          Top             =   1005
  143.          Width           =   2400
  144.          _ExtentX        =   4233
  145.          _ExtentY        =   529
  146.          _Version        =   393216
  147.          Format          =   48168961
  148.          CurrentDate     =   38698
  149.       End
  150.       Begin VB.Label Label11 
  151.          BackStyle       =   0  'Transparent
  152.          Caption         =   "试用期工资:"
  153.          Height          =   255
  154.          Left            =   3705
  155.          TabIndex        =   24
  156.          Top             =   1800
  157.          Width           =   1125
  158.       End
  159.       Begin VB.Label Label10 
  160.          BackStyle       =   0  'Transparent
  161.          Caption         =   "合同期工资:"
  162.          Height          =   195
  163.          Left            =   75
  164.          TabIndex        =   23
  165.          Top             =   1800
  166.          Width           =   1110
  167.       End
  168.       Begin VB.Label Label9 
  169.          BackStyle       =   0  'Transparent
  170.          Caption         =   "备注:"
  171.          Height          =   255
  172.          Left            =   570
  173.          TabIndex        =   18
  174.          Top             =   2145
  175.          Width           =   555
  176.       End
  177.       Begin VB.Label Label1 
  178.          BackStyle       =   0  'Transparent
  179.          Caption         =   "合同编号:"
  180.          Height          =   255
  181.          Left            =   195
  182.          TabIndex        =   16
  183.          Top             =   315
  184.          Width           =   915
  185.       End
  186.       Begin VB.Label Label2 
  187.          BackStyle       =   0  'Transparent
  188.          Caption         =   "员工编号:"
  189.          Height          =   255
  190.          Left            =   3840
  191.          TabIndex        =   15
  192.          Top             =   330
  193.          Width           =   1005
  194.       End
  195.       Begin VB.Label Label3 
  196.          BackStyle       =   0  'Transparent
  197.          Caption         =   "合同类型:"
  198.          Height          =   255
  199.          Left            =   195
  200.          TabIndex        =   14
  201.          Top             =   705
  202.          Width           =   1005
  203.       End
  204.       Begin VB.Label Label4 
  205.          BackStyle       =   0  'Transparent
  206.          Caption         =   "员工姓名:"
  207.          Height          =   255
  208.          Left            =   3840
  209.          TabIndex        =   13
  210.          Top             =   705
  211.          Width           =   915
  212.       End
  213.       Begin VB.Label Label5 
  214.          BackStyle       =   0  'Transparent
  215.          Caption         =   "合同日期:"
  216.          Height          =   255
  217.          Left            =   195
  218.          TabIndex        =   12
  219.          Top             =   1080
  220.          Width           =   1005
  221.       End
  222.       Begin VB.Label Label6 
  223.          BackStyle       =   0  'Transparent
  224.          Caption         =   "结束日期:"
  225.          Height          =   255
  226.          Left            =   3855
  227.          TabIndex        =   11
  228.          Top             =   1095
  229.          Width           =   1005
  230.       End
  231.       Begin VB.Label Label7 
  232.          BackStyle       =   0  'Transparent
  233.          Caption         =   "合同期限:"
  234.          Height          =   255
  235.          Left            =   195
  236.          TabIndex        =   10
  237.          Top             =   1425
  238.          Width           =   915
  239.       End
  240.       Begin VB.Label Label8 
  241.          BackStyle       =   0  'Transparent
  242.          Caption         =   "试用期:"
  243.          Height          =   255
  244.          Left            =   4020
  245.          TabIndex        =   9
  246.          Top             =   1440
  247.          Width           =   735
  248.       End
  249.    End
  250.    Begin MSAdodcLib.Adodc Adodc1 
  251.       Height          =   330
  252.       Left            =   0
  253.       Top             =   0
  254.       Visible         =   0   'False
  255.       Width           =   2040
  256.       _ExtentX        =   3598
  257.       _ExtentY        =   582
  258.       ConnectMode     =   0
  259.       CursorLocation  =   3
  260.       IsolationLevel  =   -1
  261.       ConnectionTimeout=   15
  262.       CommandTimeout  =   30
  263.       CursorType      =   3
  264.       LockType        =   3
  265.       CommandType     =   2
  266.       CursorOptions   =   0
  267.       CacheSize       =   50
  268.       MaxRecords      =   0
  269.       BOFAction       =   0
  270.       EOFAction       =   0
  271.       ConnectStringType=   1
  272.       Appearance      =   1
  273.       BackColor       =   -2147483643
  274.       ForeColor       =   -2147483640
  275.       Orientation     =   0
  276.       Enabled         =   -1
  277.       Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  278.       OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  279.       OLEDBFile       =   ""
  280.       DataSourceName  =   ""
  281.       OtherAttributes =   ""
  282.       UserName        =   ""
  283.       Password        =   ""
  284.       RecordSource    =   "合同类型表"
  285.       Caption         =   "Adodc1"
  286.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  287.          Name            =   "宋体"
  288.          Size            =   9
  289.          Charset         =   134
  290.          Weight          =   400
  291.          Underline       =   0   'False
  292.          Italic          =   0   'False
  293.          Strikethrough   =   0   'False
  294.       EndProperty
  295.       _Version        =   393216
  296.    End
  297. End
  298. Attribute VB_Name = "main_rsgl_htgl_lr"
  299. Attribute VB_GlobalNameSpace = False
  300. Attribute VB_Creatable = False
  301. Attribute VB_PredeclaredId = True
  302. Attribute VB_Exposed = False
  303. Private Sub DataCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
  304.   If KeyCode = vbKeyReturn Then DTP1.SetFocus
  305. End Sub
  306. Private Sub DTP1_Change()
  307.   Text1(3) = DateDiff("yyyy", DTP1.Value, DTP2.Value)
  308. End Sub
  309. Private Sub DTP1_KeyDown(KeyCode As Integer, Shift As Integer)
  310.   If KeyCode = vbKeyReturn Then DTP2.SetFocus
  311. End Sub
  312. Private Sub DTP2_Change()
  313.  Text1(3) = DateDiff("yyyy", DTP1.Value, DTP2.Value)
  314. End Sub
  315. Private Sub DTP2_KeyDown(KeyCode As Integer, Shift As Integer)
  316.   If KeyCode = vbKeyReturn Then Text1(4).SetFocus
  317. End Sub
  318. Private Sub Form_Activate()
  319.   DataCombo1.SetFocus
  320. End Sub
  321. Private Sub Form_Load()
  322.   Text1(0) = Year(Date) & Month(Date) & HTygbh
  323.   If blnAddHT = True Then
  324.     Me.Caption = "合同信息添加"
  325.     DTP1.Value = Date
  326.     DTP2.Value = DateAdd("yyyy", 1, Date)
  327.   Else
  328.     Me.Caption = "合同信息修改"
  329.     With main_rsgl_htgl.Adodc1.Recordset
  330.         If .RecordCount > 0 Then
  331.            Text1(0) = .Fields("合同编号")
  332.            Text1(1) = .Fields("员工编号")
  333.            Text1(2) = .Fields("员工姓名")
  334.            DataCombo1 = .Fields("合同类型")
  335.            DTP1.Value = .Fields("合同开始日期")
  336.            DTP2.Value = .Fields("合同结束日期")
  337.            Text1(3) = .Fields("合同期限")
  338.            Text1(5) = .Fields("合同期工资")
  339.            Text1(4) = .Fields("试用期")
  340.            Text1(6) = .Fields("试用期工资")
  341.            Text1(7) = .Fields("备注")
  342.        End If
  343.    End With
  344.   End If
  345. End Sub
  346. Private Sub Command1_Click()
  347.   If IsNumeric(Text1(5)) = False Then
  348.      MsgBox "请输入数字!", , "提示窗口"
  349.      Exit Sub
  350.   End If
  351.   If IsNumeric(Text1(6)) = False Then
  352.      MsgBox "请输入数字!", , "提示窗口"
  353.      Exit Sub
  354.   End If
  355.   If blnAddHT = True Then
  356.     Cnn.Execute ("insert into 合同表(员工编号,员工姓名,合同编号,合同类型,合同开始日期," _
  357.     & "合同结束日期,合同期限,合同期工资,试用期,试用期工资,备注,状态)values('" + Text1(1) + "','" + _
  358.     Text1(2) + "','" + Text1(0) + "','" + DataCombo1 + "','" + str(DTP1.Value) + "','" + _
  359.     str(DTP2.Value) + "','" + Text1(3) + "'," + Text1(5) + ",'" + Text1(4) + "'," + Text1(6) + _
  360.     ",'" + Text1(7) + "','生效')")
  361.   Else
  362.     Cnn.Execute ("update 合同表 set 合同编号='" + Text1(0) + "',合同类型='" + DataCombo1 + _
  363.     "',合同开始日期='" + str(DTP1.Value) + "',合同结束日期='" + str(DTP2.Value) + "',合同期限='" + _
  364.     Text1(3) + "',合同期工资=" + Text1(5) + ",试用期='" + Text1(4) + "',试用期工资=" + Text1(6) + _
  365.     ",备注='" + Text1(7) + "'where 员工编号='" + Text1(1) + "'")
  366.   End If
  367.   main_rsgl_htgl.Adodc1.Refresh
  368.   Unload Me
  369. End Sub
  370. Private Sub Command2_Click()
  371.   Unload Me
  372. End Sub
  373. Private Sub Text1_KeyDown(index As Integer, KeyCode As Integer, Shift As Integer)
  374.   If KeyCode = vbKeyReturn And index = 2 Then DTP1.SetFocus
  375.   If KeyCode = vbKeyReturn And index >= 4 And index < 7 Then Text1(index + 1).SetFocus
  376.   If KeyCode = vbKeyReturn And index = 7 Then Command1.SetFocus
  377. End Sub