public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here StockTask task = _workHistory.GetStockTask(id); _workHistory.DeleteStockTask(id); return(RedirectToAction("Index", new { id = task.WorkDayId })); } catch { return(View()); } }