private void DisplatPatientFromOrder() { Patient pat = new Patient(); servObj = new WebService(); if (SelectedOrder != null) { pat = servObj.LoadPatientDataByOrder(ConverterDataBase.orderModelToDataBase(SelectedOrder)); PatientFirstName = pat.FirstName; PatientSecondName = pat.SecondName; PatientMRN = pat.MRN; } else { PatientFirstName = null; PatientSecondName = null; PatientMRN = null; } }
private void InitCommand() { BackCmd = new RelayCommand(() => { PatientFirstName = PatientSecondName = PatientMRN = null; ViewModelLocator.SearchPatient = null; if (!navigationService.GoBackToMenu()) { navigationService.NavigateTo(ViewModelLocator.ChoiceKey); } else { navigationService.NavigateTo(ViewModelLocator.PatientKey); } }); AddOrderCmd = new RelayCommand(() => { ViewModelLocator.PatientMRNViewModel = PatientMRN; ViewModelLocator.TestModelList.Clear(); navigationService.NavigateTo(ViewModelLocator.AddOrderKey); }); OnLoad = new RelayCommand(() => { SearchOrder = ""; Orders.Clear(); if (ViewModelLocator.SearchPatient == null) { LoadOrders(); } else { LoadOrders(ViewModelLocator.SearchPatient.MRN); } LoadSearchPatient(); }); DelOrderCmd = new RelayCommand(() => { servObj.DeleteOrderData(ConverterDataBase.orderModelToDataBase(SelectedOrder)); SelectedOrder = null; if (ViewModelLocator.SearchPatient == null) { LoadOrders(); } else { LoadOrders(ViewModelLocator.SearchPatient.MRN); } }); AddTestCmd = new RelayCommand(() => { ViewModelLocator.OrderNumberViewModel = SelectedOrder.OrderNumber; navigationService.NavigateTo(ViewModelLocator.AddTestKey); }); DelTestCmd = new RelayCommand(() => { if (SelectedOrder.SelectedTest != null) { servObj.DeleteTestData(SelectedOrder.SelectedTest.TestId); MessageBox.Show("Succesfull", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Information); AllOrder = Orders; } }); }