コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Aboutt aboutt = db.Aboutt.Find(id);

            db.Aboutt.Remove(aboutt);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "id,name,text")] Aboutt aboutt)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aboutt).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aboutt));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "id,name,text")] Aboutt aboutt)
        {
            if (ModelState.IsValid)
            {
                db.Aboutt.Add(aboutt);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aboutt));
        }
コード例 #4
0
        // GET: Admins/Aboutts/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Aboutt aboutt = db.Aboutt.Find(id);

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