Example #1
0
 public LicensesViewModel(Window view, FlowDocumentScrollViewer licenseReaderForQuilt, FlowDocumentScrollViewer licenseReaderDirectShowNet)
 {
     _licenseReaderForQuilt      = licenseReaderForQuilt;
     _licenseReaderDirectShowNet = licenseReaderDirectShowNet;
     CloseViewCommand            = new CloseViewCommand(view);
     view.Loaded += ViewOnLoaded;
 }
Example #2
0
 private void DoImport()
 {
     Logger.Info("DoImport: Storing settings");
     UserSettings.UserSettings.Default.CsvPath = System.IO.Path.GetDirectoryName(FileName);
     Logger.Info("DoImport: Executing import");
     Importer.Execute();
     CloseViewCommand.Execute(null);
 }
Example #3
0
 private void DoOpenBackup(object param)
 {
     if (CanOpenBackup(null))
     {
         Logger.Info("DoOpenBackup");
         BackupFiles.LastSelected.OpenCommand.Execute(null);
         CloseViewCommand.Execute(null);
     }
 }
Example #4
0
 /// <summary>
 /// Clinicals the case changed event handler.
 /// </summary>
 /// <param name="obj">The <see cref="Rem.Ria.PatientModule.ClinicalCaseChangedEventArgs"/> instance containing the event data.</param>
 public void ClinicalCaseChangedEventHandler(ClinicalCaseChangedEventArgs obj)
 {
     Deployment.Current.InvokeIfNeeded(
         () =>
     {
         ClearVisitInfo();
         if (CloseViewCommand.CanExecute(null))
         {
             CloseViewCommand.Execute(null);
         }
     });
 }
Example #5
0
        private void HandleSaveRequestComplete(ReceivedResponses receivedResponses)
        {
            var response = receivedResponses.Get <DtoResponse <MedicationDto> > ();

            Medication = response.DataTransferObject;
            if (!Medication.HasErrors)
            {
                _eventAggregator.GetEvent <MedicationChangedEvent> ().Publish(
                    new MedicationChangedEventArgs {
                    Sender = this, MedicationKey = Medication.Key, PatientKey = Medication.PatientKey
                });
                CloseViewCommand.Execute(null);
            }
            IsLoading = false;
        }
Example #6
0
 private void CopyProperty(object param)
 {
     if (CanCopyProperty(null))
     {
         Logger.Info("CopyProperty: Copying property to clipboard, index = {0}",
                     PreferredPropertyIndex);
         Properties[PreferredPropertyIndex].Copy();
         CloseViewCommand.Execute(null);
     }
     else
     {
         Logger.Warn("CopyProperty: Cannot copy property");
         if (Properties != null)
         {
             Logger.Warn("CopyProperty: Properties.Count = {0}, PreferredPropertyIndex = {1}",
                         Properties.Count, PreferredPropertyIndex);
         }
         else
         {
             Logger.Warn("CopyProperty: Properties is null");
         }
     }
 }
Example #7
0
 private void DoShowDonatePage()
 {
     System.Diagnostics.Process.Start(Properties.Settings.Default.DonateUrl);
     CloseViewCommand.Execute(null);
 }
Example #8
0
 private void DoShowWhatsNew()
 {
     System.Diagnostics.Process.Start(Properties.Settings.Default.WhatsNewUrl);
     CloseViewCommand.Execute(null);
 }
 private void DoSaveShortcut()
 {
     _shortcut.KeySequence = _editedShortcut.KeySequence;
     _dirty = false;
     CloseViewCommand.Execute(null);
 }
Example #10
0
 public AboutViewModel(Window view)
 {
     CloseViewCommand    = new CloseViewCommand(view);
     ShowLicensesCommand = new ShowViewCommand <LicensesView>();
 }
Example #11
0
 private void OnSaveAndClose()
 {
     tasksRepository.Save(Task);
     CloseViewCommand.Execute();
 }
Example #12
0
 private void OnSaveAndClose()
 {
     employeesRepository.Save(employee);
     CloseViewCommand.Execute();
 }
Example #13
0
        /// <summary>
        /// Requests the completed.
        /// </summary>
        /// <param name="receivedResponses">The received responses.</param>
        protected override void RequestCompleted(ReceivedResponses receivedResponses)
        {
            IsLoading = false;

            base.RequestCompleted(receivedResponses);

            if (EditingDto.HasErrors)
            {
                var errors = EditingDto.GetErrors(null);

                var errorMessageSb = new StringBuilder();

                foreach (DataErrorInfo dataErrorInfo in errors)
                {
                    errorMessageSb.AppendLine(dataErrorInfo.ToString());
                }

                errors =
                    EditingDto.GetErrors(PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.PatientDocumentType));
                foreach (DataErrorInfo dataErrorInfo in errors)
                {
                    errorMessageSb.AppendLine(dataErrorInfo.ToString());
                }

                errors =
                    EditingDto.GetErrors(
                        PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.OtherDocumentTypeName));
                foreach (DataErrorInfo dataErrorInfo in errors)
                {
                    errorMessageSb.AppendLine(dataErrorInfo.ToString());
                }

                errors = EditingDto.GetErrors(PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.Description));
                foreach (DataErrorInfo dataErrorInfo in errors)
                {
                    errorMessageSb.AppendLine(dataErrorInfo.ToString());
                }

                errors =
                    EditingDto.GetErrors(PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.ClinicalStartDate));
                foreach (DataErrorInfo dataErrorInfo in errors)
                {
                    errorMessageSb.AppendLine(dataErrorInfo.ToString());
                }

                errors = EditingDto.GetErrors(
                    PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.ClinicalEndDate));
                foreach (DataErrorInfo dataErrorInfo in errors)
                {
                    errorMessageSb.AppendLine(dataErrorInfo.ToString());
                }

                errors =
                    EditingDto.GetErrors(
                        PropertyUtil.ExtractPropertyName <MailAttachmentPatientDocumentDto, object> (p => p.DocumentProviderName));
                foreach (DataErrorInfo dataErrorInfo in errors)
                {
                    errorMessageSb.AppendLine(dataErrorInfo.ToString());
                }

                var errorMessage = errorMessageSb.ToString();

                if (!string.IsNullOrWhiteSpace(errorMessage))
                {
                    _userDialogService.ShowDialog(errorMessage, "Save Mail Attachment to External Patient History", UserDialogServiceOptions.Ok);
                }
            }
            else
            {
                var patientDocumentUploadedEvent = new PatientDocumentUploadedEventArgs
                {
                    PatientKey = EditingDto.PatientKey
                };
                _eventAggregator.GetEvent <PatientDocumentUploadedEvent> ().Publish(patientDocumentUploadedEvent);

                _navigationService.Navigate(
                    WorkspacesRegion,
                    PatientWorkspaceView,
                    "SubViewPassThrough",
                    new[]
                {
                    new KeyValuePair <string, string> ("PatientKey", Patient.Key.ToString()),
                    new KeyValuePair <string, string> ("FullName", Patient.FullName),
                    new KeyValuePair <string, string> ("SubViewName", ExternalPatientHistoryView)
                });

                CloseViewCommand.Execute(null);
            }
        }