Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GridView1.DataSource = ID_People.GetIdOnlyList();
                GridView1.DataBind();

                regDD.DataSource     = Region.GetRegionList();
                regDD.DataValueField = "RegionID";
                regDD.DataTextField  = "RegionName";
                regDD.DataBind();

                ctryDD.DataSource     = Country.GetCountryList(regDD.SelectedValue);
                ctryDD.DataValueField = "CountryID";
                ctryDD.DataTextField  = "CountryName";
                ctryDD.DataBind();

                stateDD.DataSource     = State.GetStateList(ctryDD.SelectedValue);
                stateDD.DataValueField = "StateID";
                stateDD.DataTextField  = "StateName";
                stateDD.DataBind();

                cityDD.DataSource     = City.GetCityList(stateDD.SelectedValue, ctryDD.SelectedValue);
                cityDD.DataValueField = "CityID";
                cityDD.DataTextField  = "CityName";
                cityDD.DataBind();
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int       id  = Convert.ToInt32(Request.QueryString["PersonID"]);
            ID_People per = new ID_People();

            per.PersonID = id;
            People p = per.getPerson();

            IdCell.Text      = p.ID.ToString();
            NameCell.Text    = p.Name.ToString();
            PhoneCell.Text   = p.Phone.ToString();
            RegionCell.Text  = p.Region;
            CountryCell.Text = p.Country;
            StateCell.Text   = p.State;
            CityCell.Text    = p.City.ToString();
        }
Пример #3
0
        protected void delete_button_Click(object sender, EventArgs e)
        {
            List <int> list = new List <int>();

            foreach (GridViewRow r in GridView1.Rows)
            {
                CheckBox chkbx = (CheckBox)r.FindControl("chkProduct");
                if (chkbx.Checked)
                {
                    int id = Convert.ToInt32(r.Cells[1].Text);
                    list.Add(id);
                }
                People.DeletePeopleList(list);
                GridView1.DataSource = ID_People.GetIdOnlyList();
                GridView1.DataBind();
            }
        }
Пример #4
0
        protected void Clear_Click(object sender, EventArgs e)
        {
            Response.Redirect(Request.Url.PathAndQuery, true);
            regDD.SelectedIndex = 0;

            ctryDD.DataSource     = Country.GetCountryList("0");
            ctryDD.DataValueField = "CountryID";
            ctryDD.DataTextField  = "CountryName";
            ctryDD.DataBind();

            stateDD.DataSource     = State.GetStateList("0");
            stateDD.DataValueField = "StateID";
            stateDD.DataTextField  = "StateName";
            stateDD.DataBind();

            cityDD.DataSource     = City.GetCityList("0", "0");
            cityDD.DataValueField = "CityID";
            cityDD.DataTextField  = "CityName";
            cityDD.DataBind();

            GridView1.DataSource = ID_People.GetIdOnlyList();
            GridView1.DataBind();
        }
Пример #5
0
 protected void Filter_Click(object sender, EventArgs e)
 {
     GridView1.DataSource = ID_People.FilterIdOnlyList(Convert.ToString(regDD.SelectedItem), Convert.ToString(ctryDD.SelectedItem), Convert.ToString(stateDD.SelectedItem), Convert.ToString(cityDD.SelectedItem));
     GridView1.DataBind();
     //Response.Redirect(this.ToString());
 }