public DeleteCareTeamDataResponse DeleteCareTeam(DeleteCareTeamDataRequest request) { var response = new DeleteCareTeamDataResponse(); if (request == null) { throw new ArgumentNullException("request"); } if (string.IsNullOrEmpty(request.ContactId)) { throw new ArgumentNullException("Null or Empty ContactId", "request"); } if (string.IsNullOrEmpty(request.Id)) { throw new ArgumentNullException("Null or empty Care Team Id", "request"); } var repo = _factory.GetCareTeamRepository(request, RepositoryType.CareTeam); if (repo == null) { throw new Exception("Repository is null"); } try { if (!repo.CareTeamExist(request.Id)) { throw new Exception(string.Format("Care Team {0} does not exist", request.Id)); } repo.Delete(request); } catch (Exception) { throw; } return(response); }
public DeleteCareTeamDataResponse Delete(DeleteCareTeamDataRequest request) { var response = new DeleteCareTeamDataResponse(); try { if (string.IsNullOrEmpty(request.UserId)) { throw new UnauthorizedAccessException("ContactDD:CareTeamService:Delete Care Team::Unauthorized Access"); } Manager.DeleteCareTeam(request); } catch (Exception ex) { CommonFormat.FormatExceptionResponse(response, base.Response, ex); var aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0"; Helpers.LogException(int.Parse(aseProcessID), ex); } return(response); }