コード例 #1
0
        public JsonResult GetTypeTreeTop()
        {
            var mainTypeTree = CommonHelper.GetMainTypeTopTree();
            var easyuiTree   = EasyUIHelper.GetTreeJson(mainTypeTree);

            return(Json(easyuiTree, false));
        }
コード例 #2
0
        public JsonResult GetTree()
        {
            var    departList = UnitOfWork.Get <MF_Department>().ToDicList().ToList();
            string topId      = CommonStr.MainTypeTreeRootID;
            string topName    = ConfigurationManager.AppSettings["AppTitle"];

            foreach (var depart in departList)
            {
                if (string.IsNullOrEmpty(depart.GetValue("ParentId")))
                {
                    depart.SetValue("ParentId", topId);
                }
                depart.SetValue("Text", depart.GetValue("Name"));
            }
            var topDic = (new MF_Department()).ToDictionary();

            topDic.SetValue("Id", topId);
            topDic.SetValue("Text", topName);
            topDic.SetValue("ParentId", "");
            departList.Insert(0, topDic);
            return(Json(EasyUIHelper.GetTreeJson(departList), false));
        }
コード例 #3
0
        public JsonResult GetFuncTreeJson()
        {
            var res = UnitOfWork.Get <MF_Func>();

            return(Json(EasyUIHelper.GetTreeJson(res)));
        }