예제 #1
0
        public StoreSalesInfo ReviewSalesResponsibility()
        {
            var ssi = Container.NewViewModel <StoreSalesInfo>();

            ssi.PopulateUsingKeys(new string[] { AccountNumber, false.ToString() });
            return(ssi);
        }
예제 #2
0
        //To test a ViewModelEdit
        public EmailTemplate CreateEmail()
        {
            var email = Container.NewViewModel <EmailTemplate>();

            email.Status = EmailStatus.New;
            return(email);
        }
예제 #3
0
        public QuickOrderForm QuickOrder([ContributedAction(subMenu)] Customer customer)
        {
            var qo = Container.NewViewModel <QuickOrderForm>();

            qo.Customer = customer;
            return(qo);
        }
        public CustomerDashboard CustomerDashboard(string accountNumber)
        {
            Customer cust = FindCustomerByAccountNumber(accountNumber);
            var      dash = Container.NewViewModel <CustomerDashboard>();

            dash.Root = cust;
            return(dash);
        }
        public CustomerCollectionViewModel ShowCustomersWithAddressInRegion(CountryRegion region, [ContributedAction] IQueryable <Customer> customers)
        {
            List <Customer> cc   = customers.Where(c => c.Addresses.Any(a => a.Address.StateProvince.CountryRegion == region)).ToList();
            var             ccvm = Container.NewViewModel <CustomerCollectionViewModel>();

            ccvm.Customers = cc.ToList();
            return(ccvm);
        }
        public QuickOrderForm AddDetail([FindMenu] Product product, short number)
        {
            var ol = Container.NewViewModel <OrderLine>();

            ol.Product = product;
            ol.Number  = number;
            details.Add(ol);

            return(this);
        }
        public void PopulateUsingKeys(string[] instanceId)
        {
            string an = instanceId.First();

            Customer = Container.Instances <Customer>().Single(c => c.AccountNumber == an);

            for (int i = 1; i < instanceId.Count(); i = i + 2)
            {
                var dKeys = new[] { instanceId[i], instanceId[i + 1] };
                var d     = Container.NewViewModel <OrderLine>();
                d.PopulateUsingKeys(dKeys);
                details.Add(d);
            }
        }