?? tjsdyhfrm.pas
字號(hào):
unit tjsdyhfrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons, Mask, DBCtrlsEh,db, DBCtrls;
type
Ttjsdyh = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Edit1: TEdit;
Edit2: TEdit;
DBNumberEditEh1: TDBNumberEditEh;
DBNumberEditEh2: TDBNumberEditEh;
Label6: TLabel;
Label7: TLabel;
Panel2: TPanel;
SpeedButton7: TSpeedButton;
SpeedButton1: TSpeedButton;
Label8: TLabel;
DBNumberEditEh3: TDBNumberEditEh;
Label9: TLabel;
ComboBox1: TComboBox;
procedure SpeedButton1Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure SpeedButton7Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
tjsdyh: Ttjsdyh;
implementation
uses sdyhfrm,datafrm;
{$R *.dfm}
procedure Ttjsdyh.SpeedButton1Click(Sender: TObject);
begin
close;
end;
procedure Ttjsdyh.FormActivate(Sender: TObject);
var
i0,j0:integer;
begin
j0:=1;
for i0:=1 to yfgldata.sdyh.RecordCount+1 do
begin
begin
if not yfgldata.sdyh.Locate('序號(hào)',i0,[loCaseInsensitive]) then
j0:=i0;
end;
end;
tjsdyh.Edit1.Text:=inttostr(j0);
yfgldata.sdbz.First;
for i0:=1 to yfgldata.sdbz.RecordCount do
begin
tjsdyh.ComboBox1.Items.Add(yfgldata.sdbz.FieldByName('職級(jí)').AsString);
yfgldata.sdbz.Next;
end;
end;
procedure Ttjsdyh.ComboBox1Change(Sender: TObject);
begin
if tjsdyh.ComboBox1.Text<>'' then
begin
tjsdyh.DBNumberEditEh1.Value:=yfgldata.sdbz.Lookup('職級(jí)',tjsdyh.ComboBox1.Text,'用水補(bǔ)助');
tjsdyh.DBNumberEditEh2.Value:=yfgldata.sdbz.Lookup('職級(jí)',tjsdyh.ComboBox1.Text,'用電補(bǔ)助');
end;
end;
procedure Ttjsdyh.SpeedButton7Click(Sender: TObject);
begin
if (tjsdyh.Edit2.Text<>'') and (tjsdyh.ComboBox1.Text<>'') then
begin
yfgldata.sdyh.Append;
yfgldata.sdyh.Fields[0].AsInteger:=strtoint(tjsdyh.Edit1.Text);
yfgldata.sdyh.Fields[1].AsString:=tjsdyh.Edit2.Text;
yfgldata.sdyh.Fields[2].AsString:=tjsdyh.ComboBox1.Text;
yfgldata.sdyh.Fields[3].AsFloat:=tjsdyh.DBNumberEditEh3.Value;
yfgldata.sdyh.Fields[4].AsFloat:=tjsdyh.DBNumberEditEh1.Value;
yfgldata.sdyh.Fields[5].AsFloat:=tjsdyh.DBNumberEditEh2.Value;
yfgldata.sdyh.Post;
close;
end
else
messagebox(tjsdyh.handle,'用戶名和職級(jí)不能為空。','營房工作管理系統(tǒng)',16);
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -