public void Put(InfoViewModel viewModel)
        {
            // copy this one since it is not on the form
            viewModel.InfoModel.SponsorId = viewModel.ProjectSponsorsModel.PrimarySponsor.OrganizationId;

            //Send update to repo
            try
            {
                RtpProjectRepository.UpdateProjectInfo(viewModel.InfoModel);
            }
            catch (Exception ex)
            {
                Logger.WarnException("Could not update RTP Project Info", ex);
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.ExpectationFailed) { ReasonPhrase = ex.Message });
            }
        }
 /// <summary>
 /// Gets a view model that can be used in the CreateProject view.
 /// Just contains the pick lists needed.
 /// </summary>
 /// <returns></returns>
 public InfoViewModel GetCreateProjectViewModel()
 {
     var result = new InfoViewModel();
     // fill collections
     result.AvailableAdminLevels = GetLookupCollection("Lookup_GetProjectAdministrativeLevels", "Id", "Label");
     result.AvailableSponsors = GetLookupCollection("Lookup_GetSponsorOrganizations", "Id", "Label");
     result.AvailableImprovementTypes = AvailableImprovementTypes(24);
     result.AvailableRoadOrTransitTypes = GetLookupCollection("Lookup_GetRoadOrTransitCategories", "Id", "Label");
     result.AvailableProjectTypes = GetLookupCollection("Lookup_GetProjectTypes", "Id", "Label");
     result.AvailableSelectionAgencies = GetLookupCollection("Lookup_GetSelectors", "Id", "Label");
     return result;
 }
        /// <summary>
        /// Get the select lists and the data to edit the "General Info" about a project
        /// </summary>
        /// <param name="versionId"></param>
        /// <param name="tipYear"></param>
        /// <returns></returns>
        public InfoViewModel GetProjectInfoViewModel(int versionId, string rtpYear)
        {
            var result = new InfoViewModel();

            // get project summary info
            result.InfoModel = GetProjectInfo(versionId, rtpYear);
            result.ProjectSummary = GetProjectSummary(versionId, rtpYear);
            result.ProjectSponsorsModel = GetProjectSponsorsModel(versionId, rtpYear);
            if (result.InfoModel.SponsorId.HasValue && result.InfoModel.SponsorContactId.HasValue)
            {
                result.ProjectSponsorsModel.SponsorContact = GetSponsorContact(result.InfoModel.SponsorId.Value, result.InfoModel.SponsorContactId.Value);
            }

            // fill collections
            result.AvailableAdminLevels = AvailableAdminLevels;// GetLookupCollection("Lookup_GetProjectAdministrativeLevels", "Id", "Label");
            //result.AvailableSponsors = AvailableSponsors;// GetLookupCollection("Lookup_GetSponsorOrganizations", "Id", "Label");
            //result.AvailableSponsors = GetAvailableSponsorAgencies(rtpYear, _appState).ToDictionary(x => (int)x.OrganizationId, x => x.OrganizationName);
            result.AvailableImprovementTypes = AvailableImprovementTypes(24);// GetLookupCollection("Lookup_GetImprovementTypes", "Id", "Label");
            result.AvailableRoadOrTransitTypes = AvailableRoadOrTransitTypes; // GetLookupCollection("Lookup_GetRoadOrTransitCategories", "Id", "Label");
            //Fixed this next line. -DBD 02/03/2010
            result.AvailableSponsorContacts = AvailableSponsorContacts(result.InfoModel);// GetSponsorContacts(result.InfoModel.SponsorId.Value);
            //result.AvailableSponsorContacts =
            //    ((result.InfoModel.SponsorContactId > 0) && (result.InfoModel.SponsorId > 0)) ?
            //        GetSponsorContacts(result.InfoModel.SponsorId.Value)
            //        : new Dictionary<int, string>();
            result.AvailableProjectTypes = AvailableProjectTypes;// GetLookupCollection("Lookup_GetProjectTypes", "Id", "Label");
            result.AvailableSelectionAgencies = AvailableSelectionAgencies; // GetLookupCollection("Lookup_GetSelectors", "Id", "Label");
            result.AvailablePools = AvailablePools(result.ProjectSummary);// GetPoolNames(1, result.ProjectSummary.TipYearTimePeriodID); // Can get ProgramID from Session. -DBD

            return result;
        }