?? guolutjfrm.pas
字號:
unit guolutjfrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ImgList, Mask, DBCtrlsEh, StdCtrls, dxdbtrel, Buttons, ExtCtrls;
type
Tguolutj = class(TForm)
Panel2: TPanel;
SpeedButton12: TSpeedButton;
SpeedButton13: TSpeedButton;
Panel1: TPanel;
Label3: TLabel;
Label4: TLabel;
Label1: TLabel;
Label2: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
dxLookupTreeView1: TdxLookupTreeView;
Edit2: TEdit;
ComboBox1: TComboBox;
Edit1: TEdit;
Edit3: TEdit;
DBNumberEditEh1: TDBNumberEditEh;
DBNumberEditEh2: TDBNumberEditEh;
DBNumberEditEh3: TDBNumberEditEh;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
ImageList2: TImageList;
DBNumberEditEh4: TDBNumberEditEh;
Label17: TLabel;
Label18: TLabel;
Edit4: TEdit;
Label19: TLabel;
Edit9: TEdit;
Label20: TLabel;
Edit10: TEdit;
Label21: TLabel;
DBNumberEditEh5: TDBNumberEditEh;
Label22: TLabel;
CheckBox1: TCheckBox;
Label23: TLabel;
Edit11: TEdit;
Label24: TLabel;
Edit12: TEdit;
procedure SpeedButton13Click(Sender: TObject);
procedure dxLookupTreeView1CloseUp(Sender: TObject; Accept: Boolean);
procedure SpeedButton12Click(Sender: TObject);
private
{ Private declarations }
public
gtj:boolean;
{ Public declarations }
end;
var
guolutj: Tguolutj;
implementation
uses datafrm,guolufrm;
{$R *.dfm}
procedure Tguolutj.SpeedButton13Click(Sender: TObject);
begin
close;
end;
procedure Tguolutj.dxLookupTreeView1CloseUp(Sender: TObject;
Accept: Boolean);
var
s_value1:string;
begin
if guolutj.dxLookupTreeView1.Text<>'' then
begin
guolutj.Edit2.Text:=yfgldata.dwqk.Lookup('單位代碼',guolutj.dxLookupTreeView1.Text,'單位名稱');
guolutj.ComboBox1.Items.Clear;
yfgldata.Query1.Active:=false;
yfgldata.Query1.SQL.Clear;
yfgldata.Query1.SQL.Add('select distinct 坐落號 ');
yfgldata.Query1.SQL.Add(' from yfgl_yfzl ');
yfgldata.Query1.SQL.Add(' where 單位代碼='''+guolutj.dxLookupTreeView1.Text+''' ');
try
yfgldata.Query1.Active:=true;
except
messagebox(guolutj.handle,'字段值列舉出錯。','營房工作管理系統',16);
exit;
end;
yfgldata.Query1.First;
while not yfgldata.Query1.Eof do
begin
s_value1:=yfgldata.Query1.fieldbyname('坐落號').AsString;
guolutj.ComboBox1.Items.Add(s_value1);
yfgldata.Query1.Next;
end;
yfgldata.Query1.Active:=false;
end;
end;
procedure Tguolutj.SpeedButton12Click(Sender: TObject);
begin
if guolutj.gtj then
begin
if guolutj.dxLookupTreeView1.Text<>'' then
begin
if guolutj.ComboBox1.Text<>'' then
begin
if guolutj.Edit1.Text<>'' then
begin
if guolutj.Edit3.Text<>'' then
begin
yfgldata.guolu.Append;
yfgldata.guolu.FieldByName('序號').AsInteger:=yfgldata.guolu.RecordCount+1;
yfgldata.guolu.FieldByName('單位代碼').AsString:=guolutj.dxLookupTreeView1.Text;
yfgldata.guolu.FieldByName('住用單位').AsString:=guolutj.Edit2.Text;
yfgldata.guolu.FieldByName('坐落號').AsString:=guolutj.ComboBox1.Text;
yfgldata.guolu.FieldByName('棟號').AsString:=guolutj.Edit1.Text;
yfgldata.guolu.FieldByName('型號').AsString:=guolutj.Edit3.Text;
yfgldata.guolu.FieldByName('蒸發量').AsFloat:=guolutj.DBNumberEditEh1.Value;
yfgldata.guolu.FieldByName('額定壓力').AsFloat:=guolutj.DBNumberEditEh2.Value;
yfgldata.guolu.FieldByName('使用壓力').AsFloat:=guolutj.DBNumberEditEh4.Value;
yfgldata.guolu.FieldByName('額定溫度').AsInteger:=guolutj.DBNumberEditEh3.Value;
yfgldata.guolu.FieldByName('燃料類型').AsString:=guolutj.Edit5.Text;
yfgldata.guolu.FieldByName('鍋爐用途').AsString:=guolutj.Edit6.Text;
yfgldata.guolu.FieldByName('質量狀況').AsString:=guolutj.Edit7.Text;
yfgldata.guolu.FieldByName('供熱介質').AsString:=guolutj.Edit8.Text;
yfgldata.guolu.FieldByName('水處理方式').AsString:=guolutj.Edit4.Text;
yfgldata.guolu.FieldByName('消煙除塵方式').AsString:=guolutj.Edit9.Text;
yfgldata.guolu.FieldByName('生產廠家').AsString:=guolutj.Edit10.Text;
yfgldata.guolu.FieldByName('安裝年份').AsInteger:=guolutj.DBNumberEditEh5.Value;
if guolutj.CheckBox1.Checked then
yfgldata.guolu.FieldByName('是否登記').AsString:='是'
else
yfgldata.guolu.FieldByName('是否登記').AsString:='否';
yfgldata.guolu.FieldByName('檢驗部門').AsString:=guolutj.Edit11.Text;
yfgldata.guolu.FieldByName('變更依據').AsString:=guolutj.Edit12.Text;
yfgldata.guolu.Post;
close;
guolu.showguolu;
end
else
messagebox(guolutj.handle,'鍋爐型號不能為空。','營房工作管理系統',16);
end
else
messagebox(guolutj.handle,'棟號不能為空。','營房工作管理系統',16);
end
else
messagebox(guolutj.handle,'坐落號不能為空。','營房工作管理系統',16);
end
else
messagebox(guolutj.handle,'單位代碼不能為空。','營房工作管理系統',16);
end
else
begin
yfgldata.guolu.Edit;
yfgldata.guolu.FieldByName('型號').AsString:=guolutj.Edit3.Text;
yfgldata.guolu.FieldByName('蒸發量').AsFloat:=guolutj.DBNumberEditEh1.Value;
yfgldata.guolu.FieldByName('額定壓力').AsFloat:=guolutj.DBNumberEditEh2.Value;
yfgldata.guolu.FieldByName('使用壓力').AsFloat:=guolutj.DBNumberEditEh4.Value;
yfgldata.guolu.FieldByName('額定溫度').AsInteger:=guolutj.DBNumberEditEh3.Value;
yfgldata.guolu.FieldByName('燃料類型').AsString:=guolutj.Edit5.Text;
yfgldata.guolu.FieldByName('鍋爐用途').AsString:=guolutj.Edit6.Text;
yfgldata.guolu.FieldByName('質量狀況').AsString:=guolutj.Edit7.Text;
yfgldata.guolu.FieldByName('供熱介質').AsString:=guolutj.Edit8.Text;
yfgldata.guolu.FieldByName('水處理方式').AsString:=guolutj.Edit4.Text;
yfgldata.guolu.FieldByName('消煙除塵方式').AsString:=guolutj.Edit9.Text;
yfgldata.guolu.FieldByName('生產廠家').AsString:=guolutj.Edit10.Text;
yfgldata.guolu.FieldByName('安裝年份').AsInteger:=guolutj.DBNumberEditEh5.Value;
if guolutj.CheckBox1.Checked then
yfgldata.guolu.FieldByName('是否登記').AsString:='是'
else
yfgldata.guolu.FieldByName('是否登記').AsString:='否';
yfgldata.guolu.FieldByName('檢驗部門').AsString:=guolutj.Edit11.Text;
yfgldata.guolu.FieldByName('變更依據').AsString:=guolutj.Edit12.Text;
yfgldata.guolu.Post;
close;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -