//Get:BlackBox/Create public ActionResult Create() { if (!exLogic.User.hasAccess("BLACKBOX.CREATE")) return RedirectToAction("NoAccess", "Home"); //ViewBag.IsAESVisible = false; //if (exLogic.User.hasAccess("BLACKBOX.AES")) // ViewBag.IsAESVisible = true; MSTR_BlackBox BB = new MSTR_BlackBox(); return View(BB); }
}//PartsBlackBoxlist // GET: Parts/Edit/5 public ActionResult Edit(int id) { if (!exLogic.User.hasAccess("BLACKBOX.EDIT")) return RedirectToAction("NoAccess", "Home"); ViewBag.Title = "Edit Blackbox"; ViewBag.IsAESVisible = false; if (exLogic.User.hasAccess("BLACKBOX.AES")) ViewBag.IsAESVisible = true; // ExponentPortalEntities db = new ExponentPortalEntities(); MSTR_BlackBox BB = db.MSTR_BlackBox.Find(id); return View(BB); }
public ActionResult Edit(MSTR_BlackBox BB) { try { // TODO: Add update logic here if (!exLogic.User.hasAccess("BlackBox.EDIT")) return RedirectToAction("NoAccess", "Home"); if (ModelState.IsValid) { ViewBag.Title = "Edit BlackBox"; BB.CreatedBy = Util.getLoginUserID(); BB.LastUpdateDate = DateTime.Now; db.Entry(BB).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("BlackBoxList", "BlackBox"); } else { return View(BB); } } catch { return View(BB); } }