Пример #1
0
        public ActionResult Create(string id)
        {
            if (!string.IsNullOrWhiteSpace(id))
            {
                using (SysDepartmentBLL bll = new SysDepartmentBLL())
                {
                    SysDepartment entityId = bll.GetById(id);
                    if (entityId != null)
                    {
                        SysDocument entity = new SysDocument();
                        entity.SysDepartmentId = id + '&' + entityId.Name;
                        return View(entity);
                    }
                }
            }

            return View();
        }
Пример #2
0
        /// <summary>
        /// 获取树形页面的数据
        /// </summary>
        /// <returns></returns>
        public ActionResult GetTree()
        {
            List<SystemTree> listSystemTree = new List<SystemTree>();

            IBLL.ISysDepartmentBLL db = new SysDepartmentBLL();

            SysDepartmentTreeNodeCollection tree = new SysDepartmentTreeNodeCollection();

            var trees = db.GetAll().OrderBy(o => o.Id);
            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);
        }
Пример #3
0
 public SysDepartmentController(SysDepartmentBLL bll)
 {
     m_BLL = bll;
 }
Пример #4
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("[]");
        }