Exemple #1
0
        public ActionResult Delete(int id)
        {
            BTGPModel del = db.Cyrsach.Find(id);

            if (del == null)
            {
                return(HttpNotFound());
            }
            return(View(del));
        }
Exemple #2
0
        public ActionResult DeleteS(int id)
        {
            BTGPModel s = new BTGPModel {
                Id = id
            };

            db.Entry(s).State = EntityState.Deleted;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            BTGPModel b = db.Cyrsach.Find(id);

            if (b == null)
            {
                return(HttpNotFound());
            }
            db.Cyrsach.Remove(b);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            BTGPModel student = db.Cyrsach.Find(id);

            if (student != null)
            {
                return(View(student));
            }
            return(RedirectToAction("Index"));
        }
Exemple #5
0
 public ActionResult Add(BTGPModel student)
 {
     db.Entry(student).State = EntityState.Added;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }