private
{ Private declarations }
public
{ Public declarations }
// procedure initiate;
procedure savetoordertable;
procedure makebooknumber;
// procedure printbook;
procedure savetoflighttable;
end;
var
Book: TBook;
booknumber:string;
implementation
uses mainview,
flightquery,
cityflightquery;
{$R *.dfm}
//************订票子窗口*****************
procedure TBook.QueryButtonClick(Sender: TObject);
begin
CityQuery.ShowModal;
end;
//************关闭子窗口*****************
procedure TBook.ExitButtonClick(Sender: TObject);
begin
close;
end;
//*************点确定键后执行更新动作****************
procedure TBook.OkButtonClick(Sender: TObject);
begin
makebooknumber; //生成订单号
// booknumber:='00010000100020003';
savetoordertable; //更新订单数据库
savetoflighttable; //更新航班数据库
end;
*********生成订单号****************
procedure TBook.makebooknumber;
var
oldnumber:string;
s1,s2,s3:string;
year,month,day,t:integer;
begin
year:=yearof(now);
month:=monthof(now);
day:=dayof(now);
s1:=inttostr(year);
if month<10 then
s1:=s1+'0'+inttostr(month)
else
s1:=s1+inttostr(month);
if day<10 then
s1:=s1+'0'+inttostr(day)
else
s1:=s1+inttostr(day);
query1.close;
query1.sql.clear;
query1.sql.Add('select * from bookorder');
query1.open;
if not query1.eof then
begin
query1.Last;
oldnumber:=query1.fieldByname('OrdNo').asstring;
s2:=copy(oldnumber,1,8);
if s1=s2 then
begin
s2:=copy(oldnumber,9,12);
t:=strtoint(s2);
t:=t+1;
if t<10 then
s3:='000'+inttostr(t)
else if t<100 then
s3:='00'+inttostr(t)
else if t<1000 then
s3:='0'+inttostr(t)
else
s3:=inttostr(t);
end
else
s3:='0001';
end
else
s3:='0001';
query1.Close;
booknumber:=s1+s3;
这里有procedure savetoordertable;
procedure makebooknumber;
procedure savetoflighttable;
前面声名的后面是怎么调用的.
makebooknumber; //生成订单号
// booknumber:='00010000100020003';
savetoordertable; //更新订单数据库
savetoflighttable; //更新航班数据库
end;这几条是怎么调用的啊1