Current filter:
                                You should refresh the page.
                                Support Center

                                How to calculate a master property based on values from a details collection

                                0
                                • Robert Fuchs 01.28.2013

                                  Not using XAF web, just to let you know that there are warnings in 12.2.5:

                                  Warning     1     Could not resolve this reference. Could not locate the assembly "DevExpress.Web.ASPxEditors.v12.2". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.     WinWebSolution.Web
                                  Warning     2     Could not resolve this reference. Could not locate the assembly "DevExpress.Web.ASPxGridView.v12.2". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.     WinWebSolution.Web
                                  Warning     3     The referenced component 'DevExpress.Web.ASPxEditors.v12.2' could not be found.      WinWebSolution.Web
                                  Warning     4     The referenced component 'DevExpress.Web.ASPxGridView.v12.2' could not be found.      WinWebSolution.Web

                                You must  log in  or  register  to leave comments
                                Select file
                                • Order.cs
                                • Product.cs
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • v2013 vol 1.4 - v2013 vol 2.9
                                • v2012 vol 2.4 - v2012 vol 2.16
                                • v2012 vol 1.4 - v2012 vol 1.12
                                • v2011 vol 2.5 - v2011 vol 2.14
                                • v2011 vol 1.7 - v2011 vol 1.12
                                • v2011 vol 1.4 - v2011 vol 1.6
                                • v2010 vol 2.9 - v2010 vol 2.11
                                • v2010 vol 2.3 - v2010 vol 2.8
                                • v2010 vol 1.4 - v2010 vol 1.12
                                • v2009 vol 3.2 - v2009 vol 3.7
                                • v2009 vol 2.5 - v2009 vol 2.13
                                using System;
                                using DevExpress.Xpo;
                                using DevExpress.Persistent.BaseImpl;
                                
                                namespace WinWebSolution.Module {
                                    public class Order : BaseObject {
                                        public Order(Session session) : base(session) { }
                                        private string fDescription;
                                        public string Description {
                                            get { return fDescription; }
                                            set { SetPropertyValue("Description", ref fDescription, value); }
                                        }
                                        private decimal fTotal;
                                        public decimal Total {
                                            get { return fTotal; }
                                            set {
                                                SetPropertyValue("Total", ref fTotal, value);
                                                if(!IsLoading && !IsSaving && Product != null) {
                                                    Product.UpdateOrdersTotal(true);
                                                    Product.UpdateMaximumOrder(true);
                                                }
                                            }
                                        }
                                        private Product fProduct;
                                        [Association("Product-Orders")]
                                        public Product Product {
                                            get { return fProduct; }
                                            set {
                                                Product oldProduct = fProduct;
                                                SetPropertyValue("Product", ref fProduct, value);
                                                if (!IsLoading && !IsSaving && oldProduct != fProduct) {
                                                    oldProduct = oldProduct ?? fProduct;
                                                    oldProduct.UpdateOrdersCount(true);
                                                    oldProduct.UpdateOrdersTotal(true);
                                                    oldProduct.UpdateMaximumOrder(true);
                                                }
                                            }
                                        }
                                    }
                                }

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners