Exemple #1
0
        /// <summary>
        /// 建立下一轮或补充评审
        /// </summary>
        /// <returns></returns>
        public async Task <IActionResult> ReviewRoundNext(int reviewID, string projectIds, string reviewType)
        {
            var matchInstance = await GetCurrentMatchInstance();

            ViewData["matchInstance"] = matchInstance;

            var review = await ReviewRepository.GetAllIncluding(o => o.ReviewRounds).Where(o => o.Id == reviewID).SingleAsync();

            ViewData["reviewType"] = reviewType;
            ViewData["projectIds"] = projectIds;

            return(View(review));
        }
        public async Task <IActionResult> SelProject(int reviewId)
        {
            var review = await ReviewRepository.GetAllIncluding(o => o.Major).Where(o => o.Id == reviewId).SingleAsync();

            List <Major> subMajors = new List <Major>();

            if (review.SubMajorId == null)
            {
                //如果未指定专业小类,需要列出所有专业小类供查询
                subMajors = await MajorManager.FindChildrenAsync(null, review.MatchInstanceId, review.MajorId);
            }
            else
            {
                ViewBag.SubMajor = await MajorManager.GetByIdAsync(review.SubMajorId.Value);
            }
            ViewBag.SubMajors = subMajors;
            ViewBag.Exclude   = Request.Cookies["excludeProjects"];
            return(View(review));
        }
        /// <summary>
        /// 评选活动选入专家
        /// </summary>
        /// <param name="reviewId"></param>
        /// <returns></returns>
        public async Task <IActionResult> SelExpert(int reviewId)
        {
            var review = await ReviewRepository.GetAllIncluding(o => o.Major).Where(o => o.Id == reviewId).SingleAsync();

            //List<Major> subMajors=new List<Major>();
            //if (review.SubMajorId == null)
            //{
            //    //如果未指定专业小类,需要列出所有专业小类供查询
            //    subMajors = await MajorManager.FindChildrenAsync(null, review.MatchInstanceId, review.MajorId);
            //}
            //else
            //{
            //    ViewBag.SubMajor = await MajorManager.GetByIdAsync(review.SubMajorId.Value);
            //}
            //ViewBag.SubMajors = subMajors;
            var specialities = await SpecialityManager.GetAll().OrderBy(o => o.Name).ToListAsync();

            ViewBag.Specialities = specialities;
            ViewBag.Exclude      = Request.Cookies["excludeExperts"];
            return(View(review));
        }
Exemple #4
0
        /// <summary>
        /// 评选活动详情
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task <IActionResult> ReviewEdit(int data)
        {
            var matchInstance = await GetCurrentMatchInstance();

            var review = await ReviewRepository.GetAllIncluding(o => o.ReviewRounds).SingleOrDefaultAsync(o => o.Id == data);

            //获取对应的专家
            var expertIds   = review.ReviewExperts.Select(o => o.Id);
            var expertUsers = await UserRepository.GetAll()
                              .Include(o => o.Organization)
                              .Include(o => o.Specialities)
                              .Where(o => expertIds.Contains(o.Id)).ToListAsync();

            //Logger.Error("Before ExpertTransform:" + DateTime.Now.ToLongTimeString());
            var specialities = await SpecialityRepository.GetAllListAsync();

            var reviewExpertDtos = expertUsers.Select(o => new ReviewExpertDto
            {
                Id   = o.Id,
                Name = o.Name,
                OrganizationDisplayName = o.Organization?.DisplayName,
                Specialities            = o.Specialities.Select(s => specialities.Single(sp => sp.Id == s.SpecialityId).Name).ToList()
            });

            //var reviewExpertDtos = await UserAppService.UserToReviewExpertDtos(expertUsers,matchInstance.MatchId);
            //Logger.Error("After ExpertTransform:" + DateTime.Now.ToLongTimeString());
            ViewBag.Experts = reviewExpertDtos;
            //获取对应的项目
            var reviewProjects = review.ReviewProjects.OrderBy(o => o.Sort).ToList();

            //Logger.Error("Before ProjectTransform:" + DateTime.Now.ToLongTimeString());
            Logger.Error("0:" + DateTime.Now.ToString("HH:mm:ss:fff"));
            ViewBag.Projects = await ProjectAppService.ProjectToReviewProjectDtos(reviewProjects);

            //Logger.Error("After ProjectTransform:" + DateTime.Now.ToLongTimeString());
            ViewData["MatchInstance"] = matchInstance;
            return(View(review));
        }
Exemple #5
0
        /// <summary>
        /// 评选总览页
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task <IActionResult> Summary(int data)
        {
            var review = await ReviewRepository.GetAllIncluding(o => o.ReviewRounds).Where(o => o.Id == data).SingleAsync();

            return(View(review));
        }