F
fujingkai
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TCardSaleForm.RzBitBtn1Click(Sender: TObject);
var BH:string;
begin
adoquery1.Close;
adoquery1.SQL.Add('select * from Q_HYK where HYBH=:BH');
adoquery1.Parameters.ParamByName('BH').Value:=Trim(rzedit1.Text);
adoquery1.Prepared;
adoquery1.Open;
if adoquery1.RecordCount>0 then
BH:=adoquery1.Parameters[0].Value;
if (BH<>Trim(rzedit1.Text)) or (rzedit1.Text='') then
begin
application.MessageBox('无此会员卡号,请您登记此卡号。','错误提示',mb_ok or mb_iconerror);
rzedit1.Clear;
rzedit2.Clear;
rzedit3.Clear;
rzedit4.Clear;
Cardform:=TCardForm.Create(application);
CardForm.ShowModal;
CardSaleForm.Close;
end else
begin
adotable1.Open;
adotable1.Append;
adotable1.FieldByName('HYBH').Value:=trim(rzedit1.Text);
adotable1.FieldByName('XFJE').Value:=trim(rzedit3.Text);
adotable1.FieldByName('XFRQ').Value:=trim(datetostr(rzdatetimepicker1.Date));
rzedit4.Text:=inttostr(strtoint(rzedit3.Text) div 10);
adotable1.FieldByName('DQJF').Value:=Trim(inttostr(strtoint(rzedit3.Text) div 10));
adotable1.Post;
adotable1.Refresh;
end;
end;
当执行时总是提示缺少更新或刷新的键列信息.
var BH:string;
begin
adoquery1.Close;
adoquery1.SQL.Add('select * from Q_HYK where HYBH=:BH');
adoquery1.Parameters.ParamByName('BH').Value:=Trim(rzedit1.Text);
adoquery1.Prepared;
adoquery1.Open;
if adoquery1.RecordCount>0 then
BH:=adoquery1.Parameters[0].Value;
if (BH<>Trim(rzedit1.Text)) or (rzedit1.Text='') then
begin
application.MessageBox('无此会员卡号,请您登记此卡号。','错误提示',mb_ok or mb_iconerror);
rzedit1.Clear;
rzedit2.Clear;
rzedit3.Clear;
rzedit4.Clear;
Cardform:=TCardForm.Create(application);
CardForm.ShowModal;
CardSaleForm.Close;
end else
begin
adotable1.Open;
adotable1.Append;
adotable1.FieldByName('HYBH').Value:=trim(rzedit1.Text);
adotable1.FieldByName('XFJE').Value:=trim(rzedit3.Text);
adotable1.FieldByName('XFRQ').Value:=trim(datetostr(rzdatetimepicker1.Date));
rzedit4.Text:=inttostr(strtoint(rzedit3.Text) div 10);
adotable1.FieldByName('DQJF').Value:=Trim(inttostr(strtoint(rzedit3.Text) div 10));
adotable1.Post;
adotable1.Refresh;
end;
end;
当执行时总是提示缺少更新或刷新的键列信息.