public SurveyResponseItem GetSurvey(int responseId) { SurveyResponseItem item = new SurveyResponseItem(); using (hpsDB db = new hpsDB()) { // get general response var general = db.SingleOrDefault <SurveyResponse_General>(SurveyResponseItemSql, responseId); item.GeneralResponse = general; // get active plans with RxPlan var responseActivePlans = db.Fetch <SurveyResponse_ActivePlan>(SurveyResponse_ActivePlanSql, responseId); foreach (SurveyResponse_ActivePlan plan in responseActivePlans) { // get RxPlan for each active plan var rxPlan = db.SingleOrDefault <SurveyResponse_RxPlan>(SurveyResponse_RxPlanSql, plan.ActivePlanId); var rxTiers = db.Fetch <SurveyResponse_RxPlanTier>(SurveyResponse_RxPlanTierSql, plan.ActivePlanId); var surveyRxPlan = new SurveyRxPlan(rxPlan, rxTiers); // create new SurveyActivePlan(plan, rxPlan) var surveyActivePlan = new SurveyActivePlan(plan, surveyRxPlan); item.ActivePlans.Add(surveyActivePlan); } // get retiree plan var retiree = db.SingleOrDefault <SurveyResponse_RetireePlan>(SurveyResponse_RetireePlanSql, responseId); item.RetireePlan = retiree; // get section125 var section125 = db.SingleOrDefault <SurveyResponse_Section125>(SurveyResponse_Section125Sql, responseId); } return(item); }
//Get the SurveyResponseGeneral data. public SurveySummaryModel GetSurveyResponse_Summary(int responseId) { SurveySummaryModel t; using (hpsDB db = new hpsDB()) { var result = db.SingleOrDefault <SurveySummaryModel>(SurveySummaryModelSql, responseId); t = result; } return(t); }
public SurveyResponse_General GetSurveyResponse_General(int responseId) { SurveyResponse_General t; using (hpsDB db = new hpsDB()) { var result = db.SingleOrDefault <SurveyResponse_General>( @"SELECT [ResponseId] ,[SurveyId] ,[WebID] ,[MemberFirmId] ,[ClientId] ,[NotParticipatingReasonTypeId] ,[SurveyResponseStatusTypeId] ,[CreatedOn] ,[CreatedBy] ,[UpdatedOn] ,[UpdatedBy] ,[CompletedBy] ,[CompletedOn] ,[OrganizationName] ,[PersonCompletingSurvey] ,[PersonCompletingSurvey_Title] ,[PersonCompletingSurvey_Email] ,[PersonCompletingSurvey_Phone] ,[PersonCompletingSurvey_PhoneExt] ,[City] ,[US_StateId] ,[ZipCode] ,[LargestLocationCity] ,[LargestLocationStateId] ,[LargestLocationZipCode] ,[IsControlledGroup] ,[NAICSMasterCodeId] ,[OrganizationTypeId] ,[HasUnionEmployees] ,[HasLeasedStaffedEmployees] ,[IsApplicableLargeEmployer] ,[ActiveEmployeesCount] ,[EligibleEmployeesCount] ,[HasVariableHourEmployees] ,[PartTimeEmployeesCount] ,[FullTimeEmployeeCount] ,[OtherEmployeeCount] ,[AreAncillaryProductsOffered] ,[NumberActivePlansOfferedTypeId] ,[NumberRetireePlansOfferedTypeId] ,[PremiumContributionStrategyTypeId] ,[FullTimeHoursPerWeekTypeId] ,[EligibleWaitingPeriodTypeId] ,[HasOptOutBonus] ,[OptOutBonusAmt_Single] ,[OptOutBonusAmt_Family] ,[DomesticPartnerCoverageTypeId] ,[HasEarlyRetireeCoverageInActivePlans] ,[EarlyRetireePremiumShareTypeId] ,[PresentationInterestTypeId] ,[ErrorCount] ,[CoverSameSexSpouses] FROM [dbo].[SurveyResponse_General] WHERE ResponseId = @0", responseId); t = result; } return(t); }