.


:




:

































 

 

 

 


While not IBQueryAsc.Eof do begin




FormNewFlight.ComboBox.Items.Add(IBQueryAsc.Fields[0].AsString);

IBQueryAsc.Next;

end;

 

FormNewFlight , . .

 

if (FormNewFlight.ShowModal = mrOk)

and (FormNewFlight.ComboBox.Text <> '')

Then begin

// -

IBQueryAsc.SQL.Text:=

'INSERT INTO FLIGHT (FL_DATE, FL_NUM, FL_BRD_NUM) '

+ 'VALUES (''' + DateToStr(FormNewTicket.DateTimePickerTicket.Date)

+ ''',''' + IBQueryTarifTR_AL_NUM.AsString + ''','''

+ FormNewFlight.ComboBox.Text + ''')';

IBQueryAsc.ExecSQL;

end else // Cancel,

exit;

 

IBQueryPRS. , , EditName, EditName2, EditName3. PERSON.

 

If FormNewTicket.IBQueryPRSPR_CODE.IsNull then begin

// -

IBQueryAsc.SQL.Text:=

'INSERT INTO PERSON(pr_name, pr_name2, pr_name3) '

+ 'VALUES (''' + FormNewTicket.EditName.Text

+ ''',''' + FormNewTicket.EditName2.Text

+ ''',''' + FormNewTicket.EditName3.Text + ''')';

IBQueryAsc.ExecSQL;

// FormNewTicket

FormNewTicket.IBQueryPRS.Close;

FormNewTicket.IBQueryPRS.Open;

end;

 

.

//

IBQueryAsc.SQL.Text:=

'INSERT INTO TICKET (TC_NUM, TC_PR_CODE, TC_TR_CODE, '

+ 'TC_FL_DATE, TC_FL_NUM, TC_ROW, TC_LIT) '

+ 'VALUES (' + FormNewTicket.EditNum.Text + ','

+ FormNewTicket.IBQueryPRSPR_CODE.AsString + ','

+ IBQueryTarifTR_CODE.AsString

+ ',''' + DateToStr(FormNewTicket.DateTimePickerTicket.Date)

+ ''',''' + IBQueryTarifTR_AL_NUM.AsString + ''','

+ IntToStr(FormNewTicket.sNum) + ',''' + FormNewTicket.sLit + ''')';

IBQueryAsc.ExecSQL;

 

//

IBQueryCntTick.Close;

IBQueryCntTick.Open;

 

. , , .


 

procedure TFormTicket.ButtonNewTicketClick(Sender: TObject);

Begin

If not IBQueryCntTick.FieldByName('fl_date').IsNull then

FormNewTicket.DateTimePickerTicket.DateTime:=

IBQueryCntTick.FieldByName('fl_date').AsDateTime

Else

FormNewTicket.DateTimePickerTicket.DateTime:= Now;

 

if FormNewTicket.ShowModal = mrOk then begin

// -

IBQueryAsc.SQL.Text:= 'select count(*) from FLIGHT where FL_NUM = '

+ IBQueryTarifTR_AL_NUM.AsString + ' AND FL_DATE = '''

+ DateToStr(FormNewTicket.DateTimePickerTicket.Date) + '''';

IBQueryAsc.Open;

if IBQueryAsc.Fields[0].AsInteger = 0 then begin

// -

 

//

FormNewFlight.Memo1.Text:= ' ' + IBQueryTarifTR_AL_NUM.AsString

+ ' ' + DateToStr(FormNewTicket.DateTimePickerTicket.Date)

+ ' , ?';

 

FormNewFlight.ComboBox.Clear;

FormNewFlight.ComboBox.Items.Clear;

IBQueryAsc.SQL.Text:= 'select BRD.BRD_NUM from BOARD BRD '

+ 'INNER JOIN AIRLINE AL ON BRD.BRG_AC_CODE = AL.AL_AC_CODE '

+ 'WHERE AL.AL_NUM = ' + IBQueryTarifTR_AL_NUM.AsString;

IBQueryAsc.Open;

While not IBQueryAsc.Eof do begin

FormNewFlight.ComboBox.Items.Add(IBQueryAsc.Fields[0].AsString);

IBQueryAsc.Next;

end;

 

if (FormNewFlight.ShowModal = mrOk)

and (FormNewFlight.ComboBox.Text <> '')

Then begin

// -

IBQueryAsc.SQL.Text:= 'INSERT INTO FLIGHT (FL_DATE, FL_NUM, FL_BRD_NUM) '

+ 'VALUES (''' + DateToStr(FormNewTicket.DateTimePickerTicket.Date) + ''','''

+ IBQueryTarifTR_AL_NUM.AsString + ''','''

+ FormNewFlight.ComboBox.Text + ''')';

IBQueryAsc.ExecSQL;

 

End else

exit;

end;





:


: 2016-11-12; !; : 303 |


:

:

, , .
==> ...

1758 - | 1662 -


© 2015-2024 lektsii.org - -

: 0.01 .