Ticket Q476026
Visible to All Users
Duplicate

XPO Stored procedures

created 12 years ago

Hello Devexpress

i am a bit lost and i need your help

i have a department ,Employee classes with

Many to Many EmployeeAssignment EMp ID,DEP ID,Start,Finish,FTE%

i also have EmployeeAssignAllocation which is the split over months

EmployeeAssignmentId, Month, Planned
1 Jan-2013 1
1 Feb-2013 1
2 Jan-2013 .5

and another Class in the department ,DepartmentAllocation which
In Case they have assigned named resources
is the roll up of the EmployeeAssignAllocation just grouped by employee Type
if Not they can still edit directly the figures on department level

now i have 2 stored procedure
1 is to calc the EmployeeAssignDetails
2 is to do the rollup to the

can you advise me where and how to call the 1 stored procedure
i found myself adding alot of calls to it and still not able to make it work 100%

i need to call it whenever there is a new assignment added ,Deleted, modify the assignment header like start or finish dates or working% of the employee

then i need to call sp2 rollup to department

while creating some sample records the order of executing the stored procedure is reversed
the sp2 is called before the sp1 is able to calculate the employee sassignement split

after calling the stored procedures the list views is not refreshed unless i click f5

it is not very clear
but may be you can give some guide lines on how to call stored procedures then force refresh of the aggregated objects
in the onsaved virtual method

Comments (1)
DevExpress Support Team 12 years ago

    Hi Tony.
    I am afraid the information you provided is insufficient to suggest a solution. Since the XAF design does not expect stored procedures to modify data, there is no good place to execute them. If you want to call a procedure in the overridden OnSaved method, check that the object's session is not NestedUnitOfWork, because the object is not actually saved to the database in this instance. Also note that the object space is committed within its separate transaction, and you cannot include you stored procedure call into it. So, if you call your procedure before committing the object space, make sure to rollback changes if the subsequent commit fails. And if you call your procedure after committing the object space, your procedure should not fail.
    As for refreshing XAF views, since XAF knows nothing about your procedures and changes they make to data, you need to manually reload modified objects.
    Taking into account all these difficulties, I recommend that you abandon using stored procedures and modify data via object space methods.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.