Exemplo n.º 1
0
        // back to doctor main window
        private void Cancel(object sender, RoutedEventArgs e)
        {
            DoctorLoginWindow doctorLogin = new DoctorLoginWindow();

            this.Close();
            doctorLogin.Show();
        }
Exemplo n.º 2
0
 // basic login function
 private void Login_action(object sender, RoutedEventArgs e)
 {
     if (login.Text.Length < 1)
     {
         MessageBox.Show("Podaj login!");
         return;
     }
     if (password.Text.Length < 1)
     {
         MessageBox.Show("Podaj hasło");
         return;
     }
     if (login.Text == "doc" && password.Text == "cod")
     {
         DoctorLoginWindow doctorLoginWindow = new DoctorLoginWindow();
         this.Close();
         doctorLoginWindow.Show();
     }
     else if (login.Text == "rejestracja" && password.Text == "haslo")
     {
         LoggedRegistrationWindow loggedRegistration = new LoggedRegistrationWindow();
         this.Close();
         loggedRegistration.Show();
     }
     else
     {
         MessageBox.Show("Podałeś błędne dane");
         return;
     }
 }
Exemplo n.º 3
0
        // function for adding new card to database
        private void Add_newCard(object sender, RoutedEventArgs e)
        {
            if (patient_id.Text.Length == 0)
            {
                MessageBox.Show("Wybierz pacjenta!");
                return;
            }
            if (docktor.SelectedIndex == -1)
            {
                MessageBox.Show("Wybierz lekarza prowadzącego!");
                return;
            }
            if (cure.SelectedIndex == -1)
            {
                MessageBox.Show("Wybierz lek!");
                return;
            }
            if (cure.SelectedIndex == -1)
            {
                MessageBox.Show("Wybierz chorobę!");
                return;
            }
            if (diagnosis.Text.Length < 50)
            {
                MessageBox.Show("Diagnoza nie może być krótsza niż 50 znaków!");
                return;
            }

            try
            {
                karta_pacjenta karta = new karta_pacjenta()
                {
                    id_pacjenta       = int.Parse(patient_id.Text),
                    wykonane_uslugi   = services.SelectedIndex + 1,
                    kod_choroby       = sick_code.Text.Split(' ')[0],
                    id_leku           = sick_code.SelectedIndex + 1,
                    lekarz_prowadzacy = docktor.SelectedIndex + 1,
                    diagnoza          = diagnosis.Text
                };
                db.karta_pacjenta.Add(karta);
                db.SaveChanges();
            } catch
            {
                MessageBox.Show("Ups! Coś poszlo nie tak!");
                return;
            }
            MessageBox.Show("Karta pacjenta została utworzona!");
            DoctorLoginWindow doctorLogin = new DoctorLoginWindow();

            this.Close();
            doctorLogin.Show();
        }