private void addFromLast(_DropdownlistLinkedModel model, LinkedList<_DropdownlistLinkedNodeModel> linkedList, int projectId)
        {
            _DropdownlistLinkedNodeModel first = null;
            if (linkedList.Last == null)
            {
                first = new _DropdownlistLinkedNodeModel();
                linkedList.AddLast(first);
            }
            else
            {
                first = linkedList.First.Value;
            }

            first.CurrentProject = getProjectById(projectId);

            _DropdownlistLinkedNodeModel pre = getParent(projectId);
            if (pre != null)
            {
                linkedList.AddBefore(linkedList.First, pre);
                first.Projects = getFromParent(pre.CurrentProject.Id);

                addFromLast(model, linkedList, pre.CurrentProject.Id);
            }
            else
            {
                model.TailSelectedProject = getParentGroup(projectId);
                first.Projects = getFromGroup(model.TailSelectedProject.Id);
            }

        }
        public _DropdownlistLinkedModel GetDropdownlistLink(int userId, int projectId)
        {
            _DropdownlistLinkedModel model = new _DropdownlistLinkedModel();

            model.LinkedProject = new LinkedList<_DropdownlistLinkedNodeModel>();
            model.TailSelectedProject = getProjectById(projectId);
            addFromLast(model, model.LinkedProject, projectId);

            return model;
        }
        public _DropdownlistLinkedModel GetDropdownlistLink(int userId)
        {
            _DropdownlistLinkedModel model = new _DropdownlistLinkedModel();

            IList<Project> projects = session.Load<User>(userId).RootProjects;

            if (projects != null && projects.Count > 0)
            {
                model.LinkedProject = new LinkedList<_DropdownlistLinkedNodeModel>();
                model.LinkedProject.AddFirst(getFirstNode(projects));
                model.LinkedProject.FilledByHead(projects.First());
                model.TailSelectedProject = model.LinkedProject.Last.Value.CurrentProject;
            }

            return model;
        }
        public _DropdownlistLinkedModel GetDropdownlistLink(int userId, int projectId)
        {
            _DropdownlistLinkedModel model = new _DropdownlistLinkedModel();

            Project project = session.Load<Project>(projectId);
            IList<Project> projects = session.Load<User>(userId).RootProjects;

            model.LinkedProject = new LinkedList<_DropdownlistLinkedNodeModel>();

            model.LinkedProject.FilledByTail(project);

            IList<LiteItemModel> headProjects = new List<LiteItemModel>();
            headProjects.FilledBy(projects);
            model.LinkedProject.First.Value.Projects = headProjects;

            model.TailSelectedProject = model.LinkedProject.Last.Value.CurrentProject;
            model.SelectedProjectHasChild = !project.Children.IsNullOrEmpty();

            return model;
        }
        public _DropdownlistLinkedModel GetDropdownlistLink(int userId)
        {
            LiteItemModel zyfei = new LiteItemModel { Id = 1, Name = "自由飞" };
            LiteItemModel sgkj = new LiteItemModel { Id = 2, Name = "首顾科技" };
            LiteItemModel baichuan = new LiteItemModel { Id = 3, Name = "百川开源" };
            _DropdownlistLinkedModel model = new _DropdownlistLinkedModel
            {
                LinkedProject = new LinkedList<_DropdownlistLinkedNodeModel>()
            };

            LiteItemModel chuangye = new LiteItemModel { Id = 21, Name = "创业" };
            LiteItemModel task = new LiteItemModel { Id = 22, Name = "任务管理" };
            LiteItemModel zhuangshi = new LiteItemModel { Id = 23, Name = "装饰点评" };
            model.LinkedProject = new LinkedList<_DropdownlistLinkedNodeModel>();
            _DropdownlistLinkedNodeModel first = new _DropdownlistLinkedNodeModel
            {
                CurrentProject = task,
                Projects = new List<LiteItemModel> { chuangye, task, zhuangshi }
            };
            model.LinkedProject.AddFirst(first);

            LiteItemModel front = new LiteItemModel { Id = 31, Name = "前台" };
            LiteItemModel backend = new LiteItemModel { Id = 32, Name = "后台" };
            LiteItemModel ui = new LiteItemModel { Id = 33, Name = "UI" };
            LiteItemModel SEO = new LiteItemModel { Id = 34, Name = "SEO" };
            LiteItemModel design = new LiteItemModel { Id = 35, Name = "设计" };
            LiteItemModel DBA = new LiteItemModel { Id = 36, Name = "DBA" };
            LiteItemModel Admin = new LiteItemModel { Id = 37, Name = "行政" };
            _DropdownlistLinkedNodeModel second = new _DropdownlistLinkedNodeModel
            {
                CurrentProject = front,
                Projects = new List<LiteItemModel> { front, backend, ui }
            };
            model.LinkedProject.AddAfter(model.LinkedProject.Last, second);

            LiteItemModel csharp_4 = new LiteItemModel { Id = 41, Name = "C#" };
            LiteItemModel DBA_4 = new LiteItemModel { Id = 42, Name = "DBA" };
            _DropdownlistLinkedNodeModel third = new _DropdownlistLinkedNodeModel
            {
                CurrentProject = csharp_4,
                Projects = new List<LiteItemModel> { csharp_4, DBA_4 }
            };
            model.LinkedProject.AddAfter(model.LinkedProject.Last, third);

            model.TailSelectedProject = csharp_4;

            model.SelectedProjectHasChild = true;

            return model;
        }