/// <summary>
        /// Navigates to default command.
        /// </summary>
        /// <param name="parameters">The parameters.</param>
        protected override void NavigateToDefaultCommand( KeyValuePair<string, string>[] parameters )
        {
            var patientKey = parameters.GetValue<long> ( "PatientKey" );

            if (SelfPayment != null)
            {
                _ruleExecutor.StopWatchingSubject ( this );
            }

            SelfPayment = new SelfPaymentDto ();
            SelfPayment.PatientKey = patientKey;
            SelfPayment.CollectedByStaffKey = _currentStaffKey;
            SelfPayment.CultureName = "en-US";
            SelfPayment.CurrencyWellKnownName = Currency.USDollars;

            _ruleExecutor.WatchSubject ( this );

            var requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher ();
            requestDispatcher.AddLookupValuesRequest ( "PaymentMethod" );
            requestDispatcher.ProcessRequests ( HandleInitializationCompleted, HandleInitializationError );
            IsLoading = true;
        }
        private void HandleSaveSelfPaymentRequestCompleted( ReceivedResponses receivedResponses )
        {
            var response = receivedResponses.Get<DtoResponse<SelfPaymentDto>> ();
            SelfPayment = response.DataTransferObject;

            IsLoading = false;

            if (!SelfPayment.HasErrors)
            {
                _popupService.ClosePopup ( "AddSelfPaymentView" );
            }
        }
        private void ExecuteDeleteSelfPaymentCommand( SelfPaymentDto dto)
        {
            var results = _userDialogService.ShowDialog (
                "Are you sure you would like to delete this payment?", "Delete", UserDialogServiceOptions.OkCancel );

            if (results == UserDialogServiceResult.Ok)
            {
                dto.EditStatus = EditStatus.Delete;

                var requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher ();
                requestDispatcher.Add ( new SaveDtoRequest<SelfPaymentDto> { DataTransferObject = dto } );
                requestDispatcher.ProcessRequests ( HandleDeleteSelfPaymentRequestCompleted, HandleDeleteSelfPaymentRequestError );
                IsLoading = true;
            }
        }