public ActionResult Orders() { ProductModel data = new ProductModel(); var item = data.Get_One(int.Parse(Session["Order_Id"].ToString())); if (item == null) { return RedirectToAction("Index"); } Session["Product_Name"] = item.Name; Session["Total_Price"] = item.Price * int.Parse(Session["Order_Quantity"].ToString()); Session["Product_Id"] = int.Parse(Session["Order_Id"].ToString()); return View(item); }
public ActionResult Edit(ProductModel.ProductModelShow item, HttpPostedFileBase file = null, HttpPostedFileBase ContentPic = null) { if (ModelState.IsValid) { if (item.Content == null) { item.Content = ""; } int vid = Method.Get_UserId(Request.Cookies, Session); if (data.Update(item, 0, file, "Product/" + vid, Server, ContentPic) > 0) { return RedirectToAction("Index"); } } ViewBag.Title = "Error"; TempData["err"] = 2; return View("Index", item); }