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(); }
private void ButtonOk_Click(object sender, RoutedEventArgs e) { //PatientManagement pm = new PatientManagement(); SecretaryController sc = new SecretaryController(); string id = IdPatient.Text; sc.DeletePatient(id); aPw.UpdateView(); Close(); }
private void Submit_Click(object sender, RoutedEventArgs e) { SecretaryController sc = new SecretaryController(); AccountType typeAcc = (AccountType)Enum.Parse(typeof(AccountType), ComboBox1.Text); p.medicalRecord.TypeAcc = typeAcc; MaritalStatus martialStatus = (MaritalStatus)Enum.Parse(typeof(MaritalStatus), ComboBoxMartialStatus.Text); p.medicalRecord.MartialStatus = martialStatus; p.medicalRecord.FirstName = textBoxFirstName.Text; p.medicalRecord.NameParent = textBoxNameParent.Text; p.medicalRecord.LastName = textBoxLastName.Text; p.medicalRecord.Jmbg = textBoxJMBG.Text; SexType sex; if (Convert.ToBoolean(MSex.IsChecked)) { sex = SexType.male; p.medicalRecord.SexType = sex; } else if (Convert.ToBoolean(FSex.IsChecked)) { sex = SexType.female; p.medicalRecord.SexType = sex; } 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); p.medicalRecord.DateOfBirth = myDate; p.medicalRecord.NumberOfHealthCard = textBoxHealthCard.Text; p.medicalRecord.PlaceOfResidance = textBoxPlaceOfResidance.Text; p.medicalRecord.PhoneNumber = textBoxPhoneNumber.Text; sc.UpdateMedicalRecord(p); aPw.UpdateView(); Close(); }
private void Submit_Click(object sender, RoutedEventArgs e) { //PatientManagement pm = new PatientManagement(); SecretaryController sc = new SecretaryController(); AccountType typeAcc = (AccountType)Enum.Parse(typeof(AccountType), ComboBox1.Text); p.TypeAcc = typeAcc; p.Name = textBoxFirstName.Text; p.LastName = textBoxLastName.Text; p.Jmbg = textBoxJMBG.Text; SexType sex; if (Convert.ToBoolean(MSex.IsChecked)) { sex = SexType.male; p.SexType = sex; } else if (Convert.ToBoolean(FSex.IsChecked)) { sex = SexType.female; p.SexType = sex; } 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); p.DateOfBirth = myDate; p.PlaceOfResidance = textBoxPlaceOfResidance.Text; p.Email = textBoxEmail.Text; p.PhoneNumber = textBoxPhoneNumber.Text; p.Username = textBoxUsername.Text; p.Password = textBoxPassword.Text; sc.Update(p); aPw.UpdateView(); 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(); }