资源简介

博客地址:http://www.cnblogs.com/xcong 项目运行: 1.修改web.config 数据库连接 2.修改Global.asax Application_start方法中。取消注释 //重新生成数据库 //Database.SetInitializer(new DropCreateDatabaseAlways()); 3.先运行项目,进行登录 4.运行根目录Documents文件夹下InsertData.sql插入基本数据 5.再注释Global.asax Application_start中生成策略代码。 6.OK.

资源截图

代码片段和文件信息

using Management.Dao;
using Management.Entity;
using Management.Tools;
using Management.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Management.BLL
{
    public class DepartmentService
    {
        DepartmentDao dao = null;
        public DepartmentService()
        {
            dao = new DepartmentDao();
        }
        #region 获取部门GridTree的json格式数据
        /// 
        /// 获取部门GridTree的json格式数据
        /// 

        /// 
        public string GetDepartmentGridTree()
        {
            int total = 0;
            IEnumerable departAllList = dao.GetAllDepartment();
            List listDepart = new List();
            //查找所有的一级部门
            var ParentDepart = departAllList.Where(con => con.ParentID.Value == 0);
            foreach (var parent in ParentDepart)
            {
                //实体转化 
                UITree parentItem = UITree.ToEntity(parent);
                //获取子级
                GetDepartmentChildren(ref parentItem (List)departAllList);
                listDepart.Add(parentItem);
            }
            //grid数据输出
            UIGrid grid = new UIGrid();
            grid.Rows = listDepart;
            grid.Total = total;
            return JSonhelper.ToJson(grid true);
        }

        /// 
        /// 获取部门的Tree格式
        /// 

        /// 获得树级请求数据
        /// 
        public IEnumerable GetDepartmentTree(UITreeRequest treeData)
        {
            StringBuilder sbJson = new StringBuilder();
            IEnumerable departAllList = dao.GetAllDepartment();
            List listDepart = new List();
            //查找所有的一级部门
            var ParentDepart = departAllList.Where(con => con.ParentID.Value == 0);

            foreach (var parent in ParentDepart)
            {
                //实体转化 
                UITree parentItem = UITree.ToEntity(parent);
                //获取子级
                GetDepartmentChildren(ref parentItem (List)departAllList);
                listDepart.Add(parentItem);
            }
            return listDepart;

        }
        #endregion
        /// 
        /// 获取父级部门下的子部门列表信息
        /// 

        /// 
        /// 
        /// 
        private void GetDepartmentChildren(ref UITree parent List allList)
        {
            foreach (Department depart in allList)
            {
                if (depart.ParentID == parent.id)
                {
                    //实体转化
                    UITree child = UITree.ToEntity(depart);
                    if (parent.children == null)
                        parent.children = new List();
             

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-04-15 16:57  PermissionManage\
     目录           0  2014-05-01 17:45  PermissionManage\$tf\
     目录           0  2014-04-30 23:35  PermissionManage\$tf\0\
     文件         338  2014-04-15 16:51  PermissionManage\$tf\0\0243e180-3783-4ec2-aabc-a046807bb5b0.gz
     文件        5954  2014-04-15 16:50  PermissionManage\$tf\0\0471ea30-b721-46ef-8964-63ad07bb0a60.gz
     文件         374  2014-04-15 16:52  PermissionManage\$tf\0\068d93a0-81f4-4393-b899-8a38118cc478.gz
     文件         750  2014-04-15 16:51  PermissionManage\$tf\0\0dc57dc0-03ed-457b-83cc-48d9102259d9.gz
     文件         725  2014-04-15 16:51  PermissionManage\$tf\0\0e1fda50-265e-4ca0-997e-203983b217bd.gz
     文件         787  2014-04-15 16:51  PermissionManage\$tf\0\0fb0da90-eed3-4141-96cc-2b76e366c8da.gz
     文件         729  2014-04-15 16:50  PermissionManage\$tf\0\0fb406d0-64f5-47fa-a1aa-3678d96c088e.gz
     文件        6128  2014-04-15 16:50  PermissionManage\$tf\0\122c4720-a371-4f18-a0a4-f19cd7c90f05.gz
     文件         830  2014-04-15 16:51  PermissionManage\$tf\0\16f584a0-ef41-49b5-9936-793e38895a80.gz
     文件          78  2014-04-15 16:52  PermissionManage\$tf\0\1888d3b0-7968-4352-af4a-6b484b3e7b24.gz
     文件         922  2014-04-15 16:51  PermissionManage\$tf\0\19e3e1a0-7dba-4b7e-acb0-ef4959c6d9bb.gz
     文件         532  2014-04-15 16:50  PermissionManage\$tf\0\1b217950-b69c-421c-8b81-187f225312bb.gz
     文件         321  2014-04-15 16:51  PermissionManage\$tf\0\1b894f10-159d-47cd-9289-ce12fad040d2.gz
     文件         507  2014-04-15 16:51  PermissionManage\$tf\0\1bab2530-36b8-4e79-85f2-4a7d8ade98de.gz
     文件         179  2014-04-15 16:50  PermissionManage\$tf\0\1f600f30-6d0b-4e11-8d87-9d12370403fd.gz
     文件         745  2014-04-15 16:52  PermissionManage\$tf\0\1fae9460-28c1-436c-b1db-e437eb4c5db4.gz
     文件         757  2014-04-15 16:51  PermissionManage\$tf\0\1fe67760-3e45-43bd-8c30-c8d8fb70be7f.gz
     文件         754  2014-04-15 16:51  PermissionManage\$tf\0\237ca100-2311-42b7-aa32-d001aa102a1a.gz
     文件         733  2014-04-15 16:52  PermissionManage\$tf\0\23925520-0444-4b26-a4fb-36cfe13e5e20.gz
     文件         754  2014-04-15 16:51  PermissionManage\$tf\0\240d5fa0-de49-47db-871f-2826f55fdc88.gz
     文件         682  2014-04-15 16:51  PermissionManage\$tf\0\24b42b00-d41d-464f-8471-16f8be128bdc.gz
     文件         706  2014-04-15 16:52  PermissionManage\$tf\0\26966d70-3b09-4c58-936d-d6f8d3661baa.gz
     文件         504  2014-04-15 16:52  PermissionManage\$tf\0\28360e10-4d05-407d-8681-4d10af1e47fe.gz
     文件         453  2014-04-15 16:53  PermissionManage\$tf\0\2a3ae050-dac9-4f1c-b799-63107494783a.gz
     文件         746  2014-04-15 16:52  PermissionManage\$tf\0\2b6db3a0-de53-4efc-8b46-307b004e7366.gz
     文件         684  2014-04-15 16:51  PermissionManage\$tf\0\2e411420-3069-495f-8771-b842142eba16.gz
     文件        2669  2014-04-15 16:52  PermissionManage\$tf\0\307286e0-0728-40a0-ac62-4298a975c519.gz
     文件         367  2014-04-15 16:52  PermissionManage\$tf\0\320dd160-f647-4eac-9048-fae11a595a40.gz
............此处省略4792个文件信息

评论

共有 条评论