Пример #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            NHOMSP nHOMSP = db.NHOMSPs.Find(id);

            db.NHOMSPs.Remove(nHOMSP);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "MaNhomSP,TenNhomSP")] NHOMSP nHOMSP)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nHOMSP).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nHOMSP));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "MaNhomSP,TenNhomSP")] NHOMSP nHOMSP)
        {
            if (ModelState.IsValid)
            {
                db.NHOMSPs.Add(nHOMSP);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(nHOMSP));
        }
Пример #4
0
        // GET: Admin/NHOMSPs/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NHOMSP nHOMSP = db.NHOMSPs.Find(id);

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