Jump to content

Beginner

Members
  • Posts

    90
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Beginner

  1. Mmm...

    IMHO, old Unigui Builds rised exceptions on Asynchronous FireBird Events.

    I tink, Farshad fixed that on new builds : No notifications are now possible and we can'nt work with this technic.

    So that code from DocJones is obsolete.

     

    OK,

    Why?  when you call event in trigger or procedure you can insert event table and select with unitimer

     

    1. From your Service application, when a notification (trigger) is raising, 

    2. this service application connect to your DB and insert something on a special table let's say TAlterts

    3. Now, From your Unigui Application, check via an Unitimer, this TAlerts  (all 10 secondes for exemple)

    4. If they are changes then refresh your DBGrid.

     

    Best regards

     

     

    I don't understand why use service for this

    Example

    I have table Torder

     

    when inserting or update or delete in this table i have trigger which

    insert to table Talert  log  insert update delete etc

     

    from this table i will select unitimer but exclude old logs?

  2. How you connect your service + unigui and on web app  control or receive events from service ?

     

    Alert Notifications from a DB Table

    are useful when you need a realtime DBGrid refresh data.

    We got used on VCL project. That have worked fine.

     

    Ok, but on Web Developpment, generally and surprisingly, avoid using this technic is a good practice !.

    We should not open regularly some long queries for refreshing a DBGrid.

    (taking care of ressources consumptions).

     

    But in some case, we need it also.

    For instance, on a small DB, when a secretary keep an eye on new patients.

    So, let's go on this idea with Unigui :

     

    No need to use big technics here :  UniTimer will save us.

     

    Many scenarios and possibilities :

     

    1. Notification Event  after insert or Delete :  

    No need, a service listener. Just use a UniTimer (10 sec) on your form to compare Record Count(*) before refreshnig the UniDBGrid.

     

    2. Notification Event after an Update :

    Farshad said just above "Asynchronous events generated independent from unigui can not be used in unigui. "

    The idea, is to develope  a standard Delphi Service (witch have an IBCAlert component or else...)  in background to listen events.

    When a notification is raising, you can insert on a table the last event, let say ('1' for insert, '2' for delete, '3' for update, etc...) 

    Then, retreive this event from an unitimer on your Unigui project.

     

    Very simple :)

     

     

    Why?  when you call event in trigger or procedure you can insert event table and select with unitimer

  3. Thank you Farshad.

    OK. No problem.

    I will develope a standard Service, witch uses IBCAlert for "listening" events.

     

    Good custard desert :)

    Can you more explain how doit?

    How you connect your service + unigui and on web app  control or receive events from service

    ?

    • Upvote 1
  4. I have found a bit of a hack solution.  Maybe there is a more direct way of doing it, but this is what works for me:

    Create a helper for the TFDDataSet class as follows:

     

    type  TFDDataSetHelper = class helper for TFDDataSet
    
      public
    
        procedure InternalCalc;
      end;
    
    
    implementation
    
    
    uses  FireDAC.DatS;
    
    
    
    { TFDDataSetHelper }
    
    
    procedure TFDDataSetHelper.InternalCalc;
    var
      oRow: TFDDatSRow;
    begin
    
      oRow := GetRow(ActiveBuffer);
    
      oRow.ForceChange(rsCalculating);
    end;

    and use the unit then, after any of the fields change that the internal calculated fields rely on, call:

     
    TFDDataSet(dataset).InternalCalc;
  5.  

    I am a new user ,I want to download the mDemo which like this web demo ,where Can I download this demo? I download the trail soft ,but not find this demo,can you help me ?

    Best regards!

     

    c:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\AllFeaturesDemo\mdemo.dpr

×
×
  • Create New...