public void Login() { DoctorWindow doctorWindow = new DoctorWindow(_doctor); Application.Current.MainWindow = doctorWindow; doctorWindow.Show(); }
void ShowView(object items) { object[] parameters = items as object[]; var currentWind = parameters[0] as Window; if (ActiveUser.status == 1) { MainVM mv = new MainVM(); MainWindow mw = new MainWindow() { DataContext = mv }; currentWind.Close(); mw.Show(); } else if (ActiveUser.status == 2) { DoctorWindowVM dwmv = new DoctorWindowVM(ActiveUser); DoctorWindow dw = new DoctorWindow() { DataContext = dwmv }; currentWind.Close(); dw.Show(); } }
public DoctorEditAppointmentWindow(Appointment selected, DoctorWindow parent) { this.selected = selected; this.parent = parent; InitializeComponent(); InitializeComboBoxes(); }
public DrugsPage(DoctorWindow parent) { this.parent = parent; InitializeComponent(); UpdateList(); IngredientsList.Items.Clear(); }
public DrugsValidationViewModel(DoctorWindow parent) { this.parent = parent; ValidateCommand = new MyICommand(Validate_Click); ReturnCommand = new MyICommand(Return_Click); UpdateList(); }
public static ProfilePage GetPage(DoctorWindow parent) { if (instance == null) { instance = new ProfilePage(parent); } return(instance); }
public static AppointmentsViewModel GetPage(DoctorWindow parent) { if (instance == null) { instance = new AppointmentsViewModel(parent); } return(instance); }
public static TutorialPage GetPage(DoctorWindow parent) { if (instance == null) { instance = new TutorialPage(parent); } return(instance); }
public static DrugsPage GetPage(DoctorWindow parent) { if (instance == null) { instance = new DrugsPage(parent); } return(instance); }
private void ShowDoctorView(object obj) { IView view; DoctorViewModel vmodel = new DoctorViewModel(); view = new DoctorWindow(vmodel); vmodel.settoClose(view); view.Show(); viewToClose.Close(); }
public AppointmentsViewModel(DoctorWindow parent) { this.parent = parent; NewAppointmentCommand = new MyICommand(Add_Click); EditAppointmentCommand = new MyICommand(Edit_Click); DeleteAppointmentCommand = new MyICommand(Delete_Click); DoubleClickComand = new MyICommand(Double_Click); _statusOfAppointmentController.CheckMissedAppointments(); UpdateTable(); }
public ProfilePageViewModel(DoctorWindow parent) { this.parent = parent; Name = parent.Doctor.Name + " " + parent.Doctor.Surname; Title = _doctorController.GetType(parent.Doctor); Date = parent.Doctor.DateOfBirth.Date.ToString(); JMBG = parent.Doctor.JMBG; Address = parent.Doctor.ResidentialAddress.ToString(); Email = parent.Doctor.Email; }
public MedicalRecordWindow(Patient patient, DoctorWindow parent, Appointment selectedAppointment = null) { this.selected = patient; this.parent = parent; InitializeComponent(); FillMedicalRecord(selectedAppointment); WriteAllergies(selected); WriteHospitalisation(); BlackOutDates(); }
public TutorialPageViewModel(DoctorWindow parent) { this.parent = parent; StartStopCommand = new MyICommand(Start_Stop_Click); string projectPath = Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())); mediaElementObject.Source = new Uri(projectPath + "\\Images\\tutorial.mp4", UriKind.Absolute); mediaElementObject.LoadedBehavior = MediaState.Manual; mediaElementObject.Play(); buttonText = "Pauziraj"; }
private void ShowDoctorView(object parameter) { IView view; DoctorViewModel viewmodel = new DoctorViewModel(); view = new DoctorWindow(viewmodel); viewmodel.settoClose(view); view.Show(); viewtoClose.Close(); }
public DoctorWindowViewModel(Doctor doctor, DoctorWindow parent) { this.Doctor = doctor; this.parent = parent; parent.Title = doctor.Name + " " + doctor.Surname; parent.Main.Content = ProfilePage.GetPage(parent); PatientsCommand = new MyICommand(Patients_Click); AppointmentsCommand = new MyICommand(Appointments_Click); MedicineCommand = new MyICommand(Medicine_Click); TutorialCommand = new MyICommand(Tutorial_Click); ProfileCommand = new MyICommand(Profile_Click); LogoutCommand = new MyICommand(Logout_Click); FeedbackCommand = new MyICommand(Feedback_Click); }
private void Button_Click(object sender, RoutedEventArgs e) { if (Username.Text.Equals("sekretar") && Password.Password.Equals("123")) { AllPatientsWindow window = new AllPatientsWindow(); Close(); window.Show(); } else if (Username.Text.Equals("upravnik") && Password.Password.Equals("123")) { WindowsManager window = new WindowsManager(); Close(); window.Show(); } else if (Username.Text.Equals("lekar") && Password.Password.Equals("123")) { Windows.Doctor1.DoctorWindow window = new DoctorWindow(); Close(); window.Show(); } else { List <Patient> patients = sc.GetAllPatients(); string username; string password; enteredUsername = Username.Text; string enteredPassword = Password.Password; for (int i = 0; i < patients.Count; i++) { username = patients[i].Username; password = patients[i].Password; if (enteredUsername == username && enteredPassword == password) { WindowPatient window = new WindowPatient(); Close(); window.Show(); } } InvalidInfoLabel.Content = "* invalid username or password"; } }
private void SaveExecute(object parametar) { var passwordBox = parametar as PasswordBox; var password = passwordBox.Password; Doctor.DoctorPassword = password; try { if (service.AddDoctor(Doctor) != null) { //isUpdateDoctor = true; DoctorWindow window = new DoctorWindow(Doctor); window.Show(); addDoctor.Close(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
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 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 DoctorAddAppointmentWindow(DoctorWindow parent) { this.parent = parent; InitializeComponent(); InitializeComboBoxes(); }
public DoctorViewModel(Doctor doctor, DoctorWindow docWindow) { this.docWindow = docWindow; this.doctor = doctor; RequestList = new ObservableCollection <vwRequest>(service.GetAllRequestByDoctor(doctor.DoctorId)); }
public AppointmentsPage(DoctorWindow parent) { InitializeComponent(); this.DataContext = new AppointmentsViewModel(parent); _statusOfAppointmentController.CheckMissedAppointments(); }
public TutorialPage(DoctorWindow parent) { this.parent = parent; InitializeComponent(); this.DataContext = new TutorialPageViewModel(parent); }
public DoctorPatientsViewModel(DoctorWindow parent) { this.parent = parent; MedicalRecordCommand = new MyICommand(Medical_Record_Click); UpdateTable(); }
public DoctorPatientsPage(DoctorWindow parent) { this.parent = parent; InitializeComponent(); this.DataContext = new DoctorPatientsViewModel(parent); }
public DoctorFeedbackPage(DoctorWindow parent) { InitializeComponent(); this.DataContext = new FeedbackViewModel(parent.Doctor.Username); }
public DrugsValidationWindow(DoctorWindow parent) { InitializeComponent(); this.DataContext = new DrugsValidationViewModel(parent); }
// DataBase command. Auth static public void Auth(string table, string id, string password) { int count = 0; string position = ""; bool isAuth = false; //NpgsqlConnection connect = new NpgsqlConnection() { ConnectionString = DataBase.connect_params }; string query = string.Format(@"SELECT * FROM {0} WHERE id='{1}' AND password='******';", table, id, password); NpgsqlCommand command = new NpgsqlCommand(query, DataBase.connect); DataBase.connect.Open(); try { command.ExecuteNonQuery(); NpgsqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { count++; if (table != "client" && table == "employee") { position = reader["position"].ToString(); } } reader.Close(); if (count == 1) { MessageBox.Show("Вы успешно авторизировались"); isAuth = true; } else { MessageBox.Show("Неправильный ID или пароль"); isAuth = false; } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { DataBase.connect.Close(); } if (table == "client" && isAuth == true) { App.Current.MainWindow.Hide(); int x; x = Convert.ToInt32(id); ClientViewModel.Client_Id = x; ClientWindow clientWindow = new ClientWindow(); clientWindow.Show(); } else { if (table == "employee" && isAuth == true) { if (position.Contains("Инструктор")) { int x; x = Convert.ToInt32(id); InstructorViewModel.Employee_Id = x; InstructorWindow instWindow = new InstructorWindow(); instWindow.Show(); } if (position == "Врач") { int x; x = Convert.ToInt32(id); DoctorViewModel.Employee_Id = x; DoctorWindow doctorWindow = new DoctorWindow(); doctorWindow.Show(); } if (position == "Администратор") { int x; x = Convert.ToInt32(id); AdminViewModel.Employee_Id = x; AdminWindow admWindow = new AdminWindow(); admWindow.Show(); } App.Current.MainWindow.Hide(); } } }