// GET: /Work/Confirm/5 public RedirectResult Confirm(int id) { Pomodoro pomodoro = db.GetPomodoroById(User, id); if (pomodoro.Status == PomodoroStatus.Unconfirmed) { pomodoro.Status = PomodoroStatus.Completed; db.SaveChanges(); } return(Redirect(Request.GetReferrerUrlOrCurrent())); }
//// GET: /Pomodoro/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pomodoro pomodoro = db.GetPomodoroById(User, id.Value); if (pomodoro == null) { return(HttpNotFound()); } db.Pomodoros.Remove(pomodoro); db.SaveChanges(); return(Redirect(Request.GetReferrerUrlOrCurrent())); }