protected internal void Select(Action Selected) { SelectedPatient selectedPatient = new SelectedPatient(Selected); GlobalVM.StockLayout.headerContent.Content = selectedPatient; selectedPatient.Load(PatientListM.SelectedRow.Id, PatientListM.SelectedRow.Name); }
private async void Start() { CreateBillM = new CreateBillM(); SelectedPatient = GlobalVM.StockLayout.headerContent.Content as SelectedPatient; CreateBillM.Code = await new Codes().Generate((int)GlobalVM.GlobalM.UserID, SelectedPatient.AskId()); Loading = new BackgroundWorker(); Loading.DoWork += new DoWorkEventHandler(LoadingModel); Loading.RunWorkerCompleted += new RunWorkerCompletedEventHandler(LoadingModelComplete); Loading.RunWorkerAsync(); }
private void EditPatient() { var window = new PatientWindow(); var dataContext = new PatientDataContext(SelectedPatient); window.DataContext = dataContext; if (window.ShowDialog() == true) { SelectedPatient.OnPropertyChanged(); } }
private void SaveExecute(object obj) { var model = SelectedPatient.ToModel(); var updateWasSuccessful = _patientDataService.UpdatePatient(model); if (updateWasSuccessful) { Messenger.Default.Send(new PatientUpdatedMessage()); } }
protected internal EvidencesVM(Action Loaded) { this.Loaded = Loaded; SelectedPatient = GlobalVM.StockLayout.headerContent.Content as SelectedPatient; EvidencesM = new EvidencesM(); EvidencesM.PatientId = (GlobalVM.StockLayout.headerContent.Content as SelectedPatient).SelectedPatientVM.SelectedPatientM.Id; Loading = new BackgroundWorker(); Loading.DoWork += new DoWorkEventHandler(LoadingModel); Loading.RunWorkerCompleted += new RunWorkerCompletedEventHandler(LoadingModelComplete); Loading.RunWorkerAsync(); }
protected internal BillsVM(Action Loaded) { this.Loaded = Loaded; if (GlobalVM.StockLayout.headerContent.Visibility != Visibility.Collapsed) { SelectedPatient = GlobalVM.StockLayout.headerContent.Content as SelectedPatient; } BillsM = new BillsM(); BillsM.PatientId = SelectedPatient != null ? SelectedPatient.SelectedPatientVM.SelectedPatientM.Id : 0; Start(); }
public void NewPatient() { try { string newPatientStudyFilePath; newPatientStudyFilePath = CreateNewPatientStudy(); if (string.IsNullOrWhiteSpace(newPatientStudyFilePath)) { return; } string newPatientStudyName = Path.GetFileNameWithoutExtension(newPatientStudyFilePath); string studyPath = Path.GetDirectoryName(newPatientStudyFilePath); string patientFilePath = Path.Combine(studyPath, newPatientStudyName + _patientFileNameExtension); DataModelPatient patientDM = new DataModelPatient(patientFilePath); patientDM.Id = getNextAvailablePatientId(); //DataModelSerialization.SaveToPath(patientDM, patientDM.PatientFilePath, Log); System.Windows.MessageBox.Show("Hier sollte gesaved werden"); ViewModelPatient patientVM = new ViewModelPatient(); //patientVM.InitializePlugin(patientDM.FriendlyName, new DataModelCatalogItem(patientDM), this); //patientVM.CommandLoad.Execute(null); patientVM.IsNewPatient = true; patientVM.DiscardNewPatient += patientVM_DiscardNewPatient; patientVM.CheckDuplicateId += patientVM_CheckDuplicateId; patientVM.NewPatientSaved += patientVM_NewPatientSaved; _patients.Insert(0, patientVM); SelectedPatient = _patients[0]; SelectedPatient.RefreshIsDuplicateId(); } catch (Exception ex) { //MSOTService.IMSOTLog.HandleError(DisplayName, "Exception creating new patient: " + ex.Message); System.Windows.MessageBox.Show("Exception creating new patient: " + ex.Message); } }