unit TSSH;
interface
uses
Business.System, Business.Model, Business.Forms, Business.Model.Flow,
Business.Data;
type
TTSSH = class(JYSQX.TTSJY)
DataSetBroker1: TDataSetBroker;
DataSetBroker2: TDataSetBroker;
Query1: TQuery;
FlowBroker1: TFlowBroker;
procedure FlowBroker1BeforeFlowOut(Sender: TObject; Command: TFlowOutCommand);
procedure FlowBroker1BeforeFlowFinish(Sender: TObject; Command: TFlowFinishCommand);
procedure FlowBroker1BeforeFlowBack(Sender: TObject; Command: TFlowBackCommand);
procedure FlowBroker2BeforeFlowOut(Sender: TObject; Command: TFlowOutCommand);
private
{private declarations}
public
{public declarations}
end;
implementation
procedure TTSSH.FlowBroker1BeforeFlowOut(Sender: TObject; Command: TFlowOutCommand);
var
i:integer;
begin
Inherited;
//i:=0;
Dialogs.ShowMessage('0');
{ DataSetBroker1.DataSet.First ;
while not DataSetBroker1.DataSet.Eof do
begin
try
Query1 :=TQuery.Create(Self);
Query1.ConnectionString := 'DATABASEURL=Biz:\OABGZDHXT\BGZDHSJK.DATABASE';
Query1.Close;
Query1.CommandText := 'Update TSZB set JYSL=JYSL+'+DataSetBroker1.DataSet.FieldByName('JYSL').AsString+' where TSBH='''+ DataSetBroker1.DataSet.FieldByName('TSBH').AsString +'''';
Query1.Execute;
i:=1;
except
on e:Exception do
Dialogs.ShowMessage(e.Message);
end;
DataSetBroker1.DataSet.Next;
end;
if i=1 then
Dialogs.ShowMessage('库存量已经更改'); }
end;
procedure TTSSH.FlowBroker1BeforeFlowFinish(Sender: TObject; Command: TFlowFinishCommand);
var
i:integer;
begin
Inherited;
i:=0;
Dialogs.ShowMessage('0');
DataSetBroker1.DataSet.First ;
while not DataSetBroker1.DataSet.Eof do
begin
try
Query1 :=TQuery.Create(Self);
Query1.ConnectionString := 'DATABASEURL=Biz:\OABGZDHXT\BGZDHSJK.DATABASE';
Query1.Close;
Query1.CommandText := 'Update TSZB set JYSL=JYSL+'+DataSetBroker1.DataSet.FieldByName('JYSL').AsString+' where TSBH='''+ DataSetBroker1.DataSet.FieldByName('TSBH').AsString +'''';
Query1.Execute;
i:=1;
except
on e:Exception do
Dialogs.ShowMessage(e.Message);
end;
DataSetBroker1.DataSet.Next;
end;
if i=1 then
Dialogs.ShowMessage('库存量已经更改');
end;
procedure TTSSH.FlowBroker1BeforeFlowBack(Sender: TObject; Command: TFlowBackCommand);
begin
Inherited;
Dialogs.ShowMessage('111');
end;
procedure TTSSH.FlowBroker2BeforeFlowOut(Sender: TObject; Command: TFlowOutCommand);
var
i:integer;
begin
Inherited;
i:=0;
Dialogs.ShowMessage('0');
DataSetBroker1.DataSet.First ;
while not DataSetBroker1.DataSet.Eof do
begin
try
Query1 :=TQuery.Create(Self);
Query1.ConnectionString := 'DATABASEURL=Biz:\OABGZDHXT\BGZDHSJK.DATABASE';
Query1.Close;
Query1.CommandText := 'Update TSZB set JYSL=JYSL+'+DataSetBroker1.DataSet.FieldByName('JYSL').AsString+' where TSBH='''+ DataSetBroker1.DataSet.FieldByName('TSBH').AsString +'''';
Query1.Execute;
i:=1;
except
on e:Exception do
Dialogs.ShowMessage(e.Message);
end;
DataSetBroker1.DataSet.Next;
end;
if i=1 then
Dialogs.ShowMessage('库存量已经更改');
end;
end. |