Exemple #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            THONGTIN tHONGTIN = db.THONGTINs.Find(id);

            db.THONGTINs.Remove(tHONGTIN);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "ThongtinID,Tieude,Noidung")] THONGTIN tHONGTIN)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tHONGTIN).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tHONGTIN));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "ThongtinID,Tieude,Noidung")] THONGTIN tHONGTIN)
        {
            if (ModelState.IsValid)
            {
                db.THONGTINs.Add(tHONGTIN);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tHONGTIN));
        }
Exemple #4
0
        // GET: THONGTINs/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            THONGTIN tHONGTIN = db.THONGTINs.Find(id);

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