Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            GDCabinet gdcabinet = db.GDCabinets.Find(id);

            db.GDCabinets.Remove(gdcabinet);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 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));
 }
Exemple #4
0
        public ActionResult Delete(int id)
        {
            GDCabinet gdcabinet = db.GDCabinets.Find(id);

            return(View(gdcabinet));
        }
Exemple #5
0
        public ViewResult Details(int id)
        {
            GDCabinet gdcabinet = db.GDCabinets.Find(id);

            return(View(gdcabinet));
        }