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

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

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

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