Example #1
0
        public void DeleteCareTeamMember(DeleteCareTeamMemberDataRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }

            if (string.IsNullOrEmpty(request.ContactId))
            {
                throw new ArgumentException("Empty ContactId", "request");
            }

            if (string.IsNullOrEmpty(request.CareTeamId))
            {
                throw new ArgumentException("Null or empty CareTeamId", "request");
            }

            if (string.IsNullOrEmpty(request.MemberId))
            {
                throw new ArgumentException("Null or empty MemberId", "request");
            }

            var repo = _factory.GetCareTeamRepository(request, RepositoryType.CareTeam);

            if (repo == null)
            {
                throw new Exception("Repository is null");
            }

            repo.DeleteCareTeamMember(request);
        }
Example #2
0
        public DeleteCareTeamMemberDataResponse Delete(DeleteCareTeamMemberDataRequest request)
        {
            var response = new DeleteCareTeamMemberDataResponse();

            try
            {
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("ContactDD:CareTeamService:Delete()::Unauthorized Access");
                }

                Manager.DeleteCareTeamMember(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);
        }