コード例 #1
0
        private void HandleSavePayorCoverageCompleted(ReceivedResponses receivedResponses)
        {
            var response = receivedResponses.Get <DtoResponse <PayorCoverageCacheDto> >();

            if (response.DataTransferObject.HasErrors)
            {
                var errorMessageBuilder = new StringBuilder();
                foreach (var dataErrorInfo in response.DataTransferObject.DataErrorInfoCollection)
                {
                    errorMessageBuilder.Append(dataErrorInfo.Message + "\n");
                }
                _userDialogService.ShowDialog(errorMessageBuilder.ToString(), "Error Deleting Payor", UserDialogServiceOptions.Ok);
            }
            else
            {
                var payorToDelete = Primary.FirstOrDefault(pc => pc.Key == response.DataTransferObject.Key);
                if (payorToDelete != null)
                {
                    Primary.Remove(payorToDelete);
                }
                else if ((payorToDelete = Secondary.FirstOrDefault(pc => pc.Key == response.DataTransferObject.Key)) != null)
                {
                    Secondary.Remove(payorToDelete);
                }
                else if ((payorToDelete = Tertiary.FirstOrDefault(pc => pc.Key == response.DataTransferObject.Key)) != null)
                {
                    Tertiary.Remove(payorToDelete);
                }
                else if ((payorToDelete = PayorCoverageHistory.FirstOrDefault(pc => pc.Key == response.DataTransferObject.Key)) != null)
                {
                    PayorCoverageHistory.Remove(payorToDelete);
                }
            }
            IsLoading = false;
        }