public ActionResult Index(PriceComplain model) { if (ModelState.IsValid) { db.PriceComplains.Add(model); db.SaveChanges(); return(RedirectToAction("Index", "Store")); } return(View(model)); }
// GET: Complain public ActionResult Index(int id) { var product = db.Products.Include("Shop").Where(x => x.ProductID == id).FirstOrDefault(); var complain = new PriceComplain { ProductID = product.ProductID, Product = product, Shop = product.Shop, ShopID = product.ShopID, }; return(View(complain)); }