Exemple #1
0
        public ActionResult GetAllMetadata(string id)
        {
            SysDepartmentBLL           m_BLL = new SysDepartmentBLL();
            IQueryable <SysDepartment> rows  = m_BLL.GetAllMetadata(id);

            if (rows.Any())
            {//是否可以省
                return(Json(new treegrid
                {
                    rows = rows.Select(s =>
                                       new
                    {
                        Id = s.Id
                        , Name = s.Name
                        , _parentId = s.ParentId
                        , state = s.SysDepartment1.Any(a => a.ParentId == s.Id) ? "closed" : null
                        , Address = s.Address
                        , Sort = s.Sort
                        , Remark = s.Remark
                        , CreateTime = s.CreateTime
                        , CreatePerson = s.CreatePerson
                        , UpdateTime = s.UpdateTime
                        , UpdatePerson = s.UpdatePerson
                    }
                                       ).OrderBy(o => o.Id)
                }));
            }
            return(Content("[]"));
        }
Exemple #2
0
        public ActionResult GetAllMetadata(string id)
        {
            SysDepartmentBLL        m_BLL      = new SysDepartmentBLL();
            List <SysDepartmentSef> collection = m_BLL.GetAllMetadata(id);

            if (collection != null && collection.Count > 0)
            {
                Metadata metadata = new Metadata();
                metadata.rows = collection;
                return(Json(metadata));
            }
            return(Json(""));
        }
        public ActionResult GetAllMetadata(string id)
        {
            SysDepartmentBLL m_BLL = new SysDepartmentBLL();
            IQueryable<SysDepartment> rows = m_BLL.GetAllMetadata(id);
            if (rows.Any())
            {//是否可以省
                return Json(new treegrid
                {
                    rows = rows.Select(s =>
                        new
                        {
                          Id = s.Id
                    ,Name = s.Name
                    ,_parentId =   s.ParentId
                    ,state = s.SysDepartment1.Any(a => a.ParentId == s.Id) ? "closed" : null
                    ,Address = s.Address
                    ,Sort = s.Sort
                    ,Remark = s.Remark
                    ,CreateTime = s.CreateTime
                    ,CreatePerson = s.CreatePerson
                    ,UpdateTime = s.UpdateTime
                    ,UpdatePerson = s.UpdatePerson

                        }
                        ).OrderBy(o => o.Id)
                });
            }
            return Content("[]");
        }