コード例 #1
0
        // GET: Project/Find
        public async Task <IActionResult> Find(FindProjectViewModel model)
        {
            if (model.SearchText == null)
            {
                return(View(new FindProjectViewModel
                {
                    OwnerId = (await _userManager.GetUserAsync(User))?.Id,
                    Projects = await DisplayProjectViewModel.GetViewModelsWhere(_context, p => p.Status != ProjectStatus.Hidden && p.Status != ProjectStatus.Deleted)
                }));
            }

            model.OwnerId  = (await _userManager.GetUserAsync(User))?.Id;
            model.Projects = await DisplayProjectViewModel.GetViewModelsWhere(_context, p => p.Status != ProjectStatus.Hidden && p.Status != ProjectStatus.Deleted &&
                                                                              (p.Name.Contains(model.SearchText) || p.Description.Contains(model.SearchText) || p.Goal.Contains(model.SearchText)));

            return(View(model));
        }
コード例 #2
0
        public async Task <IActionResult> FindProject(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var project     = new FindProjectViewModel();
            var findproject = await service.FindProject(id);

            project.Id              = findproject.Id;
            project.Title           = findproject.Title;
            project.WorkTime        = findproject.WorkTime;
            project.Description     = findproject.Description;
            project.CompanyId       = findproject.CompanyId;
            project.Workers         = findproject.Workers;
            project.IncomingTickets = findproject.IncomingTickets;

            return(View(project));
        }