public IActionResult UpdateGroup(Tright_Group model)
        {
            Tright_Group_Da da = new Tright_Group_Da();

            da.Update(model);
            return(SuccessMessage("成功!"));
        }
        public IActionResult AddGroup(Tright_Group model)
        {
            Tright_Group_Da da = new Tright_Group_Da();

            da.Insert(model);
            return(SuccessMessage("添加成功!"));
        }
        public IActionResult ListGroupByTree()
        {
            Tright_Group_Da da   = new Tright_Group_Da();
            var             list = da.ListByTree();

            return(SuccessResultList(list));
        }
        public IActionResult DelGroup(int id)
        {
            Tright_Group_Da da    = new Tright_Group_Da();
            int             count = da.Where(s => s.Id == id).AsTreeCte().ToDelete().ExecuteAffrows();

            if (count > 0)
            {
                return(SuccessMessage("已删除!"));
            }
            return(FailMessage());
        }
        public IActionResult ListPeople(int groupid, string keyword, int pageIndex, int pageSize)
        {
            PageModel page = new PageModel();

            page.PageIndex = pageIndex;
            page.PageSize  = pageSize;

            Tright_Group_Da da   = new Tright_Group_Da();
            var             list = da.ListPeopleByGroup(groupid, keyword, ref page);

            return(SuccessResult(list));
        }
        public IActionResult DelGroup(int id)
        {
            Tright_Group_Da da = new Tright_Group_Da();

            //TODO:此处要递归删除

            if (da.Delete(s => s.Id == id) > 0)
            {
                return(SuccessMessage("已删除!"));
            }
            return(FailMessage());
        }
        public IActionResult List(string keyword, int pageIndex, int pageSize)
        {
            PageModel page = new PageModel();

            page.PageIndex = pageIndex;
            page.PageSize  = pageSize;


            Tright_Group_Da da   = new Tright_Group_Da();
            var             list = da.ListByWhere(keyword, ref page);

            return(SuccessResultList(list, page));
        }
        public IActionResult ListGroupRole(int groupid)
        {
            Tright_Group_Da da = new Tright_Group_Da();

            return(SuccessResult(da.ListRoleByGroup(groupid)));
        }