// GET: ArticleCategory
        public ActionResult Index()
        {
            ArticleCategoryBll acBll = new ArticleCategoryBll();
            var cateGoryList         = acBll.GetAllCategory(0);

            return(View(cateGoryList));
        }
Esempio n. 2
0
        private SelectList GetAllCategoryForDLL(int selectValue = 0)
        {
            var acBll = new ArticleCategoryBll();
            //List<SelectListItem> ddlDPList = new List<SelectListItem>();

            SelectList ddlDPList;
            var        dpList = acBll.GetAllCategory(1);

            if (selectValue == 0)
            {
                ddlDPList = new SelectList(dpList, "category_id", "category_name");
            }
            else
            {
                ddlDPList = new SelectList(dpList, "category_id", "category_name", selectValue);
            }


            return(ddlDPList);
        }