public void ZipLookup(String zip, String city) { Zip.Clear(); Zip.SendKeys(zip); ZipLookupButton.Click(); Thread.Sleep(1000); Driver.WebDriver.SwitchTo().Frame(0); SelectElement CitySelectDropdown = new SelectElement(CitySelect); CitySelectDropdown.SelectByValue(city); CitySelectProceedButton.Click(); Driver.WebDriver.SwitchTo().ParentFrame(); }
/** * Clear button to remove entries from all text boxes * Also sets the date back to the default in the DateTimePicker * Repopulates the Proof of Purchase listbox with Yes/No values * * */ private void Clear_Click(object sender, EventArgs e) { FirstName.Clear(); Middleinitial.Clear(); Lastname.Clear(); AddLine1.Clear(); AddLine2.Clear(); City.Clear(); State.Clear(); Zip.Clear(); Email.Clear(); Phone.Clear(); date.Value = DateTime.Today; Proof.Items.Clear(); Proof.Items.Add("Yes"); Proof.Items.Add("No"); StartText.Clear(); EndText.Clear(); modifyFlag = false; //Reset flag if data is cleared and can no longer be used to add modified entry }
private void button2_Click(object sender, EventArgs e) { try { // Add the new Address to the database this.addressTableAdapter1.InsertAddress(StNum.Text, City.Text, State.Text, Zip.Text); UpdateData(); this.Validate(); this.personAddressBindingSource.EndEdit(); this.homelessPersonBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.myTownDBDataSet); StNum.Clear(); City.Clear(); State.Clear(); Zip.Clear(); } catch { MessageBox.Show("Invalid/Missing Data", "Add Address Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ClearForm() { // clear all fields firstName.Clear(); Minitial.Clear(); lastName.Clear(); Address1.Clear(); Address2.Clear(); City.Clear(); State.SelectedItem = null; Zip.Clear(); Gender.SelectedItem = null;; Phone.Clear(); Email.Clear(); Proof.SelectedItem = null; Date.Value = DateTime.Today; // clear errors FieldError.SetError(firstName, ""); FieldError.SetError(Minitial, ""); FieldError.SetError(lastName, ""); FieldError.SetError(Address1, ""); FieldError.SetError(Address2, ""); FieldError.SetError(City, ""); FieldError.SetError(State, ""); FieldError.SetError(Zip, ""); FieldError.SetError(Gender, ""); FieldError.SetError(Phone, ""); FieldError.SetError(Email, ""); FieldError.SetError(Proof, ""); FieldError.SetError(Date, ""); firstName.Select(); SetAddMode(); }