public ActionResult FigureStoreDelete(int?id) //+ { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } try { var fs = _figuresService.GetStoreById(id.Value); if (fs.Count > 0) { return(RedirectToAction("DataCouldNotBeDeleted", "Error", new { message = "Cannot remove storage. The storage " + fs.Name + " is not empty" })); } _figuresService.DeleteStore(id.Value); return(RedirectToAction("FigureStoreList")); } catch (DataNotFoundException ex) { return(RedirectToAction("DataNotFound", "Error", new { message = ex.Message })); } catch (Exception ex) { return(HttpNotFound(ex.Message)); } }