 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ali Ade Guest
|
Posted: Wed Nov 10, 2004 8:04 am Post subject: how can server show message |
|
|
in multitier using delphi 8 ,the problem is when the client post values in
database on the server check validate of these values i want to know which
event i must use on the server to check , is it onupdated for dbadaptor ?
second if the server need to show message at the client how can this done?
and some times the server need to show message at the client and wait for
response to determine what will done.pls help ,thanks.
|
|
| Back to top |
|
 |
Hifni Guest
|
Posted: Thu Dec 02, 2004 5:19 am Post subject: Re: how can server show message |
|
|
"Ali Ade"
<mohamad_adel_2000 (AT) hotmail (DOT) com> wrote:
| Quote: | in multitier using delphi 8 ,the problem is when the client post values in database on the server check validate of these values i want to know which
event i must use on the server to check , is it onupdated for dbadaptor ? |
I use the DataSetProvider.BeforeUpdate Event to Validate, process, check Data etc. It's a great place to do that kind of stuffs.
| Quote: | second if the server need to show message at the client how can this done?
I think You cant Show Message to the Client, but could send any error message after Validation, etc as: |
Raise Exception.Create(<----Type Your Message Here---->);
For Example:
Here I'm Validating the StartMeter and EndMeter Value, and if it didn't come across the said validation, the server will send an Error Message:
procedure TAppServerFuelMax.dspFuelIssueEntryBeforeUpdateRecord(
Sender: TObject; SourceDS: TDataSet; DeltaDS: TClientDataSet;
UpdateKind: TUpdateKind; var Applied: Boolean);
begin
if UpdateKind in [ukInsert,ukmodify] then
begin
With DeltaDS do
begin
//1st Business Logic: Check whether the Endmeter is Larger than the StartMeter.........................
if (FieldByName('IsVehicle').NewValue = True) then
if (FieldByName('StartMeter').NewValue) >= (FieldByName('EndMeter').NewValue)then
Raise Exception.Create('Entries Could Not Have Higher StartMeter Value than EndMeter Value');
end;
end;
Hope You might have got the idea now.
Rgds,
Hifni
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|