SL v3.6.2 CslaDataProvider_Saved

SL v3.6.2 CslaDataProvider_Saved

Old forum URL: forums.lhotka.net/forums/t/6729.aspx


davido_xml posted on Thursday, April 02, 2009

Hi,

Is there a way using the event handler below to tell what caused the event to be called e.g. new, update, delete?

private void CslaDataProvider_Saved(object sender, Csla.Core.SavedEventArgs e)

RockfordLhotka replied on Saturday, April 04, 2009

I don't believe any of that information is available, no.

I also don't know that such information is readily available to the data provider control (which is what raises the event). The whole concept of insert/update/delete/execute is managed inside the data portal and/or your DAL, and higher layer constructs like the business object and UI don't get access to that sort of information.

davido_xml replied on Monday, April 06, 2009

I have a UI with 4 UserControls (NW, NE, SW, SE) contained within a UserControl (Main).

SE displays summary data for the contents of NW, NE and SW.

If a user creates a new BO in NW I would like SE to refresh its data. Most but not all operations in NW will requires SE to refresh itself.

I was planning on raising events up to Main which in turn will cause SE to refresh itself.

That was why I would like the UI to be aware of what occured in the DataProvider. I was using the DataProvider as it receives the call back from the async operation. It is only once the call back has been received that it makes sense to get SE to refresh itself.

Is there another way to achieve this?

RockfordLhotka replied on Monday, April 06, 2009

The only thing I can think of, is that there are static events on the DataPortal class itself, and I think they might have access to the type of operation that was performed. I'm not sure about that, as the operation type might only be fully resolved on the server, but I think the client-side data portal figures it out too.

Copyright (c) Marimer LLC