public HttpResponseMessage DeleteFeature(int id) { bool status = logic.DeleteFeature(id); if (status) { return(Request.CreateResponse(HttpStatusCode.OK, "Deleted")); } else { return(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, logic.ErrorMessage)); } }
public ActionResult Delete(int id) { int solutionIdIndex = FeaturesLogic.GetFeatureById(id).SolutionId; try { FeaturesLogic.DeleteFeature(id); } catch (Exception e) { LogsLogic.InsertLog(new Log() { Message = e.Message, StackTrace = e.StackTrace, StoryName = "MoreHolidays/Features/Delete", Parameters = "id=" + id }); } return(RedirectToAction("Index", new { solutionId = solutionIdIndex })); }