Exemplo n.º 1
0
        public ActionResult GetTreeSelectJson()
        {
            var data     = organizeService.GetList();
            var treeList = new List <TreeSelectModel>();

            foreach (OrganizeGridDto item in data)
            {
                TreeSelectModel treeModel = new TreeSelectModel();
                treeModel.id       = item.Id;
                treeModel.text     = item.FullName;
                treeModel.parentId = item.ParentId;
                treeModel.data     = item;
                treeList.Add(treeModel);
            }
            return(Content(treeList.TreeSelectJson()));
        }
        public async Task <ActionResult> GetTreeSelectJson()
        {
            var data = await organizeApp.GetList(this.TenantId);

            var treeList = new List <TreeSelectModel>();

            foreach (OrganizeEntity item in data)
            {
                TreeSelectModel treeModel = new TreeSelectModel();
                treeModel.id       = item.Id;
                treeModel.text     = item.FullName;
                treeModel.parentId = item.ParentId;
                treeModel.data     = item;
                treeList.Add(treeModel);
            }
            return(Content(treeList.TreeSelectJson()));
        }
Exemplo n.º 3
0
        public ActionResult Index(int pageIndex, int pageSize, string keyWord)
        {
            var pageData = OrganizeService.GetList(pageIndex, pageSize, keyWord);
            var result   = new LayPadding <Sys_Organize>()
            {
                Result = true,
                Msg    = "success",
                List   = pageData.Items,
                Count  = pageData.TotalItems
            };

            return(Content(result.ToJson()));
        }
Exemplo n.º 4
0
        public ActionResult GetListTreeSelect()
        {
            var data     = OrganizeService.GetList();
            var treeList = new List <TreeSelect>();

            foreach (Sys_Organize item in data)
            {
                TreeSelect model = new TreeSelect();
                model.id       = item.Id;
                model.text     = item.SOFullName;
                model.parentId = item.SOParentId;
                treeList.Add(model);
            }
            return(Content(treeList.ToTreeSelectJson()));
        }
Exemplo n.º 5
0
        private object GetOrganizeList()
        {
            var data = _organizeService.GetList();
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            foreach (OrganizeGridDto item in data)
            {
                var fieldItem = new
                {
                    encode   = item.EnCode,
                    fullname = item.FullName
                };
                dictionary.Add(item.Id.ToString(), fieldItem);
            }
            return(dictionary);
        }
Exemplo n.º 6
0
        private object GetOrganizeList()
        {
            OrganizeService             _organizeService = new OrganizeService();
            var                         data             = _organizeService.GetList();
            Dictionary <string, object> dictionary       = new Dictionary <string, object>();

            foreach (OrganizeBaseEntity item in data)
            {
                var fieldItem = new
                {
                    encode   = item.F_EnCode,
                    fullname = item.F_FullName
                };
                dictionary.Add(item.F_Id, fieldItem);
            }
            return(dictionary);
        }