예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Collegian collegian = db.Collegians.Find(id);

            db.Collegians.Remove(collegian);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "CollegianId,UniversityId,FirstName,LastName,StudentId,Phone,CellPhone,Address,LoginId,EMail")] Collegian collegian)
 {
     if (ModelState.IsValid)
     {
         db.Entry(collegian).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Home"));
     }
     return(View(collegian));
 }
예제 #3
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Collegian collegian = db.Collegians.Find(id);

            if (collegian == null)
            {
                return(HttpNotFound());
            }
            return(View(collegian));
        }