예제 #1
0
        protected void Next_OnClick(object sender, EventArgs e)
        {
            int currentPage = int.Parse(Session["CurrentPage"].ToString());
            var hotels      = _discountRepository.GetAll().OrderBy(x => x.Status).Skip(currentPage * Constant.ItemPerPage).Take(Constant.ItemPerPage).ToList();

            if (hotels.Any())
            {
                Session["CurrentPage"]         = currentPage + 1;
                RptDiscountListings.DataSource = hotels;
                RptDiscountListings.DataBind();
            }
        }
예제 #2
0
        protected void Page_Init(object sender, EventArgs e)
        {
            Session["Active"] = "DiscountsPage";

            if (!IsPostBack)
            {
                Session["CurrentPage"] = 1;

                RptDiscountListings.DataSource = _discountRepository.GetAll().OrderBy(x => x.Status).Take(Constant.ItemPerPage);
                RptDiscountListings.DataBind();
            }
        }