public ActionResult Create() { if (Session["CurrentODP"] != null) { ViewBag.ODPId = new SelectList(db.ODPs, "Id", "NODP", (int)Session["CurrentODP"]); } else { ViewBag.ODPId = new SelectList(db.ODPs, "Id", "NODP"); } Session["CurrentODP"] = null; ViewBag.ProcessId = new SelectList(db.Processes, "Id", "Title"); ViewBag.UserId = new SelectList(db.vwUsers, "Id", "Username"); ViewBag.Status = new SelectList(ODPProcessStatus.GetList(), "Value", "Name"); return(View()); }
// GET: ODPProcesses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ODPProcess oDPProcess = db.ODPProcesses.Find(id); if (oDPProcess == null) { return(HttpNotFound()); } ViewBag.ODPId = new SelectList(db.ODPs, "Id", "NODP", oDPProcess.ODPId); ViewBag.ProcessId = new SelectList(db.Processes, "Id", "Title", oDPProcess.ProcessId); ViewBag.UserId = new SelectList(db.vwUsers, "Id", "Username", oDPProcess.UserId); ViewBag.Status = new SelectList(ODPProcessStatus.GetList(), "Value", "Name", oDPProcess.Status); return(View(oDPProcess)); }