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

📄 unit6.~pas

📁 一个完整的工资管理系统 主要走查询 添加 删除 管理等功能
💻 ~PAS
字号:
unit Unit6;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, StdCtrls;

type
  TForm6 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Edit2: TEdit;
    ComboBox1: TComboBox;
    Edit1: TEdit;
    ComboBox2: TComboBox;
    ComboBox3: TComboBox;
    Edit3: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    DBGrid1: TDBGrid;
    procedure Button3Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form6: TForm6;

implementation

uses Unit1, Unit2, Unit3, Unit4, Unit5, Unit10, Unit11, Unit7, Unit8,
  Unit9;

{$R *.dfm}

procedure TForm6.Button3Click(Sender: TObject);
begin
form6.Close;
end;

procedure TForm6.FormCreate(Sender: TObject);
begin
ComboBox1.Items.Add('A1级');
ComboBox1.Items.Add('A2级');
ComboBox1.Items.Add('A3级');
ComboBox1.Items.Add('B1级');
ComboBox1.Items.Add('B2级');
ComboBox1.Items.Add('B3级');
ComboBox1.Items.Add('C1级');
ComboBox1.Items.Add('C2级');
ComboBox1.Items.Add('C3级');
ComboBox2.Items.Add('20000');
ComboBox2.Items.Add('15000');
ComboBox2.Items.Add('10000');
ComboBox2.Items.Add('9000');
ComboBox2.Items.Add('5000');
ComboBox2.Items.Add('4000');
ComboBox2.Items.Add('3000');
ComboBox2.Items.Add('1000');
ComboBox3.Items.Add('800');
ComboBox3.Items.Add('1000');
ComboBox3.Items.Add('1200');
ComboBox3.Items.Add('2000');
ComboBox3.Items.Add('3000');
ComboBox3.Items.Add('4000');
dm.ADOTable2.Close;
 dm.ADOTable2.TableName:='zhiwuxinxi';
 dm.ADOTable2.Active:=true;
 dbgrid1.Columns[0].FieldName:='职务代码';
  dbgrid1.Columns[1].FieldName:='职务名称';
  dbgrid1.Columns[2].FieldName:='工资等级id';
  dbgrid1.Columns[3].FieldName:='工资上限';
  dbgrid1.Columns[4].FieldName:='工资下限';
  dbgrid1.Columns[5].FieldName:='简介';
end;

procedure TForm6.Button1Click(Sender: TObject);
begin
  if edit1.Text<>'' then
begin
if edit2.Text<>'' then
begin
 with dm.ADODataSet1 do
      begin
        //验证登陆用户合法性
        close;
        CommandText:='select * from zhiwuxinxi where 职务代码='''+edit1.Text+'''';
        open;
 if isempty then
  begin
 dm.ADODataSet1.Close;
with dm.ADOTable2 do
begin
dm.ADOTable2.Active:=false;
dm.ADOTable2.TableName:='zhiwuxinxi';
 dm.ADOTable2.Active:=true;
Append;
FieldByName('职务代码').AsString:=edit1.Text;
FieldByName('职务名称').AsString:=edit2.Text;
FieldByName('工资等级id').AsString:=ComboBox1.Text;
FieldByName('工资上限').AsString:=ComboBox2.Text;
FieldByName('工资下限').AsString:=ComboBox3.Text;
FieldByName('简介').AsString:=edit3.Text;
post;
end
end
else
begin
 application.MessageBox('对不起,职务代码不允许重复!!','错误',mb_iconhand+mb_yesno);
  edit1.Text:='';
  edit1.SetFocus;
 end
end
end

else
begin
application.MessageBox('职务名称不能为空!!','错误',mb_iconhand+mb_yesno);
end
end
else
begin
application.MessageBox('职务代码不能为空!!','错误',mb_iconhand+mb_yesno);
end;
end;

procedure TForm6.Button2Click(Sender: TObject);
begin
  application.CreateForm(Tshanchuzhiwu,shanchuzhiwu);
shanchuzhiwu.ShowModal;
shanchuzhiwu.Free;
end;

end.

⌨️ 快捷键说明

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