public ActionResult Edit(string id) { ModuleModel model = new ModuleModel(); model.modulesEdit = db.Modules.Find(id); if (id == null) { return HttpNotFound(); } return View(model); }
public ActionResult Edit(ModuleModel model) { Module mod = new Module(); mod = model.modulesEdit; if (ModelState.IsValid) { db.Entry(model.modulesEdit).State = EntityState.Modified; ; db.SaveChanges(); return RedirectToAction("Index"); } return View(model); }
// // GET: /Module/ public ActionResult Index() { string department = User.Identity.Name; ModuleModel model = new ModuleModel(); model.modulesIndex = (from s in db.Modules where s.DepartmentCode == department select s).ToList(); return View(model); }