public WindowPatient()
        {
            InitializeComponent();
            instance = this;

            List <Examination> examinations = m.GetExaminations(mw.EnteredUsername);

            //List<Examination> examinations = m.Examinations;
            lvUsers.ItemsSource = examinations;
            Logic.PatientNotifications p = new Logic.PatientNotifications(mw.Username.Text);
        }
Пример #2
0
 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";
     }
 }