Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Tbl_Students tbl_Students = db.Tbl_Students.Find(id);

            db.Tbl_Students.Remove(tbl_Students);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "ID,Name,Email,Mobile,Address,CourseId")] Tbl_Students tbl_Students)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_Students).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_Students));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "ID,Name,Email,Mobile,Address,CourseId")] Tbl_Students tbl_Students)
        {
            if (ModelState.IsValid)
            {
                db.Tbl_Students.Add(tbl_Students);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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