示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Effort effort = db.Efforts.Find(id);

            if (!EntityAuthorization.EffortDelete(effort))
            {
                return(HttpNotFound());
            }

            db.Efforts.Remove(effort);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
        // GET: Efforts/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Effort effort = db.Efforts.Find(id);

            if (effort == null)
            {
                return(HttpNotFound());
            }

            if (!EntityAuthorization.EffortDelete(effort))
            {
                return(HttpNotFound());
            }

            return(View(effort));
        }