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

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:  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值