📄 winchuqin.pas
字号:
unit Winchuqin;
//****************************************************************
//*公司名:华夏数码有限公司
//*系统名:考勤管理系统
//*程序名:Winchuqin
//*
//*--------------------------------------------------------------
//* [年月日] [制造者]
//*--------------------------------------------------------------
//* 2005/12/25 徐二芳
//*
//****************************************************************
interface
uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data, System.Resources,clsmain, System.Data.OleDb,borland.Vcl.SysUtils;
var
w_SQL:String;
w_SQLWhere:String;
w_dtpriqiF:String;
w_cmbbumenF:string;
w_cmbbianhaoF:string;
w_cmbnameF:string;
type
TWinchuqin = class(System.Windows.Forms.Form)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
components: System.ComponentModel.IContainer;
TabControl1: System.Windows.Forms.TabControl;
TabPage1: System.Windows.Forms.TabPage;
TabPage2: System.Windows.Forms.TabPage;
butfind: System.Windows.Forms.Button;
DataGrid1: System.Windows.Forms.DataGrid;
ImageList1: System.Windows.Forms.ImageList;
ToolBar2: System.Windows.Forms.ToolBar;
tbnedit: System.Windows.Forms.ToolBarButton;
tbnsave: System.Windows.Forms.ToolBarButton;
ToolBarButton1: System.Windows.Forms.ToolBarButton;
ToolBarButton2: System.Windows.Forms.ToolBarButton;
Label1: System.Windows.Forms.Label;
Label2: System.Windows.Forms.Label;
Label5: System.Windows.Forms.Label;
Label6: System.Windows.Forms.Label;
Label7: System.Windows.Forms.Label;
Label8: System.Windows.Forms.Label;
Label9: System.Windows.Forms.Label;
Label10: System.Windows.Forms.Label;
Label11: System.Windows.Forms.Label;
Label12: System.Windows.Forms.Label;
Label13: System.Windows.Forms.Label;
txtbianhao: System.Windows.Forms.TextBox;
txtbumen: System.Windows.Forms.TextBox;
dtpriqi: System.Windows.Forms.DateTimePicker;
txtname: System.Windows.Forms.TextBox;
dtpup: System.Windows.Forms.DateTimePicker;
Dtpdown: System.Windows.Forms.DateTimePicker;
cmbqingjia: System.Windows.Forms.ComboBox;
cmbchuchai: System.Windows.Forms.ComboBox;
dtpQingJia: System.Windows.Forms.DateTimePicker;
dtpJiaBan: System.Windows.Forms.DateTimePicker;
txtbeizhu: System.Windows.Forms.TextBox;
GroupBox1: System.Windows.Forms.GroupBox;
Label3: System.Windows.Forms.Label;
Label4: System.Windows.Forms.Label;
Label14: System.Windows.Forms.Label;
Label15: System.Windows.Forms.Label;
ckbChidao: System.Windows.Forms.CheckBox;
ckbzaotui: System.Windows.Forms.CheckBox;
ckbjiaban: System.Windows.Forms.CheckBox;
ckbchuchai: System.Windows.Forms.CheckBox;
ckbqingjia: System.Windows.Forms.CheckBox;
cmbbumenF: System.Windows.Forms.ComboBox;
cmbbianhaoF: System.Windows.Forms.ComboBox;
cmbnameF: System.Windows.Forms.ComboBox;
dtpriqiF: System.Windows.Forms.DateTimePicker;
CheckBox1: System.Windows.Forms.CheckBox;
dtpchuqinF: System.Windows.Forms.DateTimePicker;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
procedure TWinchuqin_Load(sender: System.Object; e: System.EventArgs);
procedure TWinchuqin_Closed(sender: System.Object; e: System.EventArgs);
procedure TabControl1_KeyDown(sender: System.Object; e: System.Windows.Forms.KeyEventArgs);
procedure TabControl1_KeyPress(sender: System.Object; e: System.Windows.Forms.KeyPressEventArgs);
procedure ToolBar2_ButtonClick(sender: System.Object; e: System.Windows.Forms.ToolBarButtonClickEventArgs);
procedure cmbqingjia_SelectedIndexChanged(sender: System.Object; e: System.EventArgs);
procedure butfind_Click(sender: System.Object; e: System.EventArgs);
procedure DataGrid1_CurrentCellChanged(sender: System.Object; e: System.EventArgs);
procedure CheckBox1_CheckedChanged(sender: System.Object; e: System.EventArgs);
procedure dtpQingJia_ValueChanged(sender: System.Object; e: System.EventArgs);
procedure TabControl1_SelectedIndexChanged(sender: System.Object; e: System.EventArgs);
{$ENDREGION}
strict protected
/// <summary>
/// Clean up any resources being used.
/// </summary>
procedure Dispose(Disposing: Boolean); override;
private
procedure item_clear;
procedure RefreshEnabled(NThis, NOther: Boolean);
function item_check():boolean;
function Item_CheckF():boolean;
function check_cmbbianhaoF():boolean;
function Check_DtpUpDownWork():boolean;
function Check_Txtbeizhu:boolean;
function data_upd():boolean;
function data_get():boolean;
{ Private Declarations }
public
constructor Create;
end;
[assembly: RuntimeRequiredAttribute(TypeOf(TWinchuqin))]
implementation
var
flg:string;
dgds:dataset;
myds:dataset;
{$REGION 'Windows Form Designer generated code'}
/// <summary>
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure TWinchuqin.InitializeComponent;
type
TSystem_ObjectArray = array of System.Object;
TSystem_Windows_Forms_ToolBarButtonArray = array of System.Windows.Forms.ToolBarButton;
var
resources: System.Resources.ResourceManager;
begin
Self.components := System.ComponentModel.Container.Create;
resources := System.Resources.ResourceManager.Create(TypeOf(TWinchuqin));
Self.TabControl1 := System.Windows.Forms.TabControl.Create;
Self.TabPage1 := System.Windows.Forms.TabPage.Create;
Self.Label9 := System.Windows.Forms.Label.Create;
Self.Dtpdown := System.Windows.Forms.DateTimePicker.Create;
Self.txtbeizhu := System.Windows.Forms.TextBox.Create;
Self.dtpJiaBan := System.Windows.Forms.DateTimePicker.Create;
Self.dtpQingJia := System.Windows.Forms.DateTimePicker.Create;
Self.cmbchuchai := System.Windows.Forms.ComboBox.Create;
Self.cmbqingjia := System.Windows.Forms.ComboBox.Create;
Self.dtpup := System.Windows.Forms.DateTimePicker.Create;
Self.txtname := System.Windows.Forms.TextBox.Create;
Self.dtpriqi := System.Windows.Forms.DateTimePicker.Create;
Self.txtbumen := System.Windows.Forms.TextBox.Create;
Self.txtbianhao := System.Windows.Forms.TextBox.Create;
Self.Label13 := System.Windows.Forms.Label.Create;
Self.Label8 := System.Windows.Forms.Label.Create;
Self.Label10 := System.Windows.Forms.Label.Create;
Self.Label11 := System.Windows.Forms.Label.Create;
Self.Label12 := System.Windows.Forms.Label.Create;
Self.Label7 := System.Windows.Forms.Label.Create;
Self.Label6 := System.Windows.Forms.Label.Create;
Self.Label5 := System.Windows.Forms.Label.Create;
Self.Label2 := System.Windows.Forms.Label.Create;
Self.Label1 := System.Windows.Forms.Label.Create;
Self.ToolBar2 := System.Windows.Forms.ToolBar.Create;
Self.tbnedit := System.Windows.Forms.ToolBarButton.Create;
Self.tbnsave := System.Windows.Forms.ToolBarButton.Create;
Self.ToolBarButton1 := System.Windows.Forms.ToolBarButton.Create;
Self.ToolBarButton2 := System.Windows.Forms.ToolBarButton.Create;
Self.ImageList1 := System.Windows.Forms.ImageList.Create(Self.components);
Self.TabPage2 := System.Windows.Forms.TabPage.Create;
Self.dtpchuqinF := System.Windows.Forms.DateTimePicker.Create;
Self.CheckBox1 := System.Windows.Forms.CheckBox.Create;
Self.GroupBox1 := System.Windows.Forms.GroupBox.Create;
Self.dtpriqiF := System.Windows.Forms.DateTimePicker.Create;
Self.cmbnameF := System.Windows.Forms.ComboBox.Create;
Self.cmbbianhaoF := System.Windows.Forms.ComboBox.Create;
Self.cmbbumenF := System.Windows.Forms.ComboBox.Create;
Self.ckbqingjia := System.Windows.Forms.CheckBox.Create;
Self.ckbchuchai := System.Windows.Forms.CheckBox.Create;
Self.ckbjiaban := System.Windows.Forms.CheckBox.Create;
Self.ckbzaotui := System.Windows.Forms.CheckBox.Create;
Self.ckbChidao := System.Windows.Forms.CheckBox.Create;
Self.Label15 := System.Windows.Forms.Label.Create;
Self.Label14 := System.Windows.Forms.Label.Create;
Self.Label4 := System.Windows.Forms.Label.Create;
Self.Label3 := System.Windows.Forms.Label.Create;
Self.DataGrid1 := System.Windows.Forms.DataGrid.Create;
Self.butfind := System.Windows.Forms.Button.Create;
Self.TabControl1.SuspendLayout;
Self.TabPage1.SuspendLayout;
Self.TabPage2.SuspendLayout;
Self.GroupBox1.SuspendLayout;
(System.ComponentModel.ISupportInitialize(Self.DataGrid1)).BeginInit;
Self.SuspendLayout;
//
// TabControl1
//
Self.TabControl1.Anchor := (System.Windows.Forms.AnchorStyles((((System.Windows.Forms.AnchorStyles.Top
or System.Windows.Forms.AnchorStyles.Bottom) or System.Windows.Forms.AnchorStyles.Left)
or System.Windows.Forms.AnchorStyles.Right)));
Self.TabControl1.Controls.Add(Self.TabPage1);
Self.TabControl1.Controls.Add(Self.TabPage2);
Self.TabControl1.Location := System.Drawing.Point.Create(0, 0);
Self.TabControl1.Name := 'TabControl1';
Self.TabControl1.SelectedIndex := 0;
Self.TabControl1.Size := System.Drawing.Size.Create(424, 368);
Self.TabControl1.TabIndex := 0;
Include(Self.TabControl1.KeyPress, Self.TabControl1_KeyPress);
Include(Self.TabControl1.KeyDown, Self.TabControl1_KeyDown);
Include(Self.TabControl1.SelectedIndexChanged, Self.TabControl1_SelectedIndexChanged);
//
// TabPage1
//
Self.TabPage1.Controls.Add(Self.Label9);
Self.TabPage1.Controls.Add(Self.Dtpdown);
Self.TabPage1.Controls.Add(Self.txtbeizhu);
Self.TabPage1.Controls.Add(Self.dtpJiaBan);
Self.TabPage1.Controls.Add(Self.dtpQingJia);
Self.TabPage1.Controls.Add(Self.cmbchuchai);
Self.TabPage1.Controls.Add(Self.cmbqingjia);
Self.TabPage1.Controls.Add(Self.dtpup);
Self.TabPage1.Controls.Add(Self.txtname);
Self.TabPage1.Controls.Add(Self.dtpriqi);
Self.TabPage1.Controls.Add(Self.txtbumen);
Self.TabPage1.Controls.Add(Self.txtbianhao);
Self.TabPage1.Controls.Add(Self.Label13);
Self.TabPage1.Controls.Add(Self.Label8);
Self.TabPage1.Controls.Add(Self.Label10);
Self.TabPage1.Controls.Add(Self.Label11);
Self.TabPage1.Controls.Add(Self.Label12);
Self.TabPage1.Controls.Add(Self.Label7);
Self.TabPage1.Controls.Add(Self.Label6);
Self.TabPage1.Controls.Add(Self.Label5);
Self.TabPage1.Controls.Add(Self.Label2);
Self.TabPage1.Controls.Add(Self.Label1);
Self.TabPage1.Controls.Add(Self.ToolBar2);
Self.TabPage1.Location := System.Drawing.Point.Create(4, 21);
Self.TabPage1.Name := 'TabPage1';
Self.TabPage1.Size := System.Drawing.Size.Create(416, 343);
Self.TabPage1.TabIndex := 0;
Self.TabPage1.Text := '信息维护';
//
// Label9
//
Self.Label9.Location := System.Drawing.Point.Create(208, 160);
Self.Label9.Name := 'Label9';
Self.Label9.Size := System.Drawing.Size.Create(64, 24);
Self.Label9.TabIndex := 32;
Self.Label9.Text := '请假时间:';
//
// Dtpdown
//
Self.Dtpdown.CustomFormat := 'HH:mm';
Self.Dtpdown.Format := System.Windows.Forms.DateTimePickerFormat.Custom;
Self.Dtpdown.Location := System.Drawing.Point.Create(272, 120);
Self.Dtpdown.Name := 'Dtpdown';
Self.Dtpdown.ShowUpDown := True;
Self.Dtpdown.Size := System.Drawing.Size.Create(128, 21);
Self.Dtpdown.TabIndex := 31;
//
// txtbeizhu
//
Self.txtbeizhu.AutoSize := False;
Self.txtbeizhu.Location := System.Drawing.Point.Create(80, 224);
Self.txtbeizhu.Name := 'txtbeizhu';
Self.txtbeizhu.Size := System.Drawing.Size.Create(320, 48);
Self.txtbeizhu.TabIndex := 30;
Self.txtbeizhu.Text := 'TextBox4';
//
// dtpJiaBan
//
Self.dtpJiaBan.CustomFormat := 'HH:mm';
Self.dtpJiaBan.Format := System.Windows.Forms.DateTimePickerFormat.Custom;
Self.dtpJiaBan.Location := System.Drawing.Point.Create(80, 192);
Self.dtpJiaBan.Name := 'dtpJiaBan';
Self.dtpJiaBan.ShowUpDown := True;
Self.dtpJiaBan.Size := System.Drawing.Size.Create(120, 21);
Self.dtpJiaBan.TabIndex := 29;
//
// dtpQingJia
//
Self.dtpQingJia.CustomFormat := 'HH:mm';
Self.dtpQingJia.Format := System.Windows.Forms.DateTimePickerFormat.Custom;
Self.dtpQingJia.Location := System.Drawing.Point.Create(272, 152);
Self.dtpQingJia.Name := 'dtpQingJia';
Self.dtpQingJia.ShowUpDown := True;
Self.dtpQingJia.Size := System.Drawing.Size.Create(128, 21);
Self.dtpQingJia.TabIndex := 28;
Include(Self.dtpQingJia.ValueChanged, Self.dtpQingJia_ValueChanged);
//
// cmbchuchai
//
Self.cmbchuchai.Items.AddRange(TSystem_ObjectArray.Create('', '出差'));
Self.cmbchuchai.Location := System.Drawing.Point.Create(272, 192);
Self.cmbchuchai.Name := 'cmbchuchai';
Self.cmbchuchai.Size := System.Drawing.Size.Create(128, 20);
Self.cmbchuchai.TabIndex := 27;
Self.cmbchuchai.Text := 'ComboBox2';
//
// cmbqingjia
//
Self.cmbqingjia.Enabled := False;
Self.cmbqingjia.Items.AddRange(TSystem_ObjectArray.Create('', '事假', '病假'));
Self.cmbqingjia.Location := System.Drawing.Point.Create(80, 160);
Self.cmbqingjia.Name := 'cmbqingjia';
Self.cmbqingjia.Size := System.Drawing.Size.Create(120, 20);
Self.cmbqingjia.TabIndex := 26;
Self.cmbqingjia.Text := 'ComboBox1';
Include(Self.cmbqingjia.SelectedIndexChanged, Self.cmbqingjia_SelectedIndexChanged);
//
// dtpup
//
Self.dtpup.CustomFormat := 'HH:mm';
Self.dtpup.Format := System.Windows.Forms.DateTimePickerFormat.Custom;
Self.dtpup.Location := System.Drawing.Point.Create(80, 120);
Self.dtpup.Name := 'dtpup';
Self.dtpup.ShowUpDown := True;
Self.dtpup.Size := System.Drawing.Size.Create(120, 21);
Self.dtpup.TabIndex := 24;
//
// txtname
//
Self.txtname.Location := System.Drawing.Point.Create(272, 48);
Self.txtname.Name := 'txtname';
Self.txtname.Size := System.Drawing.Size.Create(128, 21);
Self.txtname.TabIndex := 23;
Self.txtname.Text := ' ';
//
// dtpriqi
//
Self.dtpriqi.CustomFormat := 'yyyy-MM-dd ';
Self.dtpriqi.Format := System.Windows.Forms.DateTimePickerFormat.Custom;
Self.dtpriqi.Location := System.Drawing.Point.Create(272, 80);
Self.dtpriqi.Name := 'dtpriqi';
Self.dtpriqi.Size := System.Drawing.Size.Create(128, 21);
Self.dtpriqi.TabIndex := 22;
Self.dtpriqi.Value := System.DateTime.Create(2005, 12, 26, 0, 0, 0, 0);
//
// txtbumen
//
Self.txtbumen.Location := System.Drawing.Point.Create(80, 80);
Self.txtbumen.Name := 'txtbumen';
Self.txtbumen.Size := System.Drawing.Size.Create(120, 21);
Self.txtbumen.TabIndex := 21;
Self.txtbumen.Text := ' ';
//
// txtbianhao
//
Self.txtbianhao.Location := System.Drawing.Point.Create(80, 48);
Self.txtbianhao.Name := 'txtbianhao';
Self.txtbianhao.Size := System.Drawing.Size.Create(120, 21);
Self.txtbianhao.TabIndex := 19;
Self.txtbianhao.Text := ' ';
//
// Label13
//
Self.Label13.Location := System.Drawing.Point.Create(16, 224);
Self.Label13.Name := 'Label13';
Self.Label13.TabIndex := 18;
Self.Label13.Text := '备 注:';
//
// Label8
//
Self.Label8.Location := System.Drawing.Point.Create(208, 192);
Self.Label8.Name := 'Label8';
Self.Label8.Size := System.Drawing.Size.Create(96, 23);
Self.Label8.TabIndex := 17;
Self.Label8.Text := '是否出差:';
//
// Label10
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -