您的位置:首页 > 其它

基于midas的MIS中的用户操作日志的创建(待续)

2006-08-20 02:33 183 查看
http://groups.google.com/group/borland.public.midas/browse_thread/thread/62869146faacfc96/c75cd6a1c77bd295?lnk=st&q=midas+identify+client&rnum=6#c75cd6a1c77bd295



All 5 messages in topic - view as tree
From: Andreas Oberhofer - view profile
Date: Fri, Nov 24 2000 12:00 am
Not yet rated

show options

Hello,

when processing the BeforeApplyUpdates event on the server in a few cases I
need some additional data from the client (in my case a file).

How do I call the client and ask him to send me the data ?
Or: how do I start a communication between server and client from the server
side ?

I am using TSocketConnections, ciMultiInstance, tmApartment.

Thank you
Andreas Oberhofer

Reply Rate this post:

From: Dan Miser /(TeamB/) - view profile
Date: Sat, Nov 25 2000 12:00 am
Not yet rated

show options

Take a look at my Callback(2) sample on the MIDAS page of my web site.
--
Dan Miser
http://www.distribucon.com

"Andreas Oberhofer" <Andreas.Oberho...@tin.it> wrote in message

news:3a1e6228$1_1@dnews...

- Show quoted text -

Reply Rate this post:

From: Andreas Oberhofer - view profile
Date: Mon, Nov 27 2000 12:00 am
Not yet rated

show options

Thank you Dan,

I have already seen this example.
It installs an additional (communication-) server at the client side.
Do I have to install also the ScktSrv.exe on the client ?

Is there no easier way to have the same result, like calling a method of the
TClientDataset or the TSocketConnection ?

If not I think it would be easier to pack some status information into the
AfterApplyUpdates event. My problem is that I would like to call the client
immediatly when processing every single record in the BeforeUpdateRecord
event. When I use AfterApplyUpdates I have to identify the single records I
want to talk about.
It seems that it is not possible with standard Midas methods to communicate
on a record per record level.

Thank you
Andreas

Reply Rate this post:

From: Alexandre GUILLIEN - view profile
Date: Mon, Nov 27 2000 12:00 am
Not yet rated

show options



> Thank you Dan,

> I have already seen this example.
> It installs an additional (communication-) server at the client side.
> Do I have to install also the ScktSrv.exe on the client ?

No.

> It seems that it is not possible with standard Midas methods to communicate
> on a record per record level.

It is not.
The callback solution is the best and only available. You just have, from the
server, to call methods of the callback object you created client-side to have
direct communication with the client. The requirements are to use
TSocketConnection client side and use the structure given in the callback
example. Nothing more.

Alexandre Guillien

Reply Rate this post:

From: Sunil Furtado - view profile
Date: Thurs, Nov 30 2000 12:00 am
Not yet rated

show options



> If not I think it would be easier to pack some status information into the
> AfterApplyUpdates event. My problem is that I would like to call the
client
> immediatly when processing every single record in the BeforeUpdateRecord
> event. When I use AfterApplyUpdates I have to identify the single records
I
> want to talk about.

I store some state information in my client and pass this information as
parameters to the server on apply updates (Thanks to Dan).

Client side:

if dm.paymast.ChangeCount > 0 then
begin
dm.paymast.setoptionalparam('UserLevel', dm.level, True); // thise are
the optional parameters
dm.paymast.setoptionalparam('location', dm.location, True);
if dm.paymast.applyupdates(0) = 0 then
dm.paymast.refresh;
end
else
messagedlg('No changes to save !!!',mtinformation,[mbok],0);

On the server:

beforeupdaterecored event:
var
UserLevel,location: string;
begin
// get the parameters from the client
UserLevel := DeltaDS.GetOptionalParam('UserLevel');
location := DeltaDS.GetOptionalParam('location');
// check for access permissions
if (UpdateKind = ukModify) then
begin
if ((UserLevel <> 'A') and (location <> 'C')) then
raise exception.create('You dont have enough rights to modify data');
end;
end;

A bit extreme to send info to the server and then raise the error but it
works.

--
Sunil Furtado
New Mangalore Port Trust

Reply Rate this post:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: