private void FinishEmpBtn_Click(object sender, EventArgs e) { emp.name = FnameTextbox.Text + " " + LnameTextbox.Text; emp.password = PassTextbox.Text; emp.phone = PhoneNumTextbox.Text; emp.rank = RankTextBox.Text; emp.salary = Convert.ToInt16(SalaryTextbox.Text); emp.gender = gender; emp.address = AddressTextbox.Text; emp.admin_id = 1; emp.join_date = Convert.ToDateTime(JoinDatePicker.Text); // MessageBox.Show(emp.join_date.ToString()); emp.mail = EmailTextbox.Text; AdminClass newmanger = new AdminClass(); newmanger.addmanager(emp); FnameTextbox.Clear(); LnameTextbox.Clear(); PassTextbox.Clear(); PhoneNumTextbox.Clear(); SalaryTextbox.Clear(); MaleCheck.Checked = false; FemaleCheck.Checked = false; AddressTextbox.Clear(); EmailTextbox.Clear(); RankTextBox.Text = ""; MessageBox.Show("Employee Added Successfully"); }
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 SetUserEmail(string UserName) { try { Console.WriteLine("Is Email textbox displayed? {0}", EmailTextbox.Displayed); EmailTextbox.Clear(); EmailTextbox.SendKeys(UserName); } catch (Exception e) { Logger.Error("Error: ", e); throw (e); } }