public ActionResult ProjectSearch(ProjectSearchViewModel projectSearchViewModel) { LoadSession(); //Save search options to session if (CurrentSessionApplicationState.ProjectSearchModel != null) CurrentSessionApplicationState.ProjectSearchModel = null; //if (Session["ProjectSearchModel"] != null) Session.Remove("ProjectSearchModel"); CurrentSessionApplicationState.ProjectSearchModel = projectSearchViewModel.ProjectSearchModel; //Session.Add("ProjectSearchModel", model.ProjectSearchModel); //Redirect to the project list. Determine RTP Year (text) for redirect from appSession return new RedirectToRouteResult( new RouteValueDictionary { { "controller", "RTP" }, { "action", "ProjectList" }, { "year", CurrentSessionApplicationState.CurrentRTP } }); }
public ProjectSearchViewModel GetProjectSearchViewModel(string year,string currentProgram) { var result = new ProjectSearchViewModel(); // get project search model. This is now done in the (RTP)Controller. //result.ProjectSearchModel = this.GetProjectSearchModel(); // fill form collections result.EligibleAgencies = GetCurrentTimePeriodSponsorAgencies(year, _appState).ToDictionary(x => (int)x.OrganizationId, x => x.OrganizationName); Dictionary<string,string> valueAddonValueSeparator = new Dictionary<string,string>(); valueAddonValueSeparator.Add("Status", " :: "); valueAddonValueSeparator.Add("cycle", " - "); result.AvailablePlanYears = GetLookupCollection("[RTP].[Lookup_GetPlanYears]", "Id", "Label", null,valueAddonValueSeparator); result.AvailableImprovementTypes = AvailableImprovementTypes(24); //result.AvailableImprovementTypes = GetLookupCollection("Lookup_GetImprovementTypes", "Id", "Label"); result.AvailableProjectTypes = GetLookupCollection("Lookup_GetProjectTypes", "Id", "Label"); result.AvailableNetworks = GetLookupCollection("[dbo].[Lookup_GetNetworks]", "Id", "Label"); IList<SqlParameter> paramList = new List<SqlParameter>(); paramList.Add(new SqlParameter("@StatusType", "RTP Amendment Status")); result.AvailableAmendmentStatuses = GetLookupCollection("Lookup_GetStatuses", "Id", "Label", paramList); result.AvailablePlanTypes = GetLookupCollection("[RTP].[Lookup_GetPlanTypes]", "CategoryID", "Category"); result.RtpSummary = GetSummary(year); return result; }
/// <summary> /// Get the ProjectSearch view. /// </summary> /// <param name="year"></param> /// <returns></returns> public ActionResult ProjectSearch(string year) { LoadSession(); var viewModel = new ProjectSearchViewModel(); viewModel = _rtpRepository.GetProjectSearchViewModel(year, StringEnum.GetStringValue(CurrentSessionApplicationState.CurrentProgram)); viewModel.ProjectSearchModel = this.GetProjectSearchModel(); viewModel.RtpSummary.RtpYear = year; // set page parameters for javascript var pp = CreatePageParameters(); pp.Add("RtpYear", viewModel.RtpSummary.RtpYear); SetPageParameters(pp); return View(viewModel); }