?? cw_zd.~pas
字號:
unit cw_zd;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, DBTables, Grids, DBGrids, StdCtrls;
type
TForm24 = class(TForm)
Label1: TLabel;
GroupBox1: TGroupBox;
Label2: TLabel;
AccountNo: TEdit;
Button1: TButton;
GroupBox2: TGroupBox;
Label3: TLabel;
RoomName: TComboBox;
Button2: TButton;
GroupBox3: TGroupBox;
DB_zd: TDBGrid;
Button4: TButton;
Button5: TButton;
GroupBox4: TGroupBox;
Label4: TLabel;
Button3: TButton;
krxm: TEdit;
T_RoomList: TTable;
Q_zdcx: TQuery;
DS_zdcx: TDataSource;
Q_zdxxcx: TQuery;
procedure FormShow(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure DB_zdDblClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form24: TForm24;
implementation
{$R *.dfm}
procedure TForm24.FormShow(Sender: TObject);
begin
T_RoomList.Open;
while not T_RoomList.Eof do
begin
RoomName.Items.Add(T_RoomList.FieldByName('RoomName').AsString);
T_RoomList.Next;
end;
end;
procedure TForm24.Button1Click(Sender: TObject);
begin
if (length(AccountNo.Text)=0) then
begin
MessageDlg('輸入不能為空,請重新輸入!',mtError,[mbok],0);
end
else
begin
q_zdcx.Active:=False;
Q_zdcx.SQL.Clear;
Q_zdcx.SQL.Add('select * from H_RoomIn where cstr(NowAccountNo)='''+AccountNo.Text+'''');
Q_zdcx.Active:=True;
end;
end;
procedure TForm24.Button2Click(Sender: TObject);
begin
if (length(RoomName.Text)=0) then
begin
MessageDlg('輸入不能為空,請重新輸入!',mtError,[mbok],0);
end
else
begin
q_zdcx.Active:=False;
Q_zdcx.SQL.Clear;
Q_zdcx.SQL.Add('select * from H_RoomIn where RoomName='''+RoomName.Text+'''');
Q_zdcx.Active:=True;
end;
end;
procedure TForm24.Button3Click(Sender: TObject);
begin
if (length(krxm.Text)=0) then
begin
MessageDlg('輸入不能為空,請重新輸入!',mtError,[mbok],0);
end
else
begin
q_zdcx.Active:=False;
Q_zdcx.SQL.Clear;
Q_zdcx.SQL.Add('select * from H_RoomIn where Name='''+krxm.Text+'''');
Q_zdcx.Active:=True;
end;
end;
procedure TForm24.Button4Click(Sender: TObject);
begin
q_zdcx.Active:=False;
Q_zdcx.SQL.Clear;
Q_zdcx.SQL.Add('select * from H_RoomIn order by NowAccountNo');
Q_zdcx.Active:=True;
end;
procedure TForm24.Button5Click(Sender: TObject);
begin
close;
end;
procedure TForm24.DB_zdDblClick(Sender: TObject);
var AccountNo:string;
begin
Q_zdcx.Open;
with db_zd.DataSource.DataSet do
begin
GotoBookmark(pointer(db_zd.SelectedRows[0]));
AccountNo:=fields[4].AsString;
//讀取H_RoonIn信息
Form25.l1.Caption:=fields[4].AsString;
Form25.l2.Caption:=fields[1].AsString;
Form25.l3.Caption:=fields[3].AsString;
Form25.l4.Caption:=fields[5].AsString;
Form25.l5.Caption:=fields[6].AsString;
Form25.l6.Caption:=fields[7].AsString;
Form25.l7.Caption:=fields[8].AsString;
Form25.l8.Caption:=fields[9].AsString;
Form25.l9.Caption:=fields[10].AsString;
Form25.l10.Caption:=fields[11].AsString;
Form25.l11.Caption:=fields[14].AsString;
Form25.l12.Caption:=fields[16].AsString;
Form25.l13.Caption:=fields[12].AsString;
Form25.l14.Caption:=fields[13].AsString;
//結束
//讀取H_DinList信息
Form25.Q_DinList.SQL.Clear;
Form25.Q_DinList.SQL.Add('select * from H_DinList where cstr(AccountNo)='''+AccountNo+'''');
Form25.Q_DinList.Open;
//結束
//讀取H_Account信息
Q_zdxxcx.SQL.Clear;
Q_zdxxcx.SQL.Add('select * from H_Account where cstr(AccountNo)='''+AccountNo+'''');
Q_zdxxcx.Open;
Form25.l15.Caption:=Q_zdxxcx.FieldByName('type1').AsString;
Form25.l16.Caption:=Q_zdxxcx.FieldByName('type2').AsString;
Form25.l17.Caption:=Q_zdxxcx.FieldByName('type3').AsString;
Form25.l18.Caption:=Q_zdxxcx.FieldByName('type4').AsString;
Form25.l19.Caption:=Q_zdxxcx.FieldByName('type5').AsString;
Form25.l20.Caption:=Q_zdxxcx.FieldByName('type6').AsString;
Form25.l21.Caption:=Q_zdxxcx.FieldByName('zlfy').AsString;
Form25.l22.Caption:=Q_zdxxcx.FieldByName('zlfy_room').AsString;
Form25.l23.Caption:=Q_zdxxcx.FieldByName('ysje').AsString;
Form25.l24.Caption:=Q_zdxxcx.FieldByName('zkje').AsString;
Form25.l25.Caption:=Q_zdxxcx.FieldByName('mlje').AsString;
Form25.l26.Caption:=Q_zdxxcx.FieldByName('sfje').AsString;
Form25.l27.Caption:=Q_zdxxcx.FieldByName('rmbje').AsString;
Form25.l28.Caption:=Q_zdxxcx.FieldByName('zpje').AsString;
Form25.l29.Caption:=Q_zdxxcx.FieldByName('xykje').AsString;
Form25.l30.Caption:=Q_zdxxcx.FieldByName('kdje').AsString;
Form25.l31.Caption:=Q_zdxxcx.FieldByName('kdr').AsString;
Form25.l32.Caption:=Q_zdxxcx.FieldByName('dzje').AsString;
Form25.l33.Caption:=Q_zdxxcx.FieldByName('dzr').AsString;
Form25.l35.Caption:=Q_zdxxcx.fieldByName('sfzz').asstring;
Form25.l36.Caption:=Q_zdxxcx.fieldByName('zzfh').asstring;
Form25.l37.Caption:=Q_zdxxcx.fieldByName('zzje').asstring;
Q_zdxxcx.Close;
//結束
form25.showmodal;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -