public ActionResult DeleteConfirmed(int id) { GDCabinet gdcabinet = db.GDCabinets.Find(id); db.GDCabinets.Remove(gdcabinet); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { GDCabinet gdcabinet = db.GDCabinets.Find(id); ViewBag.CabinetId = new SelectList(db.Cabinets, "Id", "Id", gdcabinet.CabinetId); ViewBag.GDId = new SelectList(db.GroupDisciplines, "Id", "Id", gdcabinet.GDId); ViewBag.LessonId = new SelectList(db.Lessons, "Id", "Name", gdcabinet.LessonId); ViewBag.LessonTypeId = new SelectList(db.LessonTypes, "Id", "Name", gdcabinet.LessonTypeId); ViewBag.SubstituteDGId = new SelectList(db.GroupDisciplines, "Id", "Id", gdcabinet.SubstituteDGId); return(View(gdcabinet)); }
public ActionResult Edit(GDCabinet gdcabinet) { if (ModelState.IsValid) { db.Entry(gdcabinet).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CabinetId = new SelectList(db.Cabinets, "Id", "Id", gdcabinet.CabinetId); ViewBag.GDId = new SelectList(db.GroupDisciplines, "Id", "Id", gdcabinet.GDId); ViewBag.LessonId = new SelectList(db.Lessons, "Id", "Name", gdcabinet.LessonId); ViewBag.LessonTypeId = new SelectList(db.LessonTypes, "Id", "Name", gdcabinet.LessonTypeId); ViewBag.SubstituteDGId = new SelectList(db.GroupDisciplines, "Id", "Id", gdcabinet.SubstituteDGId); return(View(gdcabinet)); }
public ActionResult Delete(int id) { GDCabinet gdcabinet = db.GDCabinets.Find(id); return(View(gdcabinet)); }
public ViewResult Details(int id) { GDCabinet gdcabinet = db.GDCabinets.Find(id); return(View(gdcabinet)); }