예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            NHOMTIN nHOMTIN = db.NHOMTINs.Find(id);

            db.NHOMTINs.Remove(nHOMTIN);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "ID_NHOM,tennhomtin")] NHOMTIN nHOMTIN)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nHOMTIN).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nHOMTIN));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "ID_NHOM,tennhomtin")] NHOMTIN nHOMTIN)
        {
            if (ModelState.IsValid)
            {
                db.NHOMTINs.Add(nHOMTIN);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(nHOMTIN));
        }
예제 #4
0
        // GET: Admin/NHOMTINs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NHOMTIN nHOMTIN = db.NHOMTINs.Find(id);

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