示例#1
0
        public ActionResult DeleteConfirmed(string id)
        {
            NotDay notDay = db.NotDays.Find(id);

            db.NotDays.Remove(notDay);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "NhatKySo,NoiDung")] NotDay notDay)
 {
     if (ModelState.IsValid)
     {
         db.Entry(notDay).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(notDay));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "NhatKySo,NoiDung")] NotDay notDay)
        {
            if (ModelState.IsValid)
            {
                db.NotDays.Add(notDay);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(notDay));
        }
示例#4
0
        // GET: NotDays/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NotDay notDay = db.NotDays.Find(id);

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