protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { CatergoriesID cat = new CatergoriesID(); categoryList = cat.GetAll(); DataListCategory.DataSource = categoryList; DataListCategory.DataBind(); if (Session["catid"] != null) { int Catid = Convert.ToInt32(Session["catid"]); Place pl = new Place(); placeList = pl.GetAllPlacesByCat(Catid); DataListPlaces.DataSource = placeList; DataListPlaces.DataBind(); } else { Place pl = new Place(); placeList = pl.GetAllPlaces(); DataListPlaces.DataSource = placeList; DataListPlaces.DataBind(); } } }
protected void LinkButtonAll_Click(object sender, EventArgs e) { Place pl = new Place(); plList = pl.GetAllPlaces(); DataListPlaces.DataSource = plList; DataListPlaces.DataBind(); }
protected void DataListCategory_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName == "select") { int CatId = Convert.ToInt32(e.CommandArgument); Place pl = new Place(); plList = pl.GetAllPlacesByCat(CatId); DataListPlaces.DataSource = plList; DataListPlaces.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { Place pl = new Place(); plList = pl.GetAllPlaces(); DataListPlaces.DataSource = plList; DataListPlaces.DataBind(); CatergoriesID cat = new CatergoriesID(); categoryList = cat.GetAll(); DataListCategory.DataSource = categoryList; DataListCategory.DataBind(); } }
protected void BtnSearch_Click(object sender, EventArgs e) { string substring = TextBoxSearch.Text; if (substring == "") { int Catid = Convert.ToInt32(Session["catid"]); Label13.Text = Catid.ToString(); Place pl = new Place(); placeList = pl.GetAllPlacesByCat(Catid); DataListPlaces.DataSource = placeList; DataListPlaces.DataBind(); } else { Place pl = new Place(); placeList = pl.GetBySearch(substring); DataListPlaces.DataSource = placeList; DataListPlaces.DataBind(); } }