void ClearRecords() { FirstNameTextbox.Clear(); LastNameTextbox.Clear(); AccountNumberTextbox.Clear(); BalanceTextbox.Clear(); }
void ClearFields() { FirstNameTextbox.Clear(); LastNameTextbox.Clear(); AccountNumberTextbox.Clear(); BalanceTextbox.Clear(); EmailTextbox.Clear(); PhoneNumberTextbox.Clear(); BalanceDateTextbox.Clear(); }
private void SubmitButton_Click(object sender, EventArgs e) { if (!String.Equals(PasswordTextbox.Text, ConfirmTextbox.Text)) { label13.Text = "Passwords Must Match"; label13.Visible = true; } else { string str = Properties.Settings.Default.DefaultConnection; SqlConnection con = new SqlConnection { ConnectionString = str }; con.Open(); SqlCommand cmd = new SqlCommand("Insert into Employee(SSN, FirstName, LastName, City, State, " + "ZipCode, Email, Password, Telephone, StartDate, HourlyRate, Type) " + "Values(@SSN, @FirstName, @LastName, @City, @State, @ZipCode, @Email, @Password, @Telephone, @AccountCreationDate, " + "@HourlyRate, @AccountType)", con); cmd.Parameters.AddWithValue("@SSN", SSNTextbox.Text); cmd.Parameters.AddWithValue("@FirstName", FirstNameTextbox.Text); cmd.Parameters.AddWithValue("@LastName", LastNameTextbox.Text); cmd.Parameters.AddWithValue("@City", CityTextbox.Text); cmd.Parameters.AddWithValue("@State", StateTextbox.Text); cmd.Parameters.AddWithValue("@ZipCode", ZipTextbox.Text); cmd.Parameters.AddWithValue("@Email", EmailTextbox.Text); cmd.Parameters.AddWithValue("@Password", PasswordTextbox.Text); cmd.Parameters.AddWithValue("@Telephone", TelephoneTextbox.Text); cmd.Parameters.AddWithValue("@AccountCreationDate", DateTime.Now.Date); cmd.Parameters.AddWithValue("@HourlyRate", HourlyWageTextBox.Text); cmd.Parameters.AddWithValue("@AccountType", comboBox1.Text); cmd.ExecuteNonQuery(); label13.Text = "Successfully Added " + FirstNameTextbox.Text + " " + LastNameTextbox.Text; label13.Visible = true; //Clear the textboxes SSNTextbox.Clear(); FirstNameTextbox.Clear(); FirstNameTextbox.Clear(); LastNameTextbox.Clear(); CityTextbox.Clear(); StateTextbox.Clear(); ZipTextbox.Clear(); EmailTextbox.Clear(); PasswordTextbox.Clear(); ConfirmTextbox.Clear(); TelephoneTextbox.Clear(); HourlyWageTextBox.Clear(); comboBox1.SelectedIndex = -1; } }
private void AddButton_Click(object sender, RoutedEventArgs e) { // Save record as it is. SaveRecord(); // Clear the inputs FirstNameTextbox.Clear(); LastNameTextbox.Clear(); AccountNumberTextbox.Clear(); BalanceTextbox.Clear(); // Update the state of IsNewRecord IsNewRecord = true; }
private void SetFirstName(string FirstName) { try { Console.WriteLine("Is First Name textbox displayed? {0}", FirstNameTextbox.Displayed); FirstNameTextbox.Clear(); FirstNameTextbox.SendKeys(FirstName); } catch (Exception e) { Logger.Error("Error: ", e); throw (e); } }
private void StoreBtn_Click(object sender, EventArgs e) { //verifies data was entered if (string.IsNullOrEmpty(FirstNameTextbox.Text)) { MessageBox.Show("Please enter your First Name."); return; } if (string.IsNullOrEmpty(LastNameTextbox.Text)) { MessageBox.Show("Please enter your Last Name."); return; } if (string.IsNullOrEmpty(AddressTextBox.Text)) { MessageBox.Show("Please enter your Address."); return; } if (string.IsNullOrEmpty(AddressTextBox.Text)) { MessageBox.Show("Please enter your City/State/Zipcode."); return; } if (string.IsNullOrEmpty(PhoneNumberTextbox.Text)) { MessageBox.Show("Please enter your Phone Number"); return; } //calls method to add data addData(FirstNameTextbox.Text, LastNameTextbox.Text, AddressTextBox.Text, CityStateZipcodeTextboc.Text, PhoneNumberTextbox.Text); //clears all items FirstNameTextbox.Clear(); LastNameTextbox.Clear(); AddressTextBox.Clear(); CityStateZipcodeTextboc.Clear(); PhoneNumberTextbox.Clear(); }