05-06-2014, 02:51 AM
كود :
procedure TForm5.Button6Click(Sender: TObject);
begin
if (Edit7.Text <>'') and (Edit8 .Text <>'') then
Edit9 .Text:=Formatfloat('0.000', (strToFloat(Edit7 .Text)/strToFloat(Edit8 .Text)));
end;ثم ناخذ 0.125 ونضربها في 4000 شخص ولكن على مجموعات اي 50 سجل تكون الحلقة
كود :
procedure TForm5.BitBtn1Click(Sender: TObject);
var
sql1, i_not,count_hala:string;
begin
if (ComboBox3 .Text ='')then exit;
if (ComboBox3 .Text <>'')then
ProgressBar1 .Visible :=True ;
sql1:='';
sql1:='SELECT Count(fard.hala_fard) AS Count_hala_fard';
sql1:=sql1+' FROM fard';
sql1:=sql1+' WHERE (((fard.hala_fard)="م"))';
dm.q_colection.Close;
dm.q_colection.SQL.Clear;
dm.q_colection.SQL.Add(sql1);
dm.q_colection.Open;
count_hala:= dm.q_colection.fieldbyname('Count_hala_fard').AsString;
sql1:='';
sql1:='SELECT bet.name_bet,bet.id ,Count(fard.hala_fard) AS Count_hala_fard';
sql1:=sql1+' FROM bet INNER JOIN fard ON bet.id = fard.id';
sql1:=sql1+' WHERE (((fard.hala_fard)="م")) ';
sql1:=sql1+' GROUP BY bet.name_bet,bet.id';
dm.q_colection.Close;
dm.q_colection.SQL.Clear;
dm.q_colection.SQL.Add(sql1);
dm.q_colection.Open;
IF Edit3 .Text <>'' then
if not dm .hesbat .Locate('it',edit3.Text ,[])then
Begin
with dm do
begin
nots.Locate ('note',ComboBox3 .Text,[loPartialKey]);
i_not:= notsit.AsString;
q_colection.First;
while not q_colection.Eof do
Begin
ProgressBar1 .Position :=1;
hesbat.Append;
hesbatit.AsString:=i_not;
hesbatid.AsString:=q_colection.Fieldbyname('id').AsString;
hesbatno_fard.AsString:=q_colection.fieldbyname('Count_hala_fard').AsString;
hesbaton_sahm.Value:=strToFloat(Edit9 .Text);
hesbatno_sum.Value:=q_colection.fieldbyname('Count_hala_fard').Value*strToFloat(Edit9 .Text);
hesbatdate .Value :=DateTimePicker1.Date ;
hesbatkolea .Value :=(hesbatno_sum .Value )+(hesbatno_duon .Value )-(hesbatalmdfoa .Value );
hesbat.Post;
ProgressBar1 .Position :=100;
q_colection.Next;
end;// end while
end;// end with
ComboBox3 .Text :='';
Edit8 .Text :='';
Edit9 .Text :='';
Edit7 .Text :='';
Edit3 .Text :='';
ProgressBar1 .Visible :=False ;
ShowMessage('تمت اضافة الملاحظة على جميع البيوت');
end
else
ShowMessage('تم اضافة هده الملاحظة مسبقاً');
ComboBox3 .Text :='';
Edit8 .Text :='';
Edit9 .Text :='';
Edit7 .Text :='';
Edit3 .Text :='';
ProgressBar1 .Visible :=False ;
end;اي 500 تخرج 400 وكسور او 500 وكسور
فكيف اجعلها تخرج مظبوطة

