Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Classse classse = db.Classse.Find(id);

            db.Classse.Remove(classse);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit(Classse classse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(classse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(classse));
 }
Пример #3
0
        //
        // GET: /Classse/Details/5

        public ActionResult Details(int id = 0)
        {
            Classse classse = db.Classse.Find(id);

            if (classse == null)
            {
                return(HttpNotFound());
            }
            return(View(classse));
        }
Пример #4
0
        public ActionResult Create(Classse classse)
        {
            if (ModelState.IsValid)
            {
                db.Classse.Add(classse);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(classse));
        }
Пример #5
0
        //
        // GET: /Classse/Edit/5

        public ActionResult Edit(int id = 0)
        {
            Classse classse = db.Classse.Find(id);

            if (classse == null)
            {
                return(HttpNotFound());
            }
            var teachers = db.Teachers.ToList();

            ViewBag.Teachers = teachers;
            return(View(classse));
        }