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

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

            return(View(deathnoticepoems));
        }
コード例 #4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DeathNoticePoems deathnoticepoems = db.DeathNoticePoems.Find(id);

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