1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| procedure TFacture.JvXPButton1Click(Sender: TObject);
begin
IF (edit1.Text='') then
raise exception.Create('VOUS DEVEZ SAISIR LES CHAMPS')
else
T_Facture.Insert;
T_Facture.FieldByName('Num_Fact').Value:=edit1.Text;
T_Facture.FieldByName('Date_Fact').Value:=Datetimepicker1.DateTime;
T_Facture.FieldByName('Désig_Four').Value:=edit3.Text;
T_Facture.FieldByName('Prix_Unit').Value:=edit8.text;
T_Facture.FieldByName('TVA').Value:=edit7.Text;
T_Facture.FieldByName('Mont_Four').Value:=edit5.Text;
T_Facture.FieldByName('Mont_TVA').Value:=edit6.Text;
T_Facture.FieldByName('Mont_TTC').Value:=edit4.Text;
IF messagedlg('Ajout Effectuer',mtConfirmation,[mbYES,mbNO],0)=mrYes
then T_Facture.Post
else T_Facture.Cancel;
edit1.Text:='';
Datetimepicker1.DateTime:=date;
edit3.Text:='';
edit8.Text:='';
edit7.Text:='';
edit5.Text:='';
edit6.Text:='';
edit4.Text:='';
end; |
Partager