示例#1
0
        public HttpResponseMessage DeleteItems(string[] ItemList)
        {
            ShoppingcartModel Shoppingmodel = new ShoppingcartModel();
            string            json          = JsonConvert.SerializeObject(Shoppingmodel.GetItemDelete(ItemList));

            return(Request.CreateResponse(HttpStatusCode.OK, json));
        }
示例#2
0
        public HttpResponseMessage GetItem(string val1)
        {
            ShoppingcartModel Shoppingmodel = new ShoppingcartModel();
            string            json          = JsonConvert.SerializeObject(Shoppingmodel.GetItemForAddtocart(val1));

            return(Request.CreateResponse(HttpStatusCode.OK, json));
        }
示例#3
0
        public HttpResponseMessage GetOrderDetails(string val1)
        {
            ShoppingcartModel Shoppingmodel = new ShoppingcartModel();
            string            json          = JsonConvert.SerializeObject(Shoppingmodel.GetOrdersList());

            return(Request.CreateResponse(HttpStatusCode.OK, json));
        }
示例#4
0
        public HttpResponseMessage Post(itemDetailsDataContract ItemDetails)
        {
            ShoppingcartModel Shoppingmodel = new ShoppingcartModel();
            string            json          = JsonConvert.SerializeObject(Shoppingmodel.addItemMaster(ItemDetails));

            return(Request.CreateResponse(HttpStatusCode.OK, json));
        }
示例#5
0
        public ActionResult Detail(int?id)
        {
            ShoppingcartModel model = new ShoppingcartModel();

            return(View(model.GetItemDetail(id)));
            //return View();
        }
示例#6
0
        public ActionResult Edit(int?id)
        {
            ShoppingcartModel model = new ShoppingcartModel();

            List <SelectListItem> items = new List <SelectListItem>();

            items.Add(new SelectListItem {
                Text = "In stock", Value = "0"
            });
            items.Add(new SelectListItem {
                Text = "Out of stock", Value = "1"
            });

            ViewBag.ListItemStatus = new SelectList(items.Select(x => new SelectListItem()
            {
                Text  = x.Text.ToString(),
                Value = x.Value
            }), "Value", "Text");

            return(View(model.GetItemDetail(id)));
            //return View();
        }
示例#7
0
        public ActionResult Detail(string id)
        {
            ShoppingcartModel model = new ShoppingcartModel();

            return(View(model.GetOrderDetails(id)));
        }