Ejemplo n.º 1
0
        /// <summary>
        /// 下拉列表绑定数据
        /// </summary>
        /// <param name="selectFID"></param>
        void AddViewBagF(int selectFID)
        {
            IEnumerable <SelectListItem> listitem =
                new[] { new SelectListItem {
                            Value = "0", Text = "顶级菜单", Selected = (selectFID == 0)
                        } }.Concat(
                _adminModuleService.GetAll().OrderBy(a => a.SortFlag).ToSelectListItems(0, selectFID));
            var test = _adminModuleService.GetAll().OrderBy(a => a.SortFlag).ToList();

            //指定下拉被选中
            ViewBag.FIDList = listitem;
        }
Ejemplo n.º 2
0
 public ActionResult Add()
 {
     //读取功能表数据
     ViewBag.Modules = _adminModuleService.GetAll().OrderBy(c => c.SortFlag).ToList();
     return(View());
 }