public ActionResult Delete(int id, FormCollection form) { var handler = new CompanyHandler(); var success = handler.Delete(id); if (success) { return(RedirectToAction("Index")); } else { return(HttpNotFound()); } }
public HttpResponseMessage Delete(int id) { var handler = new CompanyHandler(); try { var success = handler.Delete(id); if (success) { return(Request.CreateResponse(HttpStatusCode.OK)); } else { throw new HttpResponseException(HttpStatusCode.NotFound); } } catch (Exception e) { throw new HttpResponseException(HttpStatusCode.InternalServerError); } }