コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult List(int categoryId = 0, int supplierId = 0, string searchValue = "", int page = 1)
        {
            int rowCount       = 0;
            int pageSize       = 10;
            var listOfProducts = ProductService.List(page, pageSize, categoryId, supplierId, searchValue, out rowCount);

            Models.ProductPaginationQueryResult model = new Models.ProductPaginationQueryResult()
            {
                Page        = page,
                PageSize    = pageSize,
                CategoryID  = categoryId,
                SupplierID  = supplierId,
                SearchValue = searchValue,
                RowCount    = rowCount,
                Data        = listOfProducts,
            };
            return(View(model));
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult List(int CategoryID = 0, int SupplierID = 0, string searchValue = "", int page = 1)
        {
            try
            {
                int rowCount       = 0;
                int pageSize       = 6;
                var listOfProducts = ProductService.List(page, pageSize, CategoryID, SupplierID, searchValue, out rowCount);
                var model          = new Models.ProductPaginationQueryResult()
                {
                    Page        = page,
                    PageSize    = pageSize,
                    SearchValue = searchValue,
                    RowCount    = rowCount,
                    Data        = listOfProducts
                };

                return(View(model));
            }
            catch (Exception e)
            {
                return(Content(e.Message));
            }
        }