Exemplo n.º 1
0
 public List <Model.TblProduct> GetRecords(Model.FilterProductLogs filters)
 {
     try
     {
         using (var context = new Model.SolutionsOnlineSellingEntities())
         {
             return(context.TblProduct.ToPagedList(filters.PageNumber, filters.PageSize));;
         }
     }
     catch
     {
         return(new List <Model.TblProduct>());
     }
 }
Exemplo n.º 2
0
        private List <Model.TblProduct> GetProducts(FormCollection collection = null)
        {
            int PageNumber = 1;

            if (collection != null && collection["PageNumber"] != null)
            {
                int.TryParse(collection["PageNumber"].ToString(), out PageNumber);
            }

            var _Filter = new Model.FilterProductLogs();

            _Filter.PageNumber = PageNumber;
            _Filter.PageSize   = 2;
            var model = new BusinessLogic.ProductEntity().GetRecords(_Filter);

            @ViewBag.CurrentPageNumber = _Filter.PageNumber;
            @ViewBag.TotalRecords      = model.Count();
            @ViewBag.PageSize          = _Filter.PageSize;
            return(model);
        }