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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, Mask, DBCtrls, Grids, DBGrids, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBEdit1: TDBEdit;
ADOConnection1: TADOConnection;
ADOTable1: TADOTable;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
procedure Edit1Change(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Edit1Change(Sender: TObject);
begin
if adoTable1.Locate('volume',Edit1.Text , [locaseinsensitive,lopartialkey]) then
Showmessage(' l''enregistrement non trouver ');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
edit4.Text:=floattostr(strtofloat(dbedit1.Text)+(strtofloat(edit6.Text)));
adoTable1.Locate('hauteur',Edit1.Text , [locaseinsensitive,lopartialkey]);
edit4.Text:=floattostr(strtofloat(dbedit1.Text)+(strtofloat(edit6.Text)));
if edit4.text>=edit5.text then
Showmessage(' la hauteur a etait trouver ') Else
edit1.text:=floattostr(strtofloat(edit1.text)+(strtofloat(edit3.text)));
end;
end. |
Partager