public ActionResult _SearchResult(_SearchModel model) { if (model.IdOrName) { model.Projects = _projectService.GetLinked(int.Parse(model.Input)).Projects; } else { model.Projects = _projectService.GetByPartialName(model.Input).Projects; } return PartialView(model); }
public _SearchModel GetByPartialName(string projectName) { _SearchModel model = new _SearchModel(); model.Projects = new List<_LiteralLinkedModel>(); ProjectQuery query = new ProjectQuery(session.Query<Project>()); IList<Project> queryProjects = query.GetByPartialName(projectName).ToList(); foreach (Project project in queryProjects) { _LiteralLinkedModel item = new _LiteralLinkedModel(); item.Filledby(project); model.Projects.Add(item); } return model; }
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; }
public _SearchModel GetLinked(int projectId) { _SearchModel model = new _SearchModel(); model.Projects = new List<_LiteralLinkedModel>(); Project loadProject = session.Get<Project>(projectId); if (loadProject != null) { _LiteralLinkedModel item = new _LiteralLinkedModel(); item.Filledby(loadProject); model.Projects.Add(item); } return model; }
public _SearchModel GetLinked(int projectId) { _SearchModel model = new _SearchModel(); model.Projects = new List<_LiteralLinkedModel>(); return model; }