1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
with datamodule3 do begin
if not( Ver_ABM.State in [dsInsert,dsedit]) then begin
if abm_r.State in [dsInsert] then begin
abm.close;
abm.SQL.Clear;
if (date >= strtodate(dateedit1.text)) and (date <=strtodate(dateedit2.text)) then begin
va:=true;
end else begin
va:=false ;
end;
abm.SQL.Add('BEGIN TRANSACTION; insert into abonnement(dated_abm,datef_abm,dure_abm,prix_abm,paiement_abm,tarification_abm,validite_abm,id_ab,rest_abm,remise_abm,prix_tarif_abm) ' );
abm.SQL.Add( 'values('+FORMATDATETIME('yyyy-mm-dd',strtodate(dateedit1.text))+','+FORMATDATETIME('yyyy-mm-dd',strtodate(dateedit2.text))+','+quotedstr(comboedit1.Text)+','+quotedstr('0')+','+quotedstr('False')+','+quotedstr(ComboBox2.Items.Text)+','+va.ToString+','+quotedstr(ab.FieldByName('id_ab').asString)+','+quotedstr('0')+','+quotedstr(edit3.Text)+','+quotedstr(label25.Text)+'); commit;');
abm.Execute;
// abm_r.Cancel;
end; |
Partager