예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HeadLineTwo headLineTwo = db.HeadLineTwos.Find(id);

            db.HeadLineTwos.Remove(headLineTwo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Message")] HeadLineTwo headLineTwo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(headLineTwo).State = EntityState.Modified;
         db.SaveChanges();
         this.AddToastMessage("Congratulations", "You have successfully edited second news!", ToastType.Success);
         return(RedirectToAction("Index", "Home"));
     }
     return(View(headLineTwo));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "Id,Message")] HeadLineTwo headLineTwo)
        {
            if (ModelState.IsValid)
            {
                db.HeadLineTwos.Add(headLineTwo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(headLineTwo));
        }
예제 #4
0
        // GET: HeadLineTwoes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HeadLineTwo headLineTwo = db.HeadLineTwos.Find(id);

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