private bool Validation() { if (string.IsNullOrWhiteSpace(TextBoxFirstName.Text)) { MessageBox.Show("Enter first name"); TextBoxFirstName.Focus(); return(false); } if (string.IsNullOrWhiteSpace(TextBoxLastName.Text)) { MessageBox.Show("Enter last name"); TextBoxLastName.Focus(); return(false); } if (string.IsNullOrWhiteSpace(DataPicker1.Text)) { MessageBox.Show("Enter date"); DataPicker1.Focus(); return(false); } return(true); }
/// <summary> /// Helper methods to display information in the Results textbox. /// </summary> private void ResultsClear() { TextBoxResults.Clear(); TextBoxLeadID.Clear(); TextBoxCapturedBy.Clear(); TextBoxCapturedDate.Clear(); TextBoxRegID.Clear(); TextBoxFirstName.Clear(); TextBoxLastName.Clear(); TextBoxTitle.Clear(); TextBoxCompany.Clear(); TextBoxCompany2.Clear(); TextBoxAddress.Clear(); TextBoxAddress2.Clear(); TextBoxAddress3.Clear(); TextBoxCity.Clear(); TextBoxStateCode.Clear(); TextBoxZipCode.Clear(); TextBoxCountryCode.Clear(); TextBoxEmail.Clear(); TextBoxPhone.Clear(); TextBoxPhoneExt.Clear(); TextBoxFax.Clear(); TextBoxNotes.Clear(); dgvDemographics.DataSource = null; }
private void ButtonRemove_Click(object sender, RoutedEventArgs e) { if (ListBox1.SelectedIndex < 0) { MessageBox.Show("Select employee"); return; } Employee e1 = ListBox1.SelectedItem as Employee; MessageBoxResult mbr = MessageBox.Show("Delete employee: " + e1.ToString(), "Delete", MessageBoxButton.YesNo); if (mbr == MessageBoxResult.No) { return; } int result = eDal.DeleteEmployee(e1); if (result == 0) { ShowEmployees(); TextBoxFirstName.Clear(); TextBoxLastName.Clear(); TextBoxDateOfBirth.Clear(); MessageBox.Show("Employee deleted"); } else { MessageBox.Show("Error"); } }
private void ClearFields() { TextBoxYear.Clear(); TextBoxMonth.Clear(); TextBoxDay.Clear(); TextBoxFirstName.Clear(); TextBoxSecondName.Clear(); TextBoxLastName.Clear(); TextBoxPasportNumber.Clear(); TextBoxPasportSeries.Clear(); }
private void ClearFields() { TextBoxYear.Clear(); TextBoxMonth.Clear(); TextBoxDay.Clear(); TextBoxFirstName.Clear(); TextBoxSecondName.Clear(); TextBoxLastName.Clear(); TextBoxLocation.Clear(); TextBoxPost.Clear(); }
public void ClearInputs() { TextBoxFirstName.Clear(); TextBoxLastName.Clear(); TextBoxAge.Clear(); TextBoxEmail.Clear(); TextBoxAddress.Clear(); TextBoxSSN.Clear(); ComboBoxGender.SelectedIndex = -1; }
internal void ClearControls() { TextBoxFirstName.Clear(); TextBoxLastName.Clear(); TextBoxCitizenID.Clear(); TextBoxContact.Clear(); DateTimeHireStaff.ResetText(); TextBoxAddress.Clear(); TextBoxCity.Clear(); TextBoxZipCode.Clear(); TextBoxEmail.Clear(); }
internal void clearAll() { TextBoxFirstName.Clear(); TextBoxLastName.Clear(); TextBoxIDNumber.Clear(); ComboBoxGender.ResetText(); TextBoxContactNumber.Clear(); TextBoxEmailAddress.Clear(); TextBoxAddressLine1.Clear(); TextBoxSuburb.Clear(); TextBoxCity.Clear(); TextBoxZipCode.Clear(); DateAdmission.ResetText(); ComboBoxCentre.ResetText(); }
private bool CheckAllFields() { ErrMsg errMsg; errMsg = Check.CheckField(FieldName.IsInsured, TextBoxInsured.Text); if (errMsg.ErrorId != "00") { SetOnErrMsg(errMsg); TextBoxInsured.Focus(); TextBoxInsured.ForeColor = Color.Red; return(false); } errMsg = Check.CheckField(FieldName.FirstName, TextBoxFirstName.Text); if (errMsg.ErrorId != "00") { SetOnErrMsg(errMsg); TextBoxFirstName.Focus(); TextBoxFirstName.ForeColor = Color.Red; return(false); } errMsg = Check.CheckField(FieldName.LastName, TextBoxLastName.Text); if (errMsg.ErrorId != "00") { SetOnErrMsg(errMsg); TextBoxLastName.Focus(); TextBoxLastName.ForeColor = Color.Red; return(false); } // Sterrenbeeld moet kloppen: errMsg = Check.CheckField(FieldName.Zodiac, TextBoxZodiac.Text); if (errMsg.ErrorId != "00") { SetOnErrMsg(errMsg); TextBoxZodiac.Focus(); TextBoxZodiac.ForeColor = Color.Red; return(false); } return(true); }
private void clearTextBox() { TextBoxFirstName.Clear(); TextBoxLastName.Clear(); TextBoxInitials.Clear(); TextBoxLoginUser.Clear(); TextBoxPasswordUser.Clear(); ChkBoxAdministrator.IsChecked = false; ChkBoxDismissed.IsChecked = false; ChkBoxPreClean.IsChecked = false; ChkBoxTesting.IsChecked = false; ChkBoxDebug.IsChecked = false; ChkBoxRepaire.IsChecked = false; ChkBoxFinalQC.IsChecked = false; ChkBoxReport.IsChecked = false; //ChkBoxOrder.IsChecked = false; btAddUser.Visibility = Visibility.Visible; btDeleteUser.Visibility = Visibility.Hidden; btUpdateUser.Visibility = Visibility.Hidden; }
private void ButtonRemove_Click(object sender, RoutedEventArgs e) { EmployeeServiceClient klijent = new EmployeeServiceClient(); if (ListBox1.SelectedIndex < 0) { MessageBox.Show("Select employee"); return; } EmployeeCon e2 = ListBox1.SelectedItem as EmployeeCon; MessageBoxResult mbr = MessageBox.Show("Delete employee: " + e2.ToString(), "Delete", MessageBoxButton.YesNo); if (mbr == MessageBoxResult.No) { return; } int result = klijent.DeleteEmployee(e2); klijent.Close(); if (result == 0) { ShowEmployees(); TextBoxFirstName.Clear(); TextBoxLastName.Clear(); TextBoxDateOfBirth.Clear(); MessageBox.Show("Employee deleted"); } else { MessageBox.Show("Error"); } }
private void TextBoxCutomerNo_Validated(object sender, EventArgs e) { if (TextBoxCutomerNo.Text.ToString().Trim().Length < 6 && TextBoxCutomerNo.Text.ToString().Trim().Length > 0) { TextBoxCutomerNo.Text = TextBoxCutomerNo.Text.Trim().PadLeft(6, '0'); } lsCustomerNo = TextBoxCutomerNo.Text.ToString().Trim(); if (lsCustomerNo == "") // Moses Newman 03/02/2012 previously only returned if in Add Mode!!! { return; } CUSTOMERTableAdapter.Fill(gsData.CUSTOMER, lsCustomerNo); if (gsData.CUSTOMER.Rows.Count > 0) { TextBoxFirstName.Text = gsData.CUSTOMER.Rows[0].Field <String>("CUSTOMER_FIRST_NAME"); TextBoxFirstName.Refresh(); TextBoxLastName.Text = gsData.CUSTOMER.Rows[0].Field <String>("CUSTOMER_LAST_NAME"); TextBoxLastName.Refresh(); textBoxSSNLast4.Text = gsData.CUSTOMER.Rows[0].Field <String>("CUSTOMER_SS_3"); textBoxSSNLast4.Refresh(); comboBoxSide.Text = "CLOSED"; comboBoxSide.Refresh(); nullableDateTimePickerArchivedDate.Value = DateTime.Now; nullableDateTimePickerArchivedDate.Refresh(); textBoxDealerNo.Text = gsData.CUSTOMER.Rows[0].Field <String>("CUSTOMER_DEALER"); textBoxDealerNo.Refresh(); DEALERTableAdapter.Fill(gsData.DEALER, gsData.CUSTOMER.Rows[0].Field <String>("CUSTOMER_DEALER")); if (gsData.DEALER.Rows.Count > 0) { textBoxDealerName.Text = gsData.DEALER.Rows[0].Field <String>("DEALER_NAME"); textBoxDealerName.Refresh(); } IsFound = true; } else { OPNCUSTTableAdapter.Fill(gsData.OPNCUST, lsCustomerNo); if (gsData.OPNCUST.Rows.Count > 0) { TextBoxFirstName.Text = gsData.OPNCUST.Rows[0].Field <String>("CUSTOMER_FIRST_NAME"); TextBoxFirstName.Refresh(); TextBoxLastName.Text = gsData.OPNCUST.Rows[0].Field <String>("CUSTOMER_LAST_NAME"); TextBoxLastName.Refresh(); textBoxSSNLast4.Text = gsData.OPNCUST.Rows[0].Field <String>("CUSTOMER_SS_3"); textBoxSSNLast4.Refresh(); comboBoxSide.Text = "OPEN"; comboBoxSide.Refresh(); nullableDateTimePickerArchivedDate.Value = DateTime.Now; nullableDateTimePickerArchivedDate.Refresh(); textBoxDealerNo.Text = gsData.OPNCUST.Rows[0].Field <String>("CUSTOMER_DEALER"); textBoxDealerNo.Refresh(); OPNDEALRTableAdapter.Fill(gsData.OPNDEALR, gsData.OPNCUST.Rows[0].Field <String>("CUSTOMER_DEALER")); if (gsData.OPNDEALR.Rows.Count > 0) { textBoxDealerName.Text = gsData.OPNDEALR.Rows[0].Field <String>("OPNDEALR_NAME"); textBoxDealerName.Refresh(); } IsFound = true; } } }