var
Form2: TForm2;
s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16:boolean;
implementation
{$R *.dfm}
procedure TForm2.Button3Click(Sender: TObject);
begin
form2.Close;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
edit7.Text:='';
edit8.Text:='';
edit9.Text:='';
edit10.Text:='';
edit11.Text:='';
edit12.Text:='';
edit13.Text:='';
edit14.Text:='';
edit15.Text:='';
edit16.Text:='';
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
if edit1.Text='' then
s1:=true;
if edit2.Text='' then
s2:=true;
if edit3.Text='' then
s3:=true;
if edit4.Text='' then
s4:=true;
if edit5.Text='' then
s5:=true;
if edit6.Text='' then
s6:=true;
if edit7.Text='' then
s7:=true;
if edit8.Text='' then
s8:=true;
if edit9.Text='' then
s9:=true;
if edit10.Text='' then
s10:=true;
if edit11.Text='' then
s11:=true;
if edit12.Text='' then
s12:=true;
if edit13.Text='' then
s13:=true;
if edit14.Text='' then
s14:=true;
if edit15.Text='' then
s15:=true;
if edit16.Text='' then
s16:=true;
if s1 or s2 or s3 or s4 or s5 or s6 or s7 or s8 or s9 or s10 or s11 or s12 or s13 or s14 or s15 or s16 then
begin
application.MessageBox('输入信息不完整!','提示',mb_ok);
s1:=false;
s2:=false;
s3:=false;
s4:=false;
s5:=false;
s6:=false;
s7:=false;
s8:=false;
s9:=false;
s10:=false;
s11:=false;
s12:=false;
s13:=false;
s14:=false;
s15:=false;
s16:=false;
end
else
query1.SQL.Clear;
query1.SQL.Add('inster into 航班信息表(航班号,起飞日期,到达日期,起飞城市,到达城市,到达时间,起飞时间,一类舱总票数,一类舱票价,二类舱总票数,二类舱票价,三类舱总票数,三类舱票价,一类舱剩余票数,二类舱剩余票数,三类舱剩余票数)');
query1.SQL.Add('values(:航班号,:起飞日期,:到达日期,:起飞城市,:到达城市,:到达时间,:起飞时间,:一类舱总票数,:一类舱票价,:二类舱总票数,:二类舱票价,:三类舱总票数,:三类舱票价,:一类舱剩余票数,:二类舱剩余票数,:三类舱剩余票数)');
query1.ParamByName('航班号').AsString:=edit1.Text;
query1.ParamByName('起飞日期').AsDate:=strtodate(edit2.Text);
query1.ParamByName('到达日期').AsDate:=strtodate(edit3.Text);
query1.ParamByName('起飞城市').AsString:=edit4.Text;
query1.ParamByName('到达城市').AsString:=edit5.Text;
query1.ParamByName('到达时间').AsDateTime:=strtotime(edit6.Text);
query1.ParamByName('起飞时间').AsDateTime:=strtotime(edit7.Text);
query1.ParamByName('一类舱总票数').AsWord:=strtoint(edit8.Text);
query1.ParamByName('一类舱票价').AsFloat:=strtofloat(edit9.Text);
query1.ParamByName('二类舱总票数').AsWord:=strtoint(edit10.Text);
query1.ParamByName('二类舱票价').AsFloat:=strtofloat(edit11.Text);
query1.ParamByName('三类舱总票数').AsWord:=strtoint(edit12.Text);
query1.ParamByName('三类舱票价').AsFloat:=strtofloat(edit13.Text);
query1.ParamByName('一类舱剩余票数').AsWord:=strtoint(edit14.Text);
query1.ParamByName('二类舱剩余票数').AsWord:=strtoint(edit15.Text);
query1.ParamByName('三类舱剩余票数').AsWord:=strtoint(edit16.Text);
query1.ExecSQL;
query1.Close;
application.MessageBox('确定输入信息!','提示',mb_ok);
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
edit7.Text:='';
edit8.Text:='';
edit9.Text:='';
edit10.Text:='';
edit11.Text:='';
edit12.Text:='';
edit13.Text:='';
edit14.Text:='';
edit15.Text:='';
edit16.Text:='';
end;
end.