Example #1
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            var expense = repository.GetExpense(id);

            try
            {
                repository.Remove(expense);
                repository.Save();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View(expense));
            }
        }