コード例 #1
0
        // GET: Admin/MainCategory
        public virtual ActionResult Index()
        {
            ViewBag.list = _mainCategory.GetAll();

            var list = _mainCategory.GetAll().Where(c => c.ParentId == null);

            return(View(list));
        }
コード例 #2
0
        public virtual ActionResult Create()
        {
            ViewBag.MainCategoryId = new SelectList(_mainCategory.GetAll().Where(c => c.MarkAsDelete != true), "MainCategoryId", "Name");

            ViewBag.UserId = new SelectList(_usersManager.GetAllUsers(), "Id", "UserName");
            return(View());
        }