⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windepart.pas

📁 考勤管理 考勤管理 考勤管理
💻 PAS
📖 第 1 页 / 共 3 页
字号:
unit Windepart;
//****************************************************************
//*公司名:华夏数码有限公司
//*系统名:考勤管理系统
//*程序名:Windepart
//*
//*--------------------------------------------------------------
//*  [年月日]     [制造者]
//*--------------------------------------------------------------
//*  2005/12/10   徐二芳
//*
//****************************************************************
interface

uses
  System.Drawing, System.Collections, System.ComponentModel,
  System.Windows.Forms, System.Data, System.Resources,clsmain,
  System.Data.OleDb,borland.Vcl.SysUtils;

type
  TWindepart = 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;
    ToolBar1: System.Windows.Forms.ToolBar;
    ImageList1: System.Windows.Forms.ImageList;
    Tbnadd: System.Windows.Forms.ToolBarButton;
    Tbnedit: System.Windows.Forms.ToolBarButton;
    Tbnsave: System.Windows.Forms.ToolBarButton;
    Tbndel: System.Windows.Forms.ToolBarButton;
    ToolBarButton1: System.Windows.Forms.ToolBarButton;
    Tbnexit: System.Windows.Forms.ToolBarButton;
    Label2: System.Windows.Forms.Label;
    Label3: System.Windows.Forms.Label;
    Textname: System.Windows.Forms.TextBox;
    Textbeizhu: System.Windows.Forms.TextBox;
    Label5: System.Windows.Forms.Label;
    TextNameF: System.Windows.Forms.TextBox;
    Butfind: System.Windows.Forms.Button;
    DataGrid1: System.Windows.Forms.DataGrid;
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    procedure InitializeComponent;
    procedure ToolBar1_ButtonClick(sender: System.Object; e: System.Windows.Forms.ToolBarButtonClickEventArgs);
    procedure Label2_Click(sender: System.Object; e: System.EventArgs);
 //   procedure TabPage1_Click(sender: System.Object; e: System.EventArgs);
   // procedure TabControl1_SelectedIndexChanged(sender: System.Object; e: System.EventArgs);
    procedure TWindepart_Load(sender: System.Object; e: System.EventArgs);
    procedure TWindepart_Closed(sender: System.Object; e: System.EventArgs);
    procedure TWindepart_KeyDown(sender: System.Object; e: System.Windows.Forms.KeyEventArgs);
    procedure TWindepart_KeyPress(sender: System.Object; e: System.Windows.Forms.KeyPressEventArgs);
    procedure Butfind_Click(sender: System.Object; e: System.EventArgs);
    procedure DataGrid1_CurrentCellChanged(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_textname: boolean;
  
    function check_textnameF: boolean;
    function Data_Ent: boolean;
    function data_upd: boolean;
    function data_del: boolean;
    function data_get: boolean;
    { Private Declarations }
  public
    constructor Create;
  end;

  [assembly: RuntimeRequiredAttribute(TypeOf(TWindepart))]

implementation
 var
  MyDs:DataSet;
  DGDs:DataSet;
  Flg:string;
{$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 TWindepart.InitializeComponent;
type
  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(TWindepart));
  Self.TabControl1 := System.Windows.Forms.TabControl.Create;
  Self.TabPage1 := System.Windows.Forms.TabPage.Create;
  Self.Textbeizhu := System.Windows.Forms.TextBox.Create;
  Self.Textname := System.Windows.Forms.TextBox.Create;
  Self.Label3 := System.Windows.Forms.Label.Create;
  Self.Label2 := System.Windows.Forms.Label.Create;
  Self.ToolBar1 := System.Windows.Forms.ToolBar.Create;
  Self.Tbnadd := System.Windows.Forms.ToolBarButton.Create;
  Self.Tbnedit := System.Windows.Forms.ToolBarButton.Create;
  Self.Tbnsave := System.Windows.Forms.ToolBarButton.Create;
  Self.Tbndel := System.Windows.Forms.ToolBarButton.Create;
  Self.ToolBarButton1 := System.Windows.Forms.ToolBarButton.Create;
  Self.Tbnexit := System.Windows.Forms.ToolBarButton.Create;
  Self.ImageList1 := System.Windows.Forms.ImageList.Create(Self.components);
  Self.TabPage2 := System.Windows.Forms.TabPage.Create;
  Self.DataGrid1 := System.Windows.Forms.DataGrid.Create;
  Self.Butfind := System.Windows.Forms.Button.Create;
  Self.TextNameF := System.Windows.Forms.TextBox.Create;
  Self.Label5 := System.Windows.Forms.Label.Create;
  Self.TabControl1.SuspendLayout;
  Self.TabPage1.SuspendLayout;
  Self.TabPage2.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(336, 288);
  Self.TabControl1.TabIndex := 0;
  Include(Self.TabControl1.SelectedIndexChanged, Self.TabControl1_SelectedIndexChanged);
  // 
  // TabPage1
  // 
  Self.TabPage1.Controls.Add(Self.Textbeizhu);
  Self.TabPage1.Controls.Add(Self.Textname);
  Self.TabPage1.Controls.Add(Self.Label3);
  Self.TabPage1.Controls.Add(Self.Label2);
  Self.TabPage1.Controls.Add(Self.ToolBar1);
  Self.TabPage1.Location := System.Drawing.Point.Create(4, 21);
  Self.TabPage1.Name := 'TabPage1';
  Self.TabPage1.Size := System.Drawing.Size.Create(328, 263);
  Self.TabPage1.TabIndex := 0;
  Self.TabPage1.Text := '信息维护';
  // 
  // Textbeizhu
  // 
  Self.Textbeizhu.AutoSize := False;
  Self.Textbeizhu.Location := System.Drawing.Point.Create(88, 96);
  Self.Textbeizhu.Name := 'Textbeizhu';
  Self.Textbeizhu.Size := System.Drawing.Size.Create(224, 40);
  Self.Textbeizhu.TabIndex := 6;
  Self.Textbeizhu.Text := '    ';
  // 
  // Textname
  // 
  Self.Textname.Location := System.Drawing.Point.Create(88, 56);
  Self.Textname.Name := 'Textname';
  Self.Textname.TabIndex := 5;
  Self.Textname.Text := ' ';
  // 
  // Label3
  // 
  Self.Label3.Location := System.Drawing.Point.Create(8, 96);
  Self.Label3.Name := 'Label3';
  Self.Label3.TabIndex := 3;
  Self.Label3.Text := ' 备   注:';
  // 
  // Label2
  // 
  Self.Label2.Location := System.Drawing.Point.Create(8, 56);
  Self.Label2.Name := 'Label2';
  Self.Label2.TabIndex := 2;
  Self.Label2.Text := ' 部门名称:';
  Include(Self.Label2.Click, Self.Label2_Click);
  // 
  // ToolBar1
  // 
  Self.ToolBar1.Buttons.AddRange(TSystem_Windows_Forms_ToolBarButtonArray.Create(Self.Tbnadd, 
          Self.Tbnedit, Self.Tbnsave, Self.Tbndel, Self.ToolBarButton1, Self.Tbnexit));
  Self.ToolBar1.DropDownArrows := True;
  Self.ToolBar1.ImageList := Self.ImageList1;
  Self.ToolBar1.Location := System.Drawing.Point.Create(0, 0);
  Self.ToolBar1.Name := 'ToolBar1';
  Self.ToolBar1.ShowToolTips := True;
  Self.ToolBar1.Size := System.Drawing.Size.Create(328, 41);
  Self.ToolBar1.TabIndex := 0;
  Include(Self.ToolBar1.ButtonClick, Self.ToolBar1_ButtonClick);
  // 
  // Tbnadd
  // 
  Self.Tbnadd.ImageIndex := 1;
  Self.Tbnadd.Tag := '1';
  Self.Tbnadd.Text := ' 添加';
  Self.Tbnadd.ToolTipText := '添加';
  // 
  // Tbnedit
  // 
  Self.Tbnedit.ImageIndex := 6;
  Self.Tbnedit.Tag := '2';
  Self.Tbnedit.Text := '修改';
  Self.Tbnedit.ToolTipText := '修改';
  // 
  // Tbnsave
  // 
  Self.Tbnsave.ImageIndex := 0;
  Self.Tbnsave.Tag := '3';
  Self.Tbnsave.Text := '保存';
  Self.Tbnsave.ToolTipText := '保存';
  // 
  // Tbndel
  // 
  Self.Tbndel.ImageIndex := 3;
  Self.Tbndel.Tag := ' 4';
  Self.Tbndel.Text := '删除';
  Self.Tbndel.ToolTipText := '删除';
  // 
  // ToolBarButton1
  // 
  Self.ToolBarButton1.Style := System.Windows.Forms.ToolBarButtonStyle.Separator;
  Self.ToolBarButton1.Tag := ' ';
  // 
  // Tbnexit
  // 
  Self.Tbnexit.ImageIndex := 5;
  Self.Tbnexit.Tag := '5';
  Self.Tbnexit.Text := '退出';
  Self.Tbnexit.ToolTipText := '退出';
  // 
  // ImageList1
  // 
  Self.ImageList1.ImageSize := System.Drawing.Size.Create(16, 16);
  Self.ImageList1.ImageStream := (System.Windows.Forms.ImageListStreamer(resources.GetObject('ImageList1.ImageStream')));
  Self.ImageList1.TransparentColor := System.Drawing.Color.Transparent;
  // 
  // TabPage2
  // 
  Self.TabPage2.Controls.Add(Self.DataGrid1);
  Self.TabPage2.Controls.Add(Self.Butfind);
  Self.TabPage2.Controls.Add(Self.TextNameF);
  Self.TabPage2.Controls.Add(Self.Label5);
  Self.TabPage2.Location := System.Drawing.Point.Create(4, 21);
  Self.TabPage2.Name := 'TabPage2';
  Self.TabPage2.Size := System.Drawing.Size.Create(328, 263);
  Self.TabPage2.TabIndex := 1;
  Self.TabPage2.Text := '信息查询';
  // 
  // DataGrid1
  // 
  Self.DataGrid1.AllowSorting := False;
  Self.DataGrid1.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.DataGrid1.DataMember := '';
  Self.DataGrid1.HeaderForeColor := System.Drawing.SystemColors.ControlText;
  Self.DataGrid1.Location := System.Drawing.Point.Create(8, 48);
  Self.DataGrid1.Name := 'DataGrid1';
  Self.DataGrid1.ReadOnly := True;
  Self.DataGrid1.Size := System.Drawing.Size.Create(320, 200);
  Self.DataGrid1.TabIndex := 5;
  Include(Self.DataGrid1.CurrentCellChanged, Self.DataGrid1_CurrentCellChanged);
  // 
  // Butfind
  // 
  Self.Butfind.Location := System.Drawing.Point.Create(224, 8);
  Self.Butfind.Name := 'Butfind';
  Self.Butfind.Size := System.Drawing.Size.Create(75, 32);
  Self.Butfind.TabIndex := 4;
  Self.Butfind.Text := '信息查询';
  Include(Self.Butfind.Click, Self.Butfind_Click);
  // 
  // TextNameF
  // 
  Self.TextNameF.Location := System.Drawing.Point.Create(72, 8);
  Self.TextNameF.Name := 'TextNameF';
  Self.TextNameF.Size := System.Drawing.Size.Create(128, 21);
  Self.TextNameF.TabIndex := 3;
  Self.TextNameF.Text := ' ';

  // 
  // Label5
  // 
  Self.Label5.Location := System.Drawing.Point.Create(0, 16);
  Self.Label5.Name := 'Label5';
  Self.Label5.Size := System.Drawing.Size.Create(104, 23);
  Self.Label5.TabIndex := 1;
  Self.Label5.Text := ' 部门名称:';
  // 
  // TWindepart
  // 
  Self.AutoScaleBaseSize := System.Drawing.Size.Create(6, 14);
  Self.ClientSize := System.Drawing.Size.Create(336, 285);
  Self.Controls.Add(Self.TabControl1);
  Self.FormBorderStyle := System.Windows.Forms.FormBorderStyle.FixedSingle;
  Self.Icon := (System.Drawing.Icon(resources.GetObject('$this.Icon')));
  Self.KeyPreview := True;
  Self.Name := 'TWindepart';
  Self.Text := '部门管理';
  Include(Self.KeyDown, Self.TWindepart_KeyDown);
  Include(Self.KeyPress, Self.TWindepart_KeyPress);
  Include(Self.Load, Self.TWindepart_Load);
  Include(Self.Closed, Self.TWindepart_Closed);
  Self.TabControl1.ResumeLayout(False);
  Self.TabPage1.ResumeLayout(False);
  Self.TabPage2.ResumeLayout(False);
  (System.ComponentModel.ISupportInitialize(Self.DataGrid1)).EndInit;
  Self.ResumeLayout(False);
end;
{$ENDREGION}

procedure TWindepart.Dispose(Disposing: Boolean);
begin
  if Disposing then
  begin
    if Components <> nil then
      Components.Dispose();
  end;
  inherited Dispose(Disposing);
end;

constructor TWindepart.Create;
begin
  inherited Create;
  //
  // Required for Windows Form Designer support
  //
  InitializeComponent;
  //
  // TODO: Add any constructor code after InitializeComponent call
  //
end;





//****************************************************************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -