private void Clear() { TxtCustomerName.Clear(); TxtCustomerSurname.Clear(); TxtCustomerPhone.Clear(); TxtCustomerEmail.Clear(); TxtCustomerIdNumber.Clear(); }
// TextBox Reset private void Reset() { TxtCustomerName.Clear(); TxtCustomerPhone.Clear(); TxtCustomerSurname.Clear(); DtpBirthday.SelectedDate = null; BtnCreate.Visibility = Visibility.Visible; BtnUpdate.Visibility = Visibility.Hidden; BtnDelete.Visibility = Visibility.Hidden; FillCustomers(); }
// Checking the values that come from textbox private bool FormValidation() { bool hasError = false; bool success = int.TryParse(TxtCustomerPhone.Text, out _); if (string.IsNullOrEmpty(TxtCustomerName.Text) || string.IsNullOrEmpty(TxtCustomerPhone.Text) || string.IsNullOrEmpty(TxtCustomerSurname.Text) || DtpBirthday.SelectedDate == null) { MessageBox.Show("Zəhmət olmasa bütün xanaları doldurun"); hasError = true; } else if (!success) { MessageBox.Show("Nömrəni düzgün daxil edin"); TxtCustomerPhone.Select(0, TxtCustomerPhone.Text.Length); TxtCustomerPhone.Focus(); hasError = true; } return(hasError); }
private void Reset() { TxtCustomerName.Clear(); TxtCustomerPhone.Clear(); FillCustomer(); }