// GET: Category
        public ActionResult Index(string searchValue = "")
        {
            var model = new Models.CategoryResult()
            {
                RowCount    = CatalogBLL.Category_Count(searchValue),
                Data        = CatalogBLL.Category_List(searchValue),
                SearchValue = searchValue
            };

            return(View(model));
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(string searchValue = "")
        {
            var model = new Models.CategoryResult
            {
                RowCount = CatalogBLL.Category_Count(searchValue),
                Data     = CatalogBLL.Category_List(searchValue),
            };

            //var listOfSuppliers = CatalogBLL.Supplier_List(page, 10, searchValue);
            //int rowCount = CatalogBLL.Supplier_Count(searchValue);
            //ViewBag.rc = rowCount;
            return(View(model));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Quản lý danh mục
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(string searchValue = "", int page = 1)
        {
            var model = new Models.CategoryPaginationResult()
            {
                Page        = page,
                PageSize    = AppSettings.DefaultPageSize,
                RowCount    = CatalogBLL.Category_Count(searchValue),
                Data        = CatalogBLL.Category_List(page, AppSettings.DefaultPageSize, searchValue),
                SearchValue = searchValue
            };

            return(View(model));
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static List <SelectListItem> ListOfCategories()
        {
            List <SelectListItem> listCategory = new List <SelectListItem>();

            foreach (var item in CatalogBLL.Category_List(""))
            {
                listCategory.Add(new SelectListItem()
                {
                    Value = Convert.ToString(item.CategoryID), Text = item.CategoryName
                });
            }
            return(listCategory);
        }
Ejemplo n.º 5
0
        // GET: Category
        /// <summary>
        /// Trang hiển thị danh sách các Category
        /// </summary>
        /// <param name="page"></param>
        /// <param name="searchValue"></param>
        /// <returns></returns>
        public ActionResult Index(int page = 1, string searchValue = "")
        {
            int pageSize = 999999;
            var model    = new Models.CategoryResult()
            {
                Page        = page,
                PageSize    = pageSize,
                RowCount    = CatalogBLL.Category_Count(searchValue),
                Data        = CatalogBLL.Category_List(page, pageSize, searchValue),
                searchValue = searchValue,
            };

            return(View(model));
        }
Ejemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static List <SelectListItem> ListOfCategories(bool allowSelectAll = true)
        {
            List <SelectListItem> listCategory = new List <SelectListItem>();

            if (allowSelectAll)
            {
                listCategory.Add(new SelectListItem()
                {
                    Value = "", Text = "--- All Category ---"
                });
            }
            foreach (var item in CatalogBLL.Category_List(""))
            {
                listCategory.Add(new SelectListItem()
                {
                    Value = Convert.ToString(item.CategoryID), Text = item.CategoryName
                });
            }
            return(listCategory);
        }
Ejemplo n.º 7
0
        public static List <SelectListItem> Categories(bool allowSelectAll = true)
        {
            List <SelectListItem> list = new List <SelectListItem>();

            if (allowSelectAll)
            {
                list.Add(new SelectListItem()
                {
                    Value = "0", Text = "All Category"
                });
            }
            foreach (var item in CatalogBLL.Category_List(1, CatalogBLL.Category_Count(""), ""))
            {
                list.Add(new SelectListItem()
                {
                    Value = item.CategoryID.ToString(),
                    Text  = item.CategoryName,
                });
            }
            return(list);
        }