//очистка текстбоксов private void BtnClean_Click(object sender, EventArgs e) { TbPatientName.Clear(); TbPatientPatronymic.Clear(); TbFullPatientName.Clear(); TbPatientPhone.Clear(); TbPatientCode.Clear(); TbPatientAddress.Clear(); }
private void BtAddPatient_Click(object sender, RoutedEventArgs e) { if (TbPatientName.Text != "" && TbPatientSurname.Text != "") { if (Patient.PeselValidation(TbPatientPesel.Text)) { MessageBoxResult result = MessageBox.Show("Czy zapisać pacjenta " + TbPatientName.Text + " " + TbPatientSurname.Text + "?", "Zapis", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { Patient.AddPatient(TbPatientName.Text, TbPatientSurname.Text, TbPatientPesel.Text, TbPatientAdress.Text, TbPatientPhone.Text, dbcontext); patientDataGrid.Items.Refresh(); TbPatientName.Clear(); TbPatientAdress.Clear(); TbPatientPesel.Clear(); TbPatientPhone.Clear(); TbPatientSurname.Clear(); } } else { MessageBox.Show("Podaj poprawny numer PESEL!"); } } else { MessageBox.Show("Podaj imię i nazwisko!"); } }