unit server_data;
interface
uses
Windows, Messages, SysUtils, Classes, ComServ, ComObj, VCLCom, DataBkr,
DBClient, wzserver_TLB, StdVcl, IBQuery, IBDatabase, Db, IBCustomDataSet,
IBTable, Provider, DBTables;
type
Twz_server_data = class(TRemoteDataModule, Iwz_server_data)
PQ_user: TDataSetProvider;
PQ_COM1: TDataSetProvider;
...
PQ_COM2: TDataSetProvider;
PT_exe: TDataSetProvider;
private
{ Private declarations }
procedure ReOutFiFo(BranchNo:String);
procedure ReSumBranch(BranchNo:String);
procedure ReSumAll ;
protected
class procedure UpdateRegistry(Register: Boolean;
const ClassID, ProgID: string);
override;
procedure serverqueryopen(sqlstring: OleVariant);
safecall;
function serveraction(actionno, actiontext: OleVariant): OleVariant;
safecall;
public
{ Public declarations }
end;
var sendaction:string;
implementation
{$R *.DFM}
class procedure Twz_server_data.UpdateRegistry(Register: Boolean;
const ClassID, ProgID: string);
begin
if Register then
begin
inherited UpdateRegistry(Register, ClassID, ProgID);
EnableSocketTransport(ClassID);
EnableWebTransport(ClassID);
end else
begin
DisableSocketTransport(ClassID);
DisableWebTransport(ClassID);
inherited UpdateRegistry(Register, ClassID, ProgID);
end;
end;
procedure Twz_server_data.serverqueryopen(sqlstring: OleVariant);
begin
with serverquery1do
begin
close;
sql.clear;
sql.add(sqlstring);
try
execsql;
except
sendaction:=sendaction+' // '+sql.text;
end;
end;
//sendactiob:=sendaction+' // '+vartostr(sqlstring));
end;
function Twz_server_data.serveraction(actionno,
actiontext: OleVariant): OleVariant;
var strno,strtext:string;
begin
.....
end;
procedure Twz_server_data.ReSumAll;
//重新合计库存
begin
....
end;
//重新统计branchno 分公司库存
procedure Twz_server_data.ReSumBranch(Branchno:string);
begin
...
end;
//branchno 分公司 按先进先出法重新出仓
procedure Twz_server_data.ReOutFIFO(BranchNo:string);
var lastcodeid :string;
pjdj,editsl,editje :real;
lastsl,lastje :real;
begin
...
end;
initialization
TComponentFactory.Create(ComServer, Twz_server_data,
Class_wz_server_data, ciMultiInstance, tmApartment);
end.