protected void BindData(int advertisementID) { var list = advertisementBLL.GetAdvertisement(o => o.AdvertisementID == advertisementID); advertisement = list.First(); advertisement.Image = ConfigurationManager.AppSettings["UploadUrl"] + advertisement.Image; DetailsView1.DataSource = list; DetailsView1.DataBind(); CurrentMode_Init(); }
protected void BindData(Func <Advertisement, object> orderBy = null, string sort = "DESC") { Func <Advertisement, bool> delegation = o => true; Filter(ref orderBy, ref sort, ref delegation); int pageTotal; var list = advertisementBLL.GetAdvertisement(delegation, AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, out pageTotal, orderBy, sort); GridView1.DataSource = list; GridView1.DataBind(); AspNetPager1.RecordCount = pageTotal; }