procedure Tfrm_price_2.dataset1CheckEOF(Sender: TObject;
var Eof: Boolean);
begin
try
Eof := (gd_list<>nil) and (dataset1.RecNo >= Gd_list.Count);
except
Eof:=true;
end;
end;
procedure Tfrm_price_2.fr_priceGetValue(const ParName: String;
var ParValue: Variant);
begin
{ if AnsiCompareText(ParName, 'text1') = 0
then begin
ParValue:='';
for i:=0 to RichEdit1.Lines.Count-1
do ParValue := ParValue+RichEdit1.Lines+#10;
end
else} begin
if (Gd_list<>nil) and (Gd_list.Count>0)
then try
if AnsiCompareText(ParName, 'Num') = 0
then ParValue := inttostr(Dataset1.RecNo+1)
else if AnsiCompareText(ParName, 'Good_name') = 0
then ParValue := Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_name
else if AnsiCompareText(ParName, 'price') = 0
then begin
if (ANSIUPPERCASE(trim(Combobox3.Text))='РУБ.') or
(ANSIUPPERCASE(trim(Combobox3.Text))='РУБ') or
(ANSIUPPERCASE(trim(Combobox3.Text))='Р.') or
(ANSIUPPERCASE(trim(Combobox3.Text))='Р')
then ParValue := Format('%10.2f',[round(Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_price*FloatEdit1.Value*
Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_koef*100)/100])
else ParValue := Format('%10.2f',[round(Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_price*
Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_koef*100)/100])
end
else if AnsiCompareText(ParName, 'qv') = 0
then ParValue := FloatToStr(Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_box_qv)
else if AnsiCompareText(ParName, 'img') = 0
then ParValue := ''
else if AnsiCompareText(ParName, 'mu_id') = 0
then begin
if chb_1.Checked
then ParValue := Combobox3.Text
else ParValue:='';
end
else if AnsiCompareText(ParName, 'good_descr') = 0
then ParValue := Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_text
else if AnsiCompareText(ParName, 'gd_type') = 0
then ParValue := Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_type
else if AnsiCompareText(ParName, 'mu') = 0
then ParValue := Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_mu
{else if AnsiCompareText(ParName, 'Img') = 0
then begin
ParValue.Picture.LoadFromFile('D:\Work2\Вирус.bmp');
Img:=TfrPictureView( fr_Price.FindObject('Picture2') );
Img.Picture.LoadFromFile('D:\Work2\Вирус.bmp');
end; }
except
end;
end
end;
Комментарии
Используйй UserDataset
Данные пихай в onGetValue
var Eof: Boolean);
begin
try
Eof := (gd_list<>nil) and (dataset1.RecNo >= Gd_list.Count);
except
Eof:=true;
end;
end;
procedure Tfrm_price_2.fr_priceGetValue(const ParName: String;
var ParValue: Variant);
begin
{ if AnsiCompareText(ParName, 'text1') = 0
then begin
ParValue:='';
for i:=0 to RichEdit1.Lines.Count-1
do ParValue := ParValue+RichEdit1.Lines+#10;
end
else} begin
if (Gd_list<>nil) and (Gd_list.Count>0)
then try
if AnsiCompareText(ParName, 'Num') = 0
then ParValue := inttostr(Dataset1.RecNo+1)
else if AnsiCompareText(ParName, 'Good_name') = 0
then ParValue := Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_name
else if AnsiCompareText(ParName, 'price') = 0
then begin
if (ANSIUPPERCASE(trim(Combobox3.Text))='РУБ.') or
(ANSIUPPERCASE(trim(Combobox3.Text))='РУБ') or
(ANSIUPPERCASE(trim(Combobox3.Text))='Р.') or
(ANSIUPPERCASE(trim(Combobox3.Text))='Р')
then ParValue := Format('%10.2f',[round(Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_price*FloatEdit1.Value*
Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_koef*100)/100])
else ParValue := Format('%10.2f',[round(Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_price*
Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_koef*100)/100])
end
else if AnsiCompareText(ParName, 'qv') = 0
then ParValue := FloatToStr(Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_box_qv)
else if AnsiCompareText(ParName, 'img') = 0
then ParValue := ''
else if AnsiCompareText(ParName, 'mu_id') = 0
then begin
if chb_1.Checked
then ParValue := Combobox3.Text
else ParValue:='';
end
else if AnsiCompareText(ParName, 'good_descr') = 0
then ParValue := Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_text
else if AnsiCompareText(ParName, 'gd_type') = 0
then ParValue := Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_type
else if AnsiCompareText(ParName, 'mu') = 0
then ParValue := Tgood(Gd_list.Objects[Dataset1.RecNo]).rec.gd_mu
{else if AnsiCompareText(ParName, 'Img') = 0
then begin
ParValue.Picture.LoadFromFile('D:\Work2\Вирус.bmp');
Img:=TfrPictureView( fr_Price.FindObject('Picture2') );
Img.Picture.LoadFromFile('D:\Work2\Вирус.bmp');
end; }
except
end;
end
end;