Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AboutSayings aboutSayings = db.AboutSayings.Find(id);

            db.AboutSayings.Remove(aboutSayings);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Position,Text")] AboutSayings aboutSayings)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aboutSayings).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aboutSayings));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "Id,Name,Position,Text")] AboutSayings aboutSayings)
        {
            if (ModelState.IsValid)
            {
                db.AboutSayings.Add(aboutSayings);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aboutSayings));
        }
Пример #4
0
        // GET: Admin/AboutSayings/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AboutSayings aboutSayings = db.AboutSayings.Find(id);

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