using System; using System.Linq; using System.Linq.Expressions; using System.Collections.Generic; using System.Collections.ObjectModel; using DevExpress.Mvvm; using DevExpress.Mvvm.POCO; using DevExpress.DevAV.Common.Utils; using DevExpress.DevAV.DevAVDbDataModel; using DevExpress.Mvvm.DataModel; using DevExpress.DevAV; using DevExpress.DevAV.Common.ViewModel; using DevExpress.Mvvm.ViewModel; namespace DevExpress.DevAV.ViewModels { /// /// Represents the single Order object view model. /// public partial class OrderViewModel : SingleObjectViewModel { /// /// Creates a new instance of OrderViewModel as a POCO view model. /// /// A factory used to create a unit of work instance. public static OrderViewModel Create(IUnitOfWorkFactory unitOfWorkFactory = null) { return ViewModelSource.Create(() => new OrderViewModel(unitOfWorkFactory)); } /// /// Initializes a new instance of the OrderViewModel class. /// This constructor is declared protected to avoid undesired instantiation of the OrderViewModel type without the POCO proxy factory. /// /// A factory used to create a unit of work instance. protected OrderViewModel(IUnitOfWorkFactory unitOfWorkFactory = null) : base(unitOfWorkFactory ?? UnitOfWorkSource.GetUnitOfWorkFactory(), x => x.Orders, x => x.InvoiceNumber) { } /// /// The view model that contains a look-up collection of Customers for the corresponding navigation property in the view. /// public IEntitiesViewModel LookUpCustomers { get { return GetLookUpEntitiesViewModel((OrderViewModel x) => x.LookUpCustomers, x => x.Customers); } } /// /// The view model that contains a look-up collection of CustomerStores for the corresponding navigation property in the view. /// public IEntitiesViewModel LookUpCustomerStores { get { return GetLookUpEntitiesViewModel((OrderViewModel x) => x.LookUpCustomerStores, x => x.CustomerStores); } } /// /// The view model that contains a look-up collection of Employees for the corresponding navigation property in the view. /// public IEntitiesViewModel LookUpEmployees { get { return GetLookUpEntitiesViewModel((OrderViewModel x) => x.LookUpEmployees, x => x.Employees); } } ///// ///// The view model for the OrderOrderItems detail collection. ///// //public CollectionViewModel OrderOrderItemsDetails { // get { return GetDetailsCollectionViewModel((OrderViewModel x) => x.OrderOrderItemsDetails, x => x.OrderItems, x => x.OrderId, (x, key) => x.OrderId = key); } //} } }