📄 winuser.~pas
字号:
unit Winuser;
//****************************************************************
//*公司名:华夏数码有限公司
//*系统名:考勤管理系统
//*程序名:WinUser
//*
//*--------------------------------------------------------------
//* [年月日] [制造者]
//*--------------------------------------------------------------
//* 2005/12/06 徐二芳
//*
//****************************************************************
interface
uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data, System.Resources,clsmain,
system.Data.oledb,borland.Vcl.SysUtils;
type
TWinuser = 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;
Label1: System.Windows.Forms.Label;
Label2: System.Windows.Forms.Label;
Label3: System.Windows.Forms.Label;
Textuser: System.Windows.Forms.TextBox;
Textpass: System.Windows.Forms.TextBox;
Cmbquanxian: System.Windows.Forms.ComboBox;
Label4: System.Windows.Forms.Label;
Label5: System.Windows.Forms.Label;
label6: System.Windows.Forms.Label;
textuserF: System.Windows.Forms.TextBox;
TextpassF: System.Windows.Forms.TextBox;
CmbquanxianF: System.Windows.Forms.ComboBox;
DataGrid1: System.Windows.Forms.DataGrid;
Butfind: System.Windows.Forms.Button;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
procedure TWinuser_Load(sender: System.Object; e: System.EventArgs);
// procedure TabPage2_Click(sender: System.Object; e: System.EventArgs);
procedure TWinuser_Closed(sender: System.Object; e: System.EventArgs);
procedure TWinuser_KeyDown(sender: System.Object; e: System.Windows.Forms.KeyEventArgs);
procedure TWinuser_KeyPress(sender: System.Object; e: System.Windows.Forms.KeyPressEventArgs);
procedure ToolBar1_ButtonClick(sender: System.Object; e: System.Windows.Forms.ToolBarButtonClickEventArgs);
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);
procedure Label5_Click(sender: System.Object; e: System.EventArgs);
procedure DataGrid1_Navigate(sender: System.Object; ne: System.Windows.Forms.NavigateEventArgs);
procedure TabPage2_Click(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 Check_CmbQuanXian: Boolean;
function Check_TextUserF: Boolean;
function Check_TextPass: Boolean;
function Check_TextPassF: Boolean;
function Check_TextUser: Boolean;
function Item_CheckF: Boolean;
function Item_Check: 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(TWinuser))]
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 TWinuser.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(TWinuser));
Self.TabControl1 := System.Windows.Forms.TabControl.Create;
Self.TabPage1 := System.Windows.Forms.TabPage.Create;
Self.Butfind := System.Windows.Forms.Button.Create;
Self.DataGrid1 := System.Windows.Forms.DataGrid.Create;
Self.CmbquanxianF := System.Windows.Forms.ComboBox.Create;
Self.TextpassF := System.Windows.Forms.TextBox.Create;
Self.textuserF := System.Windows.Forms.TextBox.Create;
Self.label6 := System.Windows.Forms.Label.Create;
Self.Label5 := System.Windows.Forms.Label.Create;
Self.Label4 := System.Windows.Forms.Label.Create;
Self.TabPage2 := System.Windows.Forms.TabPage.Create;
Self.Cmbquanxian := System.Windows.Forms.ComboBox.Create;
Self.Textpass := System.Windows.Forms.TextBox.Create;
Self.Textuser := System.Windows.Forms.TextBox.Create;
Self.Label3 := System.Windows.Forms.Label.Create;
Self.Label2 := System.Windows.Forms.Label.Create;
Self.Label1 := 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.TabControl1.SuspendLayout;
Self.TabPage1.SuspendLayout;
(System.ComponentModel.ISupportInitialize(Self.DataGrid1)).BeginInit;
Self.TabPage2.SuspendLayout;
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(352, 280);
Self.TabControl1.TabIndex := 0;
Include(Self.TabControl1.SelectedIndexChanged, Self.TabControl1_SelectedIndexChanged);
//
// TabPage1
//
Self.TabPage1.Controls.Add(Self.Butfind);
Self.TabPage1.Controls.Add(Self.DataGrid1);
Self.TabPage1.Controls.Add(Self.CmbquanxianF);
Self.TabPage1.Controls.Add(Self.TextpassF);
Self.TabPage1.Controls.Add(Self.textuserF);
Self.TabPage1.Controls.Add(Self.label6);
Self.TabPage1.Controls.Add(Self.Label5);
Self.TabPage1.Controls.Add(Self.Label4);
Self.TabPage1.Location := System.Drawing.Point.Create(4, 21);
Self.TabPage1.Name := 'TabPage1';
Self.TabPage1.Size := System.Drawing.Size.Create(344, 255);
Self.TabPage1.TabIndex := 0;
Self.TabPage1.Text := '信息查询';
//
// Butfind
//
Self.Butfind.Location := System.Drawing.Point.Create(232, 64);
Self.Butfind.Name := 'Butfind';
Self.Butfind.TabIndex := 7;
Self.Butfind.Text := '信息查询';
Include(Self.Butfind.Click, Self.Butfind_Click);
//
// 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(0, 96);
Self.DataGrid1.Name := 'DataGrid1';
Self.DataGrid1.ReadOnly := True;
Self.DataGrid1.Size := System.Drawing.Size.Create(344, 152);
Self.DataGrid1.TabIndex := 6;
Include(Self.DataGrid1.Navigate, Self.DataGrid1_Navigate);
Include(Self.DataGrid1.CurrentCellChanged, Self.DataGrid1_CurrentCellChanged);
//
// CmbquanxianF
//
Self.CmbquanxianF.Items.AddRange(TSystem_ObjectArray.Create('', '高级用户', '普通用户'));
Self.CmbquanxianF.Location := System.Drawing.Point.Create(56, 64);
Self.CmbquanxianF.Name := 'CmbquanxianF';
Self.CmbquanxianF.Size := System.Drawing.Size.Create(104, 20);
Self.CmbquanxianF.TabIndex := 6;
Self.CmbquanxianF.Text := ' ';
//
// TextpassF
//
Self.TextpassF.Location := System.Drawing.Point.Create(56, 32);
Self.TextpassF.Name := 'TextpassF';
Self.TextpassF.TabIndex := 5;
Self.TextpassF.Text := ' ';
//
// textuserF
//
Self.textuserF.Location := System.Drawing.Point.Create(56, 8);
Self.textuserF.Name := 'textuserF';
Self.textuserF.TabIndex := 4;
Self.textuserF.Text := ' ';
//
// label6
//
Self.label6.Location := System.Drawing.Point.Create(8, 64);
Self.label6.Name := 'label6';
Self.label6.TabIndex := 2;
Self.label6.Text := '权 限:';
//
// Label5
//
Self.Label5.Location := System.Drawing.Point.Create(8, 32);
Self.Label5.Name := 'Label5';
Self.Label5.TabIndex := 1;
Self.Label5.Text := '密 码:';
Include(Self.Label5.Click, Self.Label5_Click);
//
// Label4
//
Self.Label4.Location := System.Drawing.Point.Create(8, 8);
Self.Label4.Name := 'Label4';
Self.Label4.TabIndex := 0;
Self.Label4.Text := '用户名:';
//
// TabPage2
//
Self.TabPage2.Controls.Add(Self.Cmbquanxian);
Self.TabPage2.Controls.Add(Self.Textpass);
Self.TabPage2.Controls.Add(Self.Textuser);
Self.TabPage2.Controls.Add(Self.Label3);
Self.TabPage2.Controls.Add(Self.Label2);
Self.TabPage2.Controls.Add(Self.Label1);
Self.TabPage2.Controls.Add(Self.ToolBar1);
Self.TabPage2.Location := System.Drawing.Point.Create(4, 21);
Self.TabPage2.Name := 'TabPage2';
Self.TabPage2.Size := System.Drawing.Size.Create(344, 255);
Self.TabPage2.TabIndex := 1;
Self.TabPage2.Text := '信息维护';
Include(Self.TabPage2.Click, Self.TabPage2_Click);
//
// Cmbquanxian
//
Self.Cmbquanxian.Items.AddRange(TSystem_ObjectArray.Create('', '普通用户', '高级用户'));
Self.Cmbquanxian.Location := System.Drawing.Point.Create(80, 112);
Self.Cmbquanxian.Name := 'Cmbquanxian';
Self.Cmbquanxian.Size := System.Drawing.Size.Create(104, 20);
Self.Cmbquanxian.TabIndex := 3;
Self.Cmbquanxian.Text := ' ';
//
// Textpass
//
Self.Textpass.Location := System.Drawing.Point.Create(80, 80);
Self.Textpass.Name := 'Textpass';
Self.Textpass.TabIndex := 2;
Self.Textpass.Text := ' ';
//
// Textuser
//
Self.Textuser.Location := System.Drawing.Point.Create(80, 48);
Self.Textuser.Name := 'Textuser';
Self.Textuser.TabIndex := 1;
Self.Textuser.Text := ' ';
//
// Label3
//
Self.Label3.Location := System.Drawing.Point.Create(8, 112);
Self.Label3.Name := 'Label3';
Self.Label3.TabIndex := 3;
Self.Label3.Text := '权 限:';
//
// Label2
//
Self.Label2.Location := System.Drawing.Point.Create(8, 80);
Self.Label2.Name := 'Label2';
Self.Label2.TabIndex := 2;
Self.Label2.Text := '密 码:';
//
// Label1
//
Self.Label1.Location := System.Drawing.Point.Create(8, 48);
Self.Label1.Name := 'Label1';
Self.Label1.TabIndex := 1;
Self.Label1.Text := '用户名:';
//
// 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(344, 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 := 4;
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 := 2;
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 := 3;
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;
//
// TWinuser
//
Self.AutoScaleBaseSize := System.Drawing.Size.Create(6, 14);
Self.ClientSize := System.Drawing.Size.Create(344, 273);
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 := 'TWinuser';
Self.Text := '用户管理';
Include(Self.KeyDown, Self.TWinuser_KeyDown);
Include(Self.KeyPress, Self.TWinuser_KeyPress);
Include(Self.Load, Self.TWinuser_Load);
Include(Self.Closed, Self.TWinuser_Closed);
Self.TabControl1.ResumeLayout(False);
Self.TabPage1.ResumeLayout(False);
(System.ComponentModel.ISupportInitialize(Self.DataGrid1)).EndInit;
Self.TabPage2.ResumeLayout(False);
Self.ResumeLayout(False);
end;
{$ENDREGION}
procedure TWinuser.Dispose(Disposing: Boolean);
begin
if Disposing then
begin
if Components <> nil then
Components.Dispose();
end;
inherited Dispose(Disposing);
end;
constructor TWinuser.Create;
begin
inherited Create;
//
// Required for Windows Form Designer support
//
InitializeComponent;
//
// TODO: Add any constructor code after InitializeComponent call
//
end;
procedure TWinuser.TabPage2_Click(sender: System.Object; e: System.EventArgs);
begin
end;
procedure TWinuser.DataGrid1_Navigate(sender: System.Object; ne: System.Windows.Forms.NavigateEventArgs);
begin
end;
procedure TWinuser.Label5_Click(sender: System.Object; e: System.EventArgs);
begin
end;
//****************************************************************
//* 窗体加载 [Load]
//*
//* [参数]
//* 1:系统参数
//* 2:系统参数
//* [返回]
//* 无
//****************************************************************
procedure TWinuser.TWinuser_Load(sender: System.Object; e: System.EventArgs);
begin
try
//设置各个控件初始值
clsmain.WinUserShowFla:=true;
//设置控件初始化
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -