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

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

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

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