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

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

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

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