public ActionResult DeleteOrganisation(int organisationId) { if (_organisationService.OrganisationIdExists(organisationId)) { _organisationService.DeleteOrganisation(organisationId); } return RedirectToAction("Dashboard"); }
public ActionResult DeleteOrganisation(int id) { try { var organisation = _organisationService.GetOrganisationById(id); if (organisation == null) { return(NotFound()); } _organisationService.DeleteOrganisation(organisation); _organisationService.SaveChanges(); return(NoContent()); } catch (Exception e) { return(StatusCode(500, e.Message)); } }