Пример #1
0
    protected void StateBind()
    {
        List <WMGoodState> list = WMGoodState.GetList();

        StateList.DataSource = list;
        StateList.DataBind();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         List <string> state = new List <string>();
         state.Add("Select-State");
         state.Add("Andhra Pradesh");
         state.Add("Tamilnadu");
         state.Add("Telengana");
         state.Add("Karnataka");
         StateList.DataSource = state;
         StateList.DataBind();
     }
 }
Пример #3
0
    protected void CountryList_SelectedIndexChanged(object sender, System.EventArgs e)
    {
        foreach (DataRow datarow in CountriesSet.Tables["Countries"].Rows)
        {
            if (datarow.RowState != DataRowState.Deleted)
            {
                if ((int)datarow["ID"] == Convert.ToInt32(CountryList.SelectedValue))
                {
                    if (datarow["RegionID"] is int)
                    {
                        RegionList2.SelectedValue = ((int)datarow["RegionID"]).ToString();
                    }
                    CountryName.Text = (string)datarow["Country"];
                    if (datarow["titleoverride"] != null)
                    {
                        Country_Title_OverRide.Text = datarow["titleoverride"].ToString();
                    }
                    if (datarow["descriptionoverride"] != null)
                    {
                        Country_description_override.Text = datarow["descriptionoverride"].ToString();
                    }

                    break;
                }
            }
        }

        StateProvincesSet.Clear();
        try
        {
            if (Convert.ToInt32(CountryList.SelectedValue) != 0)
            {
                StateProvincesAdapter.SelectCommand.Parameters["@CountryID"].Value = Convert.ToInt32(CountryList.SelectedValue);
                //lock (CommonFunctions.Connection)
                StateProvincesAdapter.Fill(StateProvincesSet);
            }
        }
        catch (Exception)
        {
        }

        StateList.DataBind();
        StateList2.DataBind();
        StateList_SelectedIndexChanged(StateList, EventArgs.Empty);
    }