public DetailViewModel GetDetailViewModel(Int32 projectVersionId, String tipYear) { var result = new DetailViewModel(); result.StringValues = new Dictionary<string, string>(); result.GeneralInfo = GetProjectGeneralInfo(projectVersionId); InfoViewModel InfoViewModel = GetProjectInfoViewModel(projectVersionId, tipYear); SegmentViewModel SegmentViewModel = GetSegmentViewModel(projectVersionId); // get project summary info result.ProjectSummary = GetProjectSummary(projectVersionId); result.InfoModel = InfoViewModel.InfoModel; result.ProjectSponsorsModel = InfoViewModel.ProjectSponsorsModel; //result.StringValues.Add("AdminLevel",GetValueByKey(AvailableAdminLevels, result.InfoModel.AdministrativeLevelId.Value)); //result.StringValues.Add("ProjectType", GetValueByKey(AvailableProjectTypes, result.InfoModel.ProjectTypeId.Value)); //result.StringValues.Add("ImprovementType", GetValueByKey(AvailableImprovementTypes, result.InfoModel.ImprovementTypeId.Value)); //result.StringValues.Add("RoadOrTransit", GetValueByKey(AvailableRoadOrTransitTypes, result.InfoModel.TransportationTypeId.Value)); //result.StringValues.Add("PoolName", GetValueByKey(AvailablePools(result.ProjectSummary), result.InfoModel.ProjectPoolId.Value)); result.Segments = GetProjectSegments(projectVersionId); result.PoolProjects = GetPoolProjects(projectVersionId); TIPSearchModel search = new TIPSearchModel() { ProjectId = (Int32)result.ProjectSummary.ProjectId , TipYearID = GetYearId(tipYear, Enums.TimePeriodType.TimePeriod) }; result.AmendmentList = GetProjectAmendments(search); result.MuniShares = GetProjectMunicipalityShares(projectVersionId); result.CountyShares = GetProjectCountyShares(projectVersionId); result.FundingDetailPivotModel = GetFundingDetailPivot(projectVersionId); result.TipProjectFunding = GetFunding(projectVersionId).FirstOrDefault(); return result; }
/// <summary> /// The Details tab for a project /// </summary> /// <param name="guid"></param> /// <param name="year"></param> /// <returns></returns> public ActionResult Details(int id, string year, string message) { var model = new DetailViewModel(); model = _projectRepository.GetDetailViewModel(id, year); ViewData["message"] = message; return View(model); }