Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            students students = db.students.Find(id);

            db.students.Remove(students);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit(students students)
 {
     if (ModelState.IsValid)
     {
         db.Entry(students).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(students));
 }
Esempio n. 3
0
        public ActionResult Create(students students)
        {
            if (ModelState.IsValid)
            {
                db.students.Add(students);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(students));
        }
Esempio n. 4
0
        //
        // GET: /Student/Delete/5

        public ActionResult Delete(int id)
        {
            students students = db.students.Find(id);

            return(View(students));
        }
Esempio n. 5
0
        //
        // GET: /Student/Details/5

        public ViewResult Details(int id)
        {
            students students = db.students.Find(id);

            return(View(students));
        }