public ActionResult Remove(int id) { Customers_Packages custPkg = db.Customers_Packages.Find(id); db.Customers_Packages.Remove(custPkg); db.SaveChangesAsync(); return(RedirectToAction("Customer_Packages", "Home")); }
public ActionResult Buy(int id) { Customers_Packages custPkg = new Customers_Packages(); if (Session["custId"] != null) { int custId = (int)Session["custId"]; custPkg.CustomerId = custId; custPkg.PackageId = id; db.Customers_Packages.Add(custPkg); db.SaveChangesAsync(); return(RedirectToAction("Customer_Packages", "Home")); } else { return(RedirectToAction("Login", "Account")); } }