コード例 #1
0
        public ActionResult ConfirmOrder()
        {
            var confirmOrderModel = new ConfirmOrderViewModel();
            confirmOrderModel.IsShippingRequired = true;
            confirmOrderModel.SelectedShippingOptionId = 0;
            confirmOrderModel.ShippingOptions.Add(new ShippingOption() { ShippingOptionId = 0, DisplayName = "Please select" });
            confirmOrderModel.ShippingOptions.Add(new ShippingOption() { ShippingOptionId = 1, DisplayName = "Ground - $10" });
            confirmOrderModel.ShippingOptions.Add(new ShippingOption() { ShippingOptionId = 2, DisplayName = "Express - $20" });
            confirmOrderModel.LineItems.Add(new LineItem() { DisplayName = "Lenovo", Quantity = 3, TotalPrice = 1299 });
            confirmOrderModel.LineItems.Add(new LineItem() { DisplayName = "HTC", Quantity = 1, TotalPrice = 599 });

            return View("confirmorder", "defaultlayout", confirmOrderModel);
        }
コード例 #2
0
        private ConfirmOrderViewModel GetOrder()
        {
            var confirmOrderModel = new ConfirmOrderViewModel();
            confirmOrderModel.IsShippingRequired = true;
            confirmOrderModel.SelectedShippingOptionId = 0;
            confirmOrderModel.ShippingOptions.Add(new ShippingOption() { ShippingOptionId = 0, DisplayName = "Please select" });
            confirmOrderModel.ShippingOptions.Add(new ShippingOption() { ShippingOptionId = 1, DisplayName = "Ground - $10" });
            confirmOrderModel.ShippingOptions.Add(new ShippingOption() { ShippingOptionId = 2, DisplayName = "Express - $20" });
            confirmOrderModel.LineItems.Add(new LineItem() { DisplayName = "Lenovo", Quantity = 3, TotalPrice = 1299 });
            confirmOrderModel.LineItems.Add(new LineItem() { DisplayName = "HTC", Quantity = 1, TotalPrice = 599 });

            return confirmOrderModel;
        }