public ActionResult Edit(string Id) { ProductCategory productCategory = context.Find(Id); if (productCategory == null) { return(HttpNotFound()); } else { return(View(productCategory)); } }
public ActionResult Edit(string Id) { Product product = context.Find(Id); if (product == null) { return(HttpNotFound()); } else { ProductManagerViewModel viewModel = new ProductManagerViewModel(); viewModel.Product = product; viewModel.Productcategories = productCategories.Collection(); return(View(viewModel)); } }
private Basket GetBasket(HttpContextBase httpContext, bool createIfNull) { HttpCookie cookie = httpContext.Request.Cookies.Get(BasketSession); Basket basket = new Basket(); if (cookie != null) { string basketID = cookie.Value; if (!string.IsNullOrEmpty(basketID)) { basket = basketContext.Find(basketID); } else { if (createIfNull) { basket = CreateNewBasket(httpContext); } } } else { if (createIfNull) { basket = CreateNewBasket(httpContext); } } return(basket); }
public ActionResult Details(string Id) { Product product = context.Find(Id); if (product == null) { return(HttpNotFound()); } else { return(View(product)); } }