Overriding SubmitChanges

5 posts, 0 answers
  1. plusHR
    plusHR avatar
    58 posts
    Member since:
    Aug 2012

    Posted 15 Dec 2011 Link to this post

    When calling SubmitChanges I want to be able to pass a parameter into the SubmitChanges routine. Could you advise the best method of how to override this or how to create a new call on the RadDomainDataSource so that I can do some business logic, then submit the changes. Thus SubmitChanges(Enum.RunAuditRoutine)

    Thanks
    Paul
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 15 Dec 2011 Link to this post

    Hi Paul,

    The SubmittingChanges event will be called before they are sent to the server, i.e. before we call DomainContext.SubmitChanges().

    You can't tamper with the changes made however because this will break the internal logic of RadDomainDataSource.

    When the submit is finished you will receive the SubmittedChanges event, i.e. when the DomainContext invokes the callback method that we have passed in its SubmitChanges method.

    I hope this helps.

    Greetings,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. plusHR
    plusHR avatar
    58 posts
    Member since:
    Aug 2012

    Posted 15 Dec 2011 Link to this post

    Thanks. When the data is passed back to the server I need to run some business logic workflow [which will adjust various status fields]. So when the data is passed back I would not know "what" workflow to execute prior to the Saving of the data to the database.

    Thus Table1 could have different work-flows that need computing. Therefore I need to be able to pass a parameter back to the server which states the workflow function to use. Any ideas. Previously I would attach an entity and use that to work out the workflow, however this used to be added to the DomainContext option of the DomainDataSource where-as I don't believe that is supported in the RadDomainDataSource.

    Thanks
    P
  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 15 Dec 2011 Link to this post

    Hello Paul,

    I see.

    Our RadDomainDataSource just like the stock MS DomainDataSource uses the DomainContext for everything it does.

    So you can take the DomainContext instance that you assigned to the RadDomainDataSource.DomainContext property and do the same thing with this DomainContext.

    I suppose that if you "piggy-back" an additional entity back to the server it would not cause any harm.

    Can you try this and see how it goes?

    Greetings,

    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. plusHR
    plusHR avatar
    58 posts
    Member since:
    Aug 2012

    Posted 15 Dec 2011 Link to this post

    Yes sure, just wanted to see if there was a cleaner way to get a parameter back to the server from the client thus not having to piggy-back the additional entity.

    P
Back to Top
DevCraft banner