?? selbill.pas
字號(hào):
unit selBill;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, StdCtrls, Grids, DBGrids, Buttons, DBGridEh;
type
TdlgSelBill = class(TForm)
cmdOk: TBitBtn;
cmdCancel: TBitBtn;
DBGridEh1: TDBGridEh;
procedure FormShow(Sender: TObject);
procedure DBGrid1CellClick(Column: TColumn);
procedure DBGrid1KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
protected
xSql:string;
xCaption:string;
xParams1:integer;
//xParams1:string;
Function GetInvoNo:string;
Function GetBillId:integer;
public
{ Public declarations }
property BillId :integer read GetBillId ;
property InvoNo :string read GetInvoNo ;
property NewSql:string read xSql write xSql;
//property sParams1:string write xParams1;
property nParams1:integer write xParams1;
property dlgCaption:string read xcaption write xCaption;
end;
var
dlgSelBill: TdlgSelBill;
implementation
uses datamodule1;
{$R *.DFM}
Function TdlgSelBill.GetInvoNo:string;
begin
result:=trim(DataE2.queryDlg.fieldbyname('InvoNo').asstring);
end;
Function TdlgSelBill.GetBillid:integer;
begin
result:=DataE2.queryDlg.fieldbyname('billid').asinteger;
end;
procedure TdlgSelBill.FormShow(Sender: TObject);
var
sText:string;
n:integer;
begin
caption:=xCaption;
with DataE2 do
begin
QueryDlg.close;
sText:=trim(queryDlg.sql.text) ;//sql未變,不必重新初始化
if (sText<>xSql) or (xCaption='轉(zhuǎn)房') then
begin
queryDlg.sql.clear;
queryDlg.sql.add(xSql);
end;
n:=pos(':',xSql);
if n>0 then //有參數(shù)
queryDlg.Parameters[0].value:=xParams1;
QueryDlg.open;
end;
end;
procedure TdlgSelBill.DBGrid1CellClick(Column: TColumn);
begin
modalResult:=mrok;
end;
procedure TdlgSelBill.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then modalResult:=mrok;
end;
end.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -