Example #1
0
        public ActionResult Delete(int id)
        {
            HT_ThamSo hT_ThamSo = db.HT_ThamSo.Find(id);

            db.HT_ThamSo.Remove(hT_ThamSo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "ID,Ten,GiaTri")] HT_ThamSo hT_ThamSo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hT_ThamSo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(hT_ThamSo));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "ID,Ten,GiaTri")] HT_ThamSo hT_ThamSo)
        {
            if (ModelState.IsValid)
            {
                db.HT_ThamSo.Add(hT_ThamSo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(hT_ThamSo));
        }
Example #4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HT_ThamSo hT_ThamSo = db.HT_ThamSo.Find(id);

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