コード例 #1
0
 public ActionResult Create()
 {
     viewmodel          = new ProductCategoryViewModel();
     viewmodel.category = category.DisplayAll();
     viewmodel.product  = new Product();
     return(View(viewmodel));
 }
コード例 #2
0
        // GET: Product
        public ActionResult Index()
        {
            ProductListViewModel listModel = new ProductListViewModel();

            listModel.category = category.DisplayAll();
            listModel.product  = items.DisplayAll();//home page
            return(View(listModel));
        }
コード例 #3
0
        public ActionResult orderList()
        {
            GenericDataAccess <Order> order     = new GenericDataAccess <Order>(new DataContext());
            IQueryable <Order>        Vieworder = order.DisplayAll();

            return(View(Vieworder));
        }
コード例 #4
0
        public ActionResult UpdateOrder(string id)
        {
            viewModel = new AdminOrderViewModel();
            Order order = orderContext.Find(id);

            //order.orderItems = orderItemContext.DisplayAll().Where(item => item.orderId == order.ID).ToList();
            viewModel.Order  = order;
            viewModel.Status = orderStatus.DisplayAll();
            return(View(viewModel));
        }
コード例 #5
0
        public ActionResult checkout()
        {
            Order    order    = new Order();
            Customer customer = customers.DisplayAll().FirstOrDefault(p => p.Email == User.Identity.Name);

            if (customer != null)
            {
                order.firstName = customer.firstName;
                order.lastName  = customer.lastName;
                order.street    = customer.street;
                order.state     = customer.state;
                order.zipCode   = customer.zipCode;
                order.Email     = customer.Email;
                order.city      = customer.city;
                return(View(order));
            }
            else
            {
                return(RedirectToAction("error"));
            }
        }
コード例 #6
0
 public ActionResult Index()
 {
     return(View(orderContext.DisplayAll()));
 }
コード例 #7
0
 // GET: OrderStatus
 public ActionResult Index()
 {
     return(View(status.DisplayAll()));
 }