Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tblChild tblChild = db.tblChilds.Find(id);

            db.tblChilds.Remove(tblChild);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "ChildID,Name,Surname,Grade,Age")] tblChild tblChild)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblChild).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tblChild));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "ChildID,Name,Surname,Grade,Age")] tblChild tblChild)
        {
            if (ModelState.IsValid)
            {
                db.tblChilds.Add(tblChild);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblChild));
        }
Beispiel #4
0
        // GET: tblChilds/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblChild tblChild = db.tblChilds.Find(id);

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