public void deleteActiveDirectory(int id) { string resp = ""; try { connectModel(); systemConfigurationModel.deleteActiveDirectory(id); resp = "{\"type\":\"success\", \"message\":\"Active directory deleted Successfully.\"}"; } catch (Exception ex) { resp = "{\"type\":\"danger\", \"message\":\"" + ex.Message + "\"}"; // resp = "{\"type\":\"danger\", \"message\":\"Can not be deleted the active directory. Please try again.\"}"; } response(resp); }