/// <summary> /// 项目申报页 /// </summary> /// <param name="prizeId"></param> /// <param name="projectId"></param> /// <returns></returns> public async Task <IActionResult> Post(int prizeId, int?subMajorId, int?projectId) { var matchInstance = await GetCurrentMatchInstance(); var prize = await PrizeManager.GetByIdAsync(prizeId); var matchResources = await MatchResourceRepository.GetAll().Where(o => o.MajorId == prize.MajorId && o.MatchInstanceId == matchInstance.Id && o.MatchResourceStatus == Matches.MatchResourceStatus.Publish).ToListAsync(); ViewData["matchResources"] = matchResources; ViewData["subMajorId"] = subMajorId == null?"":subMajorId.Value.ToString(); ViewData["matchRemarks"] = matchInstance.Remarks; ViewData["prizeRemarks"] = prize.Remarks; ViewBag.ProjectId = projectId; //第三级专业 List <string> ThirdLevelMajors = new List <string>(); if (subMajorId != null) { var childMajors = await MajorManager.FindChildrenAsync(null, matchInstance.Id, subMajorId); ThirdLevelMajors = childMajors.OrderBy(o => o.Sort).Select(o => o.BriefName).ToList(); } ViewData["ThirdLevelMajors"] = ThirdLevelMajors; //所有单位 var organizations = (await OrganizationManager.FindChildrenAsync(null, true)); ViewData["organizations"] = organizations; ViewData["matchInstance"] = matchInstance; return(View(prize)); }
/// <summary> /// 获取评选活动的打分表 /// </summary> /// <param name="reviewId"></param> /// <returns></returns> public virtual async Task <List <MatchResourceRateTable> > GetRateTable(Review review) { var matchResource = await MatchResourceRepository.GetAll().Where(o => o.MatchInstanceId == review.MatchInstanceId && o.MatchResourceStatus == MatchResourceStatus.Publish && o.MatchResourceType == MatchResourceType.RateTable && o.MajorId == review.MajorId && o.SubMajorId == review.SubMajorId).FirstOrDefaultAsync(); List <MatchResourceRateTable> result = null; if (matchResource != null) { result = new MatchResource <MatchResourceRateTable>(matchResource).Datas; } return(result); }