/// <summary> /// Use this method to get the countries list on searching any country in the search bar of the countries dropdown /// </summary> /// <returns></returns> public List <string> GetCountryText(string country = "") { CountryDropDown.Click(); webDriver.FindElement(By.XPath("//input[@ng-model='search.Name']")).SendKeys(country); IList <IWebElement> allCountriesList = webDriver.FindElements(By.XPath("//li[@class='ng-binding ng-scope']")); return(allCountriesList.Select(c => c.Text).ToList()); }
private void FillAddressInfoInternal(Data.ClientPurchaseInfo clientInfo) { CountryDropDown.SelectByText(clientInfo.ShippingInfo.Country); FullNameInput.SendKeys(clientInfo.ShippingInfo.FullName); Address1Input.SendKeys(clientInfo.ShippingInfo.Address1); CityInput.SendKeys(clientInfo.ShippingInfo.City); ZipInput.SendKeys(clientInfo.ShippingInfo.Zip); PhoneInput.SendKeys(clientInfo.ShippingInfo.Phone); ShipToThisAddress.Click(); }
private void BindCountryDropDown() { SupplierController controller = new SupplierController(); CountryDropDown.DataSource = controller.ListCountries(); CountryDropDown.DataTextField = nameof(Country.Name); CountryDropDown.DataValueField = nameof(Country.Name); CountryDropDown.DataBind(); CountryDropDown.Items.Insert(0, "[Select a country]"); }
private void BindCountryDropDown() { var countryRepository = IoC.Resolve <ICountryRepository>(); var country = countryRepository.GetAll(); CountryDropDown.DataSource = country; CountryDropDown.DataTextField = DDL_TEXT_NAME; CountryDropDown.DataValueField = DDL_VALUE_ID; CountryDropDown.DataBind(); CountryDropDown.Items.Insert(0, new ListItem("Select Country", "0")); }
private void BindCountryDropDown() { InventoryPurchasingController controller = new InventoryPurchasingController(); CountryDropDown.DataSource = controller.ListAllCountries(); CountryDropDown.DataTextField = "Country"; CountryDropDown.DataValueField = "Country"; CountryDropDown.DataBind(); CountryDropDown.Items.Insert(0, new ListItem("[Select a Country]", "-1")); CountryDropDown.Items.Insert(1, new ListItem("[no Country]", "")); }
public void FillShippingInfo(ClientInfo clientInfo) { SwitchToShippingFrame(); CountryDropDown.SelectByText(clientInfo.Country); FirstName.SendKeys(clientInfo.FirstName); LastName.SendKeys(clientInfo.LastName); Address1.SendKeys(clientInfo.Address1); City.SendKeys(clientInfo.City); Zip.SendKeys(clientInfo.Zip); Phone.SendKeys(clientInfo.Phone); Email.SendKeys(clientInfo.Email); Driver.SwitchTo().DefaultContent(); }
protected void Page_Load(object sender, EventArgs e) { try { if ((Session["role"].ToString() == "Teacher") || (Session["role"].ToString() == "Incharge")) { if (!IsPostBack) { buildBarChart("All", "All", DateTime.Parse("1-1-1753"), DateTime.Parse("1-1-9999")); buildPieChart("All"); buildHorizontalChart("All"); buildLineChart("All", "All"); Chart1.Series[0]["PieLabelStyle"] = "Outside"; Chart1.Legends.Add("Legend1"); Chart1.Legends[0].Enabled = true; Chart1.Series[0].LegendText = "#PERCENT{P1}"; TripDAO tripDao = new TripDAO(); List <String> countryList = tripDao.getCountry(); CountryDropDown.DataSource = countryList; CountryDropDown.DataBind(); CountryDropDown.Items.Insert(0, new ListItem("All", "All")); DropDownListCountryPieChart.DataSource = countryList; DropDownListCountryPieChart.DataBind(); DropDownListCountryPieChart.Items.Insert(0, new ListItem("All", "All")); } } else { Response.Redirect("./Oops.aspx"); } } catch (Exception) { Response.Redirect("./Oops.aspx"); } }
public List <CountryDropDown> CountryList() { List <CountryDropDown> countries = new List <CountryDropDown>(); SqlConnection connection = new SqlConnection(connectionString); string query = "SELECT * FROM Countries ORDER BY Name ASC"; connection.Open(); SqlCommand command = new SqlCommand(query, connection); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { CountryDropDown aCountryDropDown = new CountryDropDown(); aCountryDropDown.Id = Convert.ToInt32(reader["Id"].ToString()); aCountryDropDown.Name = reader["Name"].ToString(); aCountryDropDown.About = reader["About"].ToString(); countries.Add(aCountryDropDown); } reader.Close(); connection.Close(); return(countries); }
private void FillStates() { var stateRepository = IoC.Resolve <IStateRepository>(); var countryRepository = IoC.Resolve <ICountryRepository>(); var countries = countryRepository.GetAll(); CountryDropDown.DataTextField = "Name"; CountryDropDown.DataValueField = "Id"; CountryDropDown.DataSource = countries; CountryDropDown.DataBind(); CountryDropDown.Items.Insert(0, new ListItem("-- Select --", "0")); var states = stateRepository.GetAllStates(); var javascriptSerializer = new JavaScriptSerializer(); var serialized = javascriptSerializer.Serialize(states); //pcp State-Country pcpCountryDropDown.DataTextField = "Name"; pcpCountryDropDown.DataValueField = "Id"; pcpCountryDropDown.DataSource = countries; pcpCountryDropDown.DataBind(); pcpCountryDropDown.Items.Insert(0, new ListItem("-- Select --", "0")); pcpMailingcountryDropDown.DataTextField = "Name"; pcpMailingcountryDropDown.DataValueField = "Id"; pcpMailingcountryDropDown.DataSource = countries; pcpMailingcountryDropDown.DataBind(); pcpMailingcountryDropDown.Items.Insert(0, new ListItem("-- Select --", "0")); ClientScript.RegisterStartupScript(Page.GetType(), "js_Country_State", " var stateCountryList = " + serialized + ";", true); }
public void SelectCountry(string text) { CountryDropDown.SelectByText(text); }