private void Submit_Click(object sender, RoutedEventArgs e) { //PatientManagement pm = new PatientManagement(); SecretaryController sc = new SecretaryController(); string firstName = textBoxFirstName.Text; string lastName = textBoxLastName.Text; string jmbg = textBoxJMBG.Text; string username = textBoxFirstName.Text + textBoxLastName.Text; string password = "******"; string date = BoxDateTime.Text; string[] entries = date.Split('/'); int year = Int32.Parse(entries[2]); int month = Int32.Parse(entries[0]); int day = Int32.Parse(entries[1]); DateTime myDate = new DateTime(year, month, day); int n = sc.GetAllPatients().Count; int idPatient; if (n > 0) { idPatient = Int32.Parse(sc.GetAllPatients()[n - 1].Id) + 1; } else { idPatient = 0; } TypeOfPerson typeOfPerson = (TypeOfPerson)Enum.Parse(typeof(TypeOfPerson), "Patient"); AccountType typeAccc = (AccountType)Enum.Parse(typeof(AccountType), "guestAccount"); List <Allergen> listAllergens = new List <Allergen>(); MedicalRecord mr = new MedicalRecord(idPatient.ToString(), typeAccc, 0, firstName, lastName, "empty", jmbg, myDate, "empty", "empty", "empty", 0); Patient p = new Patient(typeAccc, firstName, lastName, idPatient.ToString(), myDate, "Empty", "Empty", "Empty", typeOfPerson, username, password, jmbg, 0, mr, listAllergens); sc.CreatePatient(p); aPw.UpdateView(); Close(); }
public void UpdateView() { //PatientManagement pm = new PatientManagement(); SecretaryController sc = new SecretaryController(); List <Patient> patients = sc.GetAllPatients(); lvUsers.ItemsSource = sc.GetAllPatients(); //ICollectionView view = CollectionViewSource.GetDefaultView(patients); // view.Refresh(); }
public AllPatientsWindow() { InitializeComponent(); double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; double windowWidth = this.Width; double windowHeight = this.Height; this.Left = (screenWidth / 2) - (windowWidth / 2); this.Top = (screenHeight / 2) - (windowHeight / 2); _instance = this; SecretaryController sc = new SecretaryController(); lvUsers.ItemsSource = sc.GetAllPatients(); }
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 ButtonOk_Click(object sender, RoutedEventArgs e) { SecretaryController sc = new SecretaryController(); string idPatient = IdPatient.Text; List <Patient> patients = sc.GetAllPatients(); for (int i = 0; i < patients.Count; i++) { if (patients[i].Id == idPatient) { MedicalRecordWindow window = new MedicalRecordWindow(idPatient) { }; window.Show(); } } Close(); }
private void ButtonOk_Click(object sender, RoutedEventArgs e) { //FilesPatients sp = FilesPatients.GetInstance(); //PatientManagement pm = new PatientManagement(); SecretaryController sc = new SecretaryController(); string idPatient = IdPatient.Text; List <Patient> patients = sc.GetAllPatients(); for (int i = 0; i < patients.Count; i++) { if (patients[i].Id == idPatient) { EditRegisterPatientWindow window = new EditRegisterPatientWindow(idPatient) { }; window.Show(); } } Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { SecretaryController sc = new SecretaryController(); AllergensManagement am = new AllergensManagement(); PatientManagement pm = new PatientManagement(); Patient p; string cb = ComboBox1.Text; string specName = textBoxTypeAllergen.Text; List <Patient> patients = sc.GetAllPatients(); p = sc.getPatient(idP); string idAllergen = am.getID(cb); Allergen a = new Allergen(idAllergen, cb, specName); p.ListAllergens.Add(a); pm.updateAllergen(p); Close(); }
private void Submit_Click(object sender, RoutedEventArgs e) { //PatientManagement pm = new PatientManagement(); SecretaryController sc = new SecretaryController(); string firstName = textBoxFirstName.Text; string lastName = textBoxLastName.Text; string jmbg = textBoxJMBG.Text; string date = BoxDateTime.Text; string[] entries = date.Split('/'); int year = Int32.Parse(entries[2]); int month = Int32.Parse(entries[0]); int day = Int32.Parse(entries[1]); DateTime myDate = new DateTime(year, month, day); string placeOfResidance = textBoxPlaceOfResidance.Text; string email = textBoxEmail.Text; string phoneNumber = textBoxPhoneNumber.Text; string username = textBoxUsername.Text; string password = textBoxPassword.Text; SexType sex = SexType.male; if (Convert.ToBoolean(MSex.IsChecked)) { sex = SexType.male; } else if (Convert.ToBoolean(FSex.IsChecked)) { sex = SexType.female; } int n = sc.GetAllPatients().Count; int idPatient; if (n > 0) { idPatient = Int32.Parse(sc.GetAllPatients()[n - 1].Id) + 1; } else { idPatient = 0; } TypeOfPerson typeOfPerson = (TypeOfPerson)Enum.Parse(typeof(TypeOfPerson), "Patient"); List <Allergen> listAllergens = new List <Allergen>(); MedicalRecord mr = new MedicalRecord(idPatient.ToString(), 0, 0, firstName, lastName, "empty", jmbg, myDate, "empty", placeOfResidance, phoneNumber, sex); Patient p = new Patient(0, firstName, lastName, idPatient.ToString(), myDate, phoneNumber, email, placeOfResidance, typeOfPerson, username, password, jmbg, sex, mr, listAllergens); sc.CreatePatient(p); aPw.UpdateView(); Close(); }