private void bt_register_Click(object sender, RoutedEventArgs e) { if (tb_lastName.Text.Equals("") || tb_firstName.Text.Equals("") || tb_middleName.Text.Equals("") || tb_birthday.Text.Equals("") || tb_series.Text.Equals("") || tb_number.Text.Equals("") || tb_who.Text.Equals("") || tb_when.Text.Equals("") || tb_policyNumber.Text.Equals("") || tb_phone.Text.Equals("") || tb_policlinicName.Text.Equals("")) { MessageBox.Show("Не все поля заполнены", "Ошибка!", MessageBoxButton.OK, MessageBoxImage.Error); } else { string passport = tb_series.Text + tb_number.Text + tb_who.Text + tb_when.Text; if (dbconn.selectFromWhere("PasportInfo", "Patients", "PolicyNumber", tb_policyNumber.Text).Length <= 0) { dbconn.addAccountPatient(tb_lastName.Text, tb_firstName.Text, tb_middleName.Text, tb_birthday.Text, tb_policyNumber.Text, passport, tb_policlinicName.Text, tb_phone.Text); MessageBox.Show("Пользователь успешно зарегистрирован", "Уведомление!", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("Пользователь с таким Идентификатором уже существует", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); } } }
private void bt_entry_Click_(object sender, RoutedEventArgs e) { string[] confirmation = dbconn.selectFromWhere("Confirmation", "Doctors", "Identity", tb_login.Text); string[] pass = dbconn.selectFromWhere("Password", "Doctors", "Identity", tb_login.Text); if (confirmation.Length > 0 && pass.Length > 0) { if (confirmation[0].Equals("1") && pass[0].Equals(tb_pass.Text)) { wpf_menu menu = new wpf_menu(tb_login.Text); menu.Show(); this.Close(); } } else { MessageBox.Show("Неправильный логин или пароль", "Ошибка!", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void Cb_name_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { tb_cabinetNumber.Text = ""; tb_workingHouse.Text = ""; string[] shedule = dbconn.selectFromWhere("DayOfWork", "Schedule", "DoctorIdentity", doctorIdentity[cb_name.SelectedValue.ToString()]); for (int i = 0; i < shedule.Length; i++) { string day = ""; string month = ""; string year = ""; string not = ""; char[] date = shedule[i].ToCharArray(); foreach (char d in date) { if (d.Equals('.')) { not += d; } else if (day.Length < 2) { day += d; } else if (month.Length < 2) { month += d; } else if (year.Length < 4) { year += d; } } int y = Convert.ToInt32(year); int m = Convert.ToInt32(month); int da = Convert.ToInt32(day); cr_doctors.SelectedDates.Add(new DateTime(y, m, da)); } } catch { } }
private void Cb_policyNumber_SelectionChanged(object sender, SelectionChangedEventArgs e) { tb_admissionTime.Text = dbconn.choicetime(cb_policyNumber.SelectedItem.ToString(), identity, date); tb_name.Text = dbconn.takeName(cb_policyNumber.SelectedItem.ToString()); string[] birthdayDate = dbconn.selectFromWhere("BirthdayDate", "Patients", "PolicyNumber", cb_policyNumber.SelectedItem.ToString()); if (!(birthdayDate.Length < 0)) { tb_birthday.Text = birthdayDate[0]; } }