Ejemplo n.º 1
0
        List <SelectListItem> GetProductsItems()
        {
            List <SelectListItem> ProposedReturnValue = new List <SelectListItem>();

            using (ContextBll ctx = new ContextBll())
            {
                List <OfferBLL> roles = ctx.GetOffer(0, 25);
                foreach (OfferBLL r in roles)
                {
                    SelectListItem i = new SelectListItem();

                    i.Value = r.ProductID.ToString();
                    i.Text  = r.ProductName;
                    ProposedReturnValue.Add(i);
                }
            }
            return(ProposedReturnValue);
        }
Ejemplo n.º 2
0
        public ActionResult Page(int PageNumber, int PageSize)
        {
            ViewBag.PageNumber = PageNumber;
            ViewBag.PageSize   = PageSize;
            List <OfferBLL> Model = new List <OfferBLL>();

            try
            {
                using (ContextBll ctx = new ContextBll())
                {
                    ViewBag.TotalCount = ctx.ObtainRoleCount();
                    Model = ctx.GetOffer(PageNumber * PageSize, PageSize);
                }
                return(View("Index", Model));
            }
            catch (Exception ex)
            {
                ViewBag.Exception = ex;
                return(View("Error"));
            }
        }