117 lines
2.5 KiB
ObjectPascal
117 lines
2.5 KiB
ObjectPascal
|
|
unit U_ReceivableEdit;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, StdCtrls, ExtCtrls, DB, ADODB;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmReceivableEdit = class(TForm)
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Button1: TButton;
|
|||
|
|
Button2: TButton;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
ZaMoney: TEdit;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
SL: TEdit;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
RanMoney: TEdit;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
JSF: TEdit;
|
|||
|
|
ZS: TEdit;
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
FFFIDS: string;
|
|||
|
|
FBCIID: string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmReceivableEdit: TfrmReceivableEdit;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmReceivableEdit.Button2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmReceivableEdit.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
zaMoney.SetFocus;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select * from BS_Cloth_Info ');
|
|||
|
|
sql.Add(' where BCIID=''' + Trim(FBCIID) + '''');
|
|||
|
|
// showmessage(sql.text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
ZaMoney.text := Trim(ADOQueryCmd.fieldbyname('ZaMoney').AsString);
|
|||
|
|
SL.text := Trim(ADOQueryCmd.fieldbyname('SL').AsString);
|
|||
|
|
RanMoney.text := Trim(ADOQueryCmd.fieldbyname('RanMoney').AsString);
|
|||
|
|
|
|||
|
|
JSF.text := Trim(ADOQueryCmd.fieldbyname('JSF').AsString);
|
|||
|
|
ZS.text := Trim(ADOQueryCmd.fieldbyname('ZS').AsString);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmReceivableEdit.Button1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
if StrToFloatDef(ZaMoney.Text, 0) = 0 then
|
|||
|
|
ZaMoney.Text := '0';
|
|||
|
|
|
|||
|
|
if StrToFloatDef(SL.Text, 0) = 0 then
|
|||
|
|
SL.Text := '1';
|
|||
|
|
|
|||
|
|
if StrToFloatDef(RanMoney.Text, 0) = 0 then
|
|||
|
|
RanMoney.Text := '0';
|
|||
|
|
|
|||
|
|
if StrToFloatDef(JSF.Text, 0) = 0 then
|
|||
|
|
JSF.Text := '0';
|
|||
|
|
|
|||
|
|
if StrToFloatDef(ZS.Text, 0) = 0 then
|
|||
|
|
ZS.Text := '1';
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' update BS_Cloth_Info ');
|
|||
|
|
|
|||
|
|
sql.Add(' set ZaMoney=' + ZaMoney.Text);
|
|||
|
|
sql.Add(' , SL=' + SL.Text);
|
|||
|
|
sql.Add(' , RanMoney=' + RanMoney.Text);
|
|||
|
|
|
|||
|
|
sql.Add(' , JSF=' + JSF.Text);
|
|||
|
|
sql.Add(' , ZS=' + ZS.Text);
|
|||
|
|
|
|||
|
|
sql.Add(' where BCIID=''' + Trim(FBCIID) + '''');
|
|||
|
|
// showmessage(sql.text);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ModalResult := 1;
|
|||
|
|
except
|
|||
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|