public ActionResult DeleteConfirmed(Guid id) { psu psu = db.psus.Find(id); db.psus.Remove(psu); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "GID,Name,Specs,Image,Manufacture")] psu psu) { var myrole = new Class1(); var userID = User.Identity.GetUserId(); ViewBag.currentrole = myrole.a(userID); if (ModelState.IsValid) { db.Entry(psu).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(psu)); }
public ActionResult Create([Bind(Include = "GID,Name,Specs,Image,Manufacture")] psu psu) { var myrole = new Class1(); var userID = User.Identity.GetUserId(); ViewBag.currentrole = myrole.a(userID); if (ModelState.IsValid) { psu.GID = Guid.NewGuid(); db.psus.Add(psu); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(psu)); }
public ActionResult Details(Guid?id) { var myrole = new Class1(); var userID = User.Identity.GetUserId(); ViewBag.currentrole = myrole.a(userID); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } psu psu = db.psus.Find(id); if (psu == null) { return(HttpNotFound()); } return(View(psu)); }