Ejemplo n.º 1
0
        public ActionResult GetAllMetadata(string id)
        {
            SysFieldBLL           m_BLL = new SysFieldBLL();
            IQueryable <SysField> rows  = m_BLL.GetAllMetadata(id);

            if (rows.Any())
            {//是否可以省
                return(Json(new treegrid
                {
                    rows = rows.Select(s =>
                                       new
                    {
                        Id = s.Id
                        , MyTexts = s.MyTexts
                        , _parentId = s.ParentId
                        , state = s.SysField1.Any(a => a.ParentId == s.Id) ? "closed" : null
                        , MyTables = s.MyTables
                        , MyColums = s.MyColums
                        , Sort = s.Sort
                        , Remark = s.Remark
                        , CreateTime = s.CreateTime
                        , CreatePerson = s.CreatePerson
                        , UpdateTime = s.UpdateTime
                        , UpdatePerson = s.UpdatePerson
                    }
                                       ).OrderBy(o => o.Id)
                }));
            }
            return(Content("[]"));
        }
Ejemplo n.º 2
0
        public ActionResult GetAllMetadata(string id)
        {
            SysFieldBLL        m_BLL      = new SysFieldBLL();
            List <SysFieldSef> collection = m_BLL.GetAllMetadata(id);

            if (collection != null && collection.Count > 0)
            {
                Metadata metadata = new Metadata();
                metadata.rows = collection;
                return(Json(metadata));
            }
            return(Json(""));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取树形页面的数据
        /// </summary>
        /// <returns></returns>
        public ActionResult GetTree()
        {
            List <SystemTree> listSystemTree = new List <SystemTree>();
            string            parentId       = Request["parentid"];//父节点编号;

            using (SysFieldBLL db = new SysFieldBLL())
            {
                SysFieldTreeNodeCollection tree = new SysFieldTreeNodeCollection();
                var trees = db.GetAll().OrderBy(o => o.Sort);
                if (trees != null)
                {
                    tree.Bind(trees, parentId, ref listSystemTree);
                }
            }
            return(Json(listSystemTree, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取树形页面的数据
        /// </summary>
        /// <returns></returns>
        public ActionResult GetTree()
        {
            List <SystemTree> listSystemTree = new List <SystemTree>();

            IBLL.ISysFieldBLL db = new SysFieldBLL();

            SysFieldTreeNodeCollection tree = new SysFieldTreeNodeCollection();

            var trees = db.GetAll().OrderBy(o => o.Sort);

            if (trees != null)
            {
                string parentId = Request["parentid"];//父节点编号
                if (string.IsNullOrWhiteSpace(parentId))
                {
                    tree.Bind(trees, null, ref listSystemTree);
                }
                else
                {
                    tree.Bind(trees, parentId, ref listSystemTree);
                }
            }
            return(Json(listSystemTree, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
 public SysFieldController(SysFieldBLL bll)
 {
     m_BLL = bll;
 }