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"); } }
/// <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 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 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"); } }