public void ShowPatientWindow() { var patientWindowViewModel = new PatientWindowViewModel(); var patientWindow = new PatientWindow(); patientWindow.DataContext = patientWindowViewModel; patientWindow.ShowDialog(); }
private void ShowPatientView(object obj) { PatientViewModel patientViewModel = new PatientViewModel(); IView patientView = new PatientWindow(patientViewModel); patientViewModel.settoClose(patientView); patientView.Show(); viewtoClose.Close(); }
public PatientViewModel(Patient patient, PatientWindow patientWindow) { this.patient = patient; this.patientWindow = patientWindow; listDoc = service.GetAllDoctors(); RequestList = new ObservableCollection <vwRequest>(service.GetAllRequestByPatient(patient.PatientId)); DoctorList = new ObservableCollection <vwDoctor>(listDoc); CheckOpenRequest(RequestList); }
private void ShowView(object obj) { IView view; PatientViewModel vmodel = new PatientViewModel(); view = new PatientWindow(vmodel); vmodel.settoClose(view); view.Show(); viewToClose.Close(); }
private void dataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { DataGridCellInfo cellInfo = dataGrid.CurrentCell; DataGridColumn column = cellInfo.Column; int selectedColumn = column.DisplayIndex; Action selectedAction = (Action)dataGrid.SelectedItem; Operations ops = new Operations(); Console.WriteLine(selectedColumn); if (selectedColumn == 1) { int userId = selectedAction.ActUser; foreach (User u in ops.GetUsers()) { if (u.ID == userId) { UserWindow window = new UserWindow(u); window.Show(); } } } if (selectedColumn == 2) { int patientId = selectedAction.ActPatient; foreach (Patient p in ops.GetPatients()) { if (patientId == p.ID) { PatientWindow window = new PatientWindow(p); window.Show(); } } } if (selectedColumn == 3) { int carId = selectedAction.ActCar; foreach (Car c in ServiceClass.Cars) { if (c.ID == carId) { CarWindow window = new CarWindow(c); window.Show(); } } } }
private void ShowPatientView(object parameter) { IView view = null; PatientViewModel viewmodel = new PatientViewModel(); view = new PatientWindow(viewmodel); viewmodel.settoClose(view); view.Show(); viewtoClose.Close(); }
private void ShowView(object obj) { if (AdminRights) { AdminViewModel adminViewModel = new AdminViewModel(); IView adminView = new AdminWindow(adminViewModel); adminViewModel.settoClose(adminView); adminView.Show(); viewToClose.Close(); } if (PatientRights) { PatientViewModel patientViewModel = new PatientViewModel(); IView patientView = new PatientWindow(patientViewModel); patientViewModel.settoClose(patientView); patientView.Show(); viewToClose.Close(); } }
public void ShowView(object parameter) { if (AdminRights) { AdminViewModel adminViewModel = new AdminViewModel(); IView adminView = new AdminWindow(adminViewModel); adminViewModel.settoClose(adminView); adminView.Show(); toClose.Close(); } else if (DoctorRights) { DoctorViewModel doctorViewModel = new DoctorViewModel(); IView doctorView = new DoctorWindow(doctorViewModel); doctorViewModel.settoClose(doctorView); doctorView.Show(); toClose.Close(); } else if (PatientRights) { PatientViewModel patientViewModel = new PatientViewModel(); IView patientView = new PatientWindow(patientViewModel); patientViewModel.settoClose(patientView); patientView.Show(); toClose.Close(); } else { IView authenticationWindow = null; AuthenticationViewModel viewModel = new AuthenticationViewModel(new AuthenticationService()); authenticationWindow = new AuthenticationWindow(viewModel); viewModel.settoClose(authenticationWindow); authenticationWindow.Show(); toClose.Close(); } }
private void SaveExecute(object parametar) { var passwordBox = parametar as PasswordBox; var password = passwordBox.Password; Patient.PatientPassword = password; try { if (service.AddPatient(Patient) != null) { isUpdatePatient = true; PatientWindow window = new PatientWindow(Patient); window.Show(); addPatientWindow.Close(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void ShowView(object obj) { if (DoctorRights) { IView view; DoctorViewModel vmodel = new DoctorViewModel(); view = new DoctorWindow(vmodel); vmodel.settoClose(view); view.Show(); viewToClose.Close(); } else { IView view; PatientViewModel vmodel = new PatientViewModel(); view = new PatientWindow(vmodel); vmodel.settoClose(view); view.Show(); viewToClose.Close(); } }
private void LoginExecute(object parametar) { try { var passwordBox = parametar as PasswordBox; var password = passwordBox.Password; ServiceCode service = new ServiceCode(); Doctor doctor = service.LoginDoctor(Username, password); if (doctor == null) { Patient patient = service.LoginPatient(Username, password); if (patient == null) { MessageBox.Show("Uneti korisnik ne postoji!"); } else { PatientWindow patientWindow = new PatientWindow(patient); patientWindow.Show(); main.Close(); } } else { DoctorWindow window = new DoctorWindow(doctor); window.Show(); main.Close(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void FrontDeskID_Test() { SetupApp(); Window mainWindow = application.GetWindow("Login Window"); string Username = "******"; TextBox loginBox = mainWindow.Get <TextBox>(SearchCriteria.ByAutomationId("LoginBox")); loginBox.Text = Username; ComboBox cb_Roles = mainWindow.Get <ComboBox>(SearchCriteria.ByAutomationId("RoleCombobox")); cb_Roles.Select("Front Desk"); Button loginBtn = mainWindow.Get <Button>(SearchCriteria.ByText("OK")); loginBtn.Click(); mainWindow = application.GetWindow("FrontDeskView"); Label WelcomeText = mainWindow.Get <Label>(SearchCriteria.ByAutomationId("WelcomeText")); Assert.AreEqual(Username, WelcomeText.Text); Console.Write("Logged in with username " + Username); var Grid = mainWindow.Get <ListView>(SearchCriteria.ByAutomationId("PatientSchedulingGrid")); Window PatientWindow; int index = 3; foreach (var row in Grid.Rows) { var DetailsButton = mainWindow.Get <Button>(SearchCriteria.Indexed(index++)); DetailsButton.Click(); PatientWindow = application.GetWindow("PatientScheduling"); TextBox name = PatientWindow.Get <TextBox>(SearchCriteria.ByAutomationId("PatientName")); Assert.AreEqual(name.Text, row.Cells["PatientName"].Text); PatientWindow.Close(); } Tab tabControl = mainWindow.Get <Tab>(SearchCriteria.ByClassName("TabControl")); tabControl.SelectTabPage("Appointments"); CheckBox ShowUpsFilter = mainWindow.Get <CheckBox>(SearchCriteria.ByAutomationId("ShowUpsOnly")); ShowUpsFilter.Click(); Grid = mainWindow.Get <ListView>(SearchCriteria.ByAutomationId("AppointmentsGrid")); int testedRows = 0; while (Grid.Rows.Count >= 0 && testedRows < 7) { var OpenListButton = mainWindow.Get <Button>(SearchCriteria.Indexed(5)); OpenListButton.Click(); PatientWindow = application.GetWindow("AddToOpenList"); string Name = PatientWindow.Get <Label>(SearchCriteria.ByAutomationId("TextBoxPatientName")).Text; Assert.AreEqual(Name, Grid.Rows[0].Cells[1].Text); Button Add = PatientWindow.Get <Button>(SearchCriteria.ByText("Add")); Add.Click(); tabControl.SelectTabPage("Open List"); var OpenListGrid = mainWindow.Get <ListView>(SearchCriteria.ByAutomationId("OpenListGrid")); var NewRow = OpenListGrid.Rows[testedRows++]; Assert.AreEqual(Name, NewRow.Cells[1].Text); tabControl.SelectTabPage("Appointments"); } application.Close(); }
public DiseasForUserViewModel(PatientWindow patientWindow, int userid) { _userid = userid; _patientWindow = patientWindow; }