예제 #1
0
 public static void FilledBy(this IList<LiteItemModel> model, IList<Project> projects)
 {
     foreach (Project project in projects)
     {
         LiteItemModel projectitemmodel = new LiteItemModel();
         projectitemmodel.FilledBy(project);
         model.Add(projectitemmodel);
     }
 }
예제 #2
0
        public LinkedList<LiteItemModel> GetLinkedProject(int tailProjectId)
        {
            LinkedList<LiteItemModel> models = new LinkedList<LiteItemModel>();

            Project project = session.Load<Project>(tailProjectId);

            while (project != null)
            {
                LiteItemModel item = new LiteItemModel();
                item.FilledBy(project);
                models.AddFirst(item);

                project = project.Parent;
            }

            return models;
        }
예제 #3
0
 private _DropdownlistLinkedNodeModel getFirstNode(IList<Project> rootProjects)
 {
     _DropdownlistLinkedNodeModel firstNode = new _DropdownlistLinkedNodeModel();
     firstNode.Projects = new List<LiteItemModel>();
     foreach (Project project in rootProjects)
     {
         LiteItemModel projectItemModel = new LiteItemModel();
         projectItemModel.FilledBy(project);
         firstNode.Projects.Add(projectItemModel);
     }
     firstNode.CurrentProject = firstNode.Projects.First();
     return firstNode;
 }
예제 #4
0
        public _LiteralLinkedModel getProject(int tailId)
        {
            _LiteralLinkedModel model = new _LiteralLinkedModel
            {
                LinkedList = new LinkedList<LiteItemModel>()
            };

            LiteItemModel zyf = new LiteItemModel { Id = 1, Name = "自由飞" };
            LiteItemModel sgkj = new LiteItemModel { Id = 2, Name = "首顾科技" };
            LiteItemModel cyjy = new LiteItemModel { Id = 3, Name = "创业家园" };
            LiteItemModel ui = new LiteItemModel { Id = 4, Name = "美工" };
            LiteItemModel backed = new LiteItemModel { Id = 5, Name = "后台" };

            model.LinkedList.AddFirst(zyf);
            switch (tailId)
            {
                case 2: model.LinkedList.AddLast(sgkj); break;
                case 3: model.LinkedList.AddLast(cyjy); break;
                case 4: model.LinkedList.AddLast(sgkj); model.LinkedList.AddLast(ui); break;
                case 5: model.LinkedList.AddLast(sgkj); model.LinkedList.AddLast(backed); break;
                default: ; break;
            }
            model.TailedId = model.LinkedList.Last.Value.Id;

            return model;
        }
예제 #5
0
        public static void Filledby(this _LiteralLinkedModel model, Project tail)
        {
            model.LinkedList = new LinkedList<LiteItemModel>();
            model.TailedId = tail.Id;
            while (tail != null)
            {
                LiteItemModel item = new LiteItemModel();
                item.FilledBy(tail);
                model.LinkedList.AddFirst(item);

                tail = tail.Parent;
            }
        }
예제 #6
0
 private LiteItemModel getParentGroup(int projectId)
 {
     LiteItemModel model = null;
     switch (projectId)
     {
         case 2:
         case 3:
             model = new LiteItemModel { Id = 1, Name = "自由飞" };
             break;
         case 15:
             model = new LiteItemModel { Id = 2, Name = "首顾科技" };
             break;
     }
     return model;
 }
예제 #7
0
        public _SearchModel GetByPartialName(string projectName)
        {
            _SearchModel model = new _SearchModel();
            model.Projects = new List<_LiteralLinkedModel>();

            _LiteralLinkedModel nodeModel = new _LiteralLinkedModel();
            nodeModel.LinkedList = new LinkedList<LiteItemModel>();

            LiteItemModel nodemodel_1 = new LiteItemModel { Id = 1, Name = "首顾科技" };
            LiteItemModel nodemodel_2 = new LiteItemModel { Id = 2, Name = "创业家园" };
            LiteItemModel nodemodel_3 = new LiteItemModel { Id = 3, Name = "后台" };
            LiteItemModel nodemodel_4 = new LiteItemModel { Id = 4, Name = "DBA" };

            if ("DBA".Contains(projectName))
            {
                nodeModel.LinkedList.AddLast(nodemodel_1);
                nodeModel.LinkedList.AddLast(nodemodel_2);
                nodeModel.LinkedList.AddLast(nodemodel_3);
            }
            if ("DBA".Contains(projectName))
            {
                nodeModel.LinkedList.AddLast(nodemodel_1);
                nodeModel.LinkedList.AddLast(nodemodel_2);
                nodeModel.LinkedList.AddLast(nodemodel_3);
                nodeModel.LinkedList.AddLast(nodemodel_4);
            }
            model.Projects.Add(nodeModel);

            return model;
        }
예제 #8
0
        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;
        }
예제 #9
0
 private LiteItemModel getProjectById(int projectId)
 {
     LiteItemModel model = new LiteItemModel();
     switch (projectId)
     {
         case 2:
             model = new LiteItemModel { Id = 2, Name = "创业" };
             break;
         case 3:
             model = new LiteItemModel { Id = 3, Name = "任务管理" };
             break;
         case 5:
             model = new LiteItemModel { Id = 5, Name = "前台" };
             break;
         case 7:
             model = new LiteItemModel { Id = 7, Name = "后台" };
             break;
         case 9:
             model = new LiteItemModel { Id = 9, Name = "UI" };
             break;
         case 11:
             model = new LiteItemModel { Id = 11, Name = "SEO" };
             break;
         case 12:
             model = new LiteItemModel { Id = 12, Name = "设计" };
             break;
         case 14:
             model = new LiteItemModel { Id = 14, Name = "DBA" };
             break;
         case 15:
             model = new LiteItemModel { Id = 15, Name = "行政" };
             break;
     }
     return model;
 }