public static OutcomeMeasureDataType MapOutcomeMeasure(NamedNullMappingDataReader readerEx) { OutcomeMeasureDataType outcomeMeasure = new OutcomeMeasureDataType(); outcomeMeasure.OutcomeMeasureIdentifier = readerEx.GetString("OUTCOME_MEASURE_IDENTIFIER"); outcomeMeasure.OutcomeMeasureName = readerEx.GetString("OUTCOME_MEASURE_NAME"); outcomeMeasure.OutcomeMeasureDefinition = readerEx.GetNullString("OUTCOME_MEASURE_DEFINITION"); outcomeMeasure.OutcomeMeasureSavingSpecified = !readerEx.IsDBNull("OUTCOME_MEASURE_SAVING"); if (outcomeMeasure.OutcomeMeasureSavingSpecified) { outcomeMeasure.OutcomeMeasureSaving = ToDecimal(readerEx.GetString("OUTCOME_MEASURE_SAVING")); } outcomeMeasure.OutcomeMeasureInitialCostSpecified = !readerEx.IsDBNull("OUTCOME_MEASURE_INITIAL_COST"); if (outcomeMeasure.OutcomeMeasureInitialCostSpecified) { outcomeMeasure.OutcomeMeasureInitialCost = ToDecimal(readerEx.GetString("OUTCOME_MEASURE_INITIAL_COST")); } outcomeMeasure.OutcomeMeasureRecurringYear = readerEx.GetNullString("OUTCOME_MEASURE_RECURRING_YEAR"); return(outcomeMeasure); }
protected virtual void FillProjectDetails(Dictionary <string, ProjectDetailsDataType> idToProjectDetailsMap) { if (CollectionUtils.IsNullOrEmpty(idToProjectDetailsMap)) { return; } string selectText = string.Format("SELECT am.* FROM P2R_ACTIVITY_MEASURE am, P2R_PROJECT_DETAILS project, P2R_PROGRAM_DETAILS program WHERE " + "{0} AND am.PROJECT_DETAILS_ID = project.PROJECT_DETAILS_ID", _projectDetailsWhereQuery); { Dictionary <string, ActivityMeasureDataType> activityMeasureMap = _baseDao.MapArrayObjects <ActivityMeasureDataType>( "PROJECT_DETAILS_ID", idToProjectDetailsMap.Keys, selectText, P2RPluginMappers.MapActivityMeasure, "ACTIVITY_MEASURE_ID", delegate(ActivityMeasureDataType[] array, int listKeyFieldsIndex) { ProjectDetailsDataType projectDetails = idToProjectDetailsMap[CollectionUtils.NthItem(idToProjectDetailsMap.Keys, listKeyFieldsIndex)]; projectDetails.ActivityMeasure = array; }); if (!CollectionUtils.IsNullOrEmpty(activityMeasureMap)) { selectText = string.Format("SELECT amqr.* FROM P2R_ACTIVITY_MEASURE_QNT_RSLT amqr, P2R_ACTIVITY_MEASURE am, P2R_PROJECT_DETAILS project, P2R_PROGRAM_DETAILS program WHERE " + "{0} AND am.PROJECT_DETAILS_ID = project.PROJECT_DETAILS_ID AND am.ACTIVITY_MEASURE_ID = amqr.ACTIVITY_MEASURE_ID", _projectDetailsWhereQuery); _baseDao.MapArrayObjects <ActivityMeasureQuantitativeResultDataType>( "ACTIVITY_MEASURE_ID", activityMeasureMap.Keys, selectText, P2RPluginMappers.MapActivityMeasureQuantitativeResultDataType, delegate(ActivityMeasureQuantitativeResultDataType[] array, int listKeyFieldsIndex) { ActivityMeasureDataType activityMeasure = activityMeasureMap[CollectionUtils.NthItem(activityMeasureMap.Keys, listKeyFieldsIndex)]; activityMeasure.QuantitativeResult = array; }); } } selectText = string.Format("SELECT pds.* FROM P2R_PROJECT_DETAILS_SECTOR pds, P2R_PROJECT_DETAILS project, P2R_PROGRAM_DETAILS program WHERE " + "{0} AND pds.PROJECT_DETAILS_ID = project.PROJECT_DETAILS_ID", _projectDetailsWhereQuery); _baseDao.MapArrayObjects <ProjectDetailsSectorDataType>( "PROJECT_DETAILS_ID", idToProjectDetailsMap.Keys, selectText, P2RPluginMappers.MapSectorText, delegate(ProjectDetailsSectorDataType[] array, int listKeyFieldsIndex) { ProjectDetailsDataType projectDetails = idToProjectDetailsMap[CollectionUtils.NthItem(idToProjectDetailsMap.Keys, listKeyFieldsIndex)]; projectDetails.SectorText = array; }); selectText = string.Format("SELECT i.* FROM P2R_INVESTMENT i, P2R_PROJECT_DETAILS project, P2R_PROGRAM_DETAILS program WHERE " + "{0} AND i.PROJECT_DETAILS_ID = project.PROJECT_DETAILS_ID", _projectDetailsWhereQuery); _baseDao.MapArrayObjects <InvestmentDataType>( "PROJECT_DETAILS_ID", idToProjectDetailsMap.Keys, selectText, P2RPluginMappers.MapInvestment, delegate(InvestmentDataType[] array, int listKeyFieldsIndex) { ProjectDetailsDataType projectDetails = idToProjectDetailsMap[CollectionUtils.NthItem(idToProjectDetailsMap.Keys, listKeyFieldsIndex)]; projectDetails.Investment = array; }); selectText = string.Format("SELECT bc.* FROM P2R_BEHAVIORAL_CHANGE bc, P2R_PROJECT_DETAILS project, P2R_PROGRAM_DETAILS program WHERE " + "{0} AND bc.PROJECT_DETAILS_ID = project.PROJECT_DETAILS_ID", _projectDetailsWhereQuery); { Dictionary <string, BehavioralChangeDataType> behavioralChangeMap = _baseDao.MapArrayObjects <BehavioralChangeDataType>( "PROJECT_DETAILS_ID", idToProjectDetailsMap.Keys, selectText, P2RPluginMappers.MapBehavioralChange, "BEHAVIORAL_CHANGE_ID", delegate(BehavioralChangeDataType[] array, int listKeyFieldsIndex) { ProjectDetailsDataType projectDetails = idToProjectDetailsMap[CollectionUtils.NthItem(idToProjectDetailsMap.Keys, listKeyFieldsIndex)]; projectDetails.BehavioralChange = array; }); if (!CollectionUtils.IsNullOrEmpty(behavioralChangeMap)) { selectText = string.Format("SELECT bcqr.* FROM P2R_BEHAVIORAL_CHANGE_QNT_RSLT bcqr, P2R_BEHAVIORAL_CHANGE bc, P2R_PROJECT_DETAILS project, P2R_PROGRAM_DETAILS program WHERE " + "{0} AND bc.PROJECT_DETAILS_ID = project.PROJECT_DETAILS_ID AND bc.BEHAVIORAL_CHANGE_ID = bcqr.BEHAVIORAL_CHANGE_ID", _projectDetailsWhereQuery); _baseDao.MapArrayObjects <BehavioralChangeQuantitativeResultDataType>( "BEHAVIORAL_CHANGE_ID", behavioralChangeMap.Keys, selectText, P2RPluginMappers.MapBehavioralChangeQuantitativeResultDataType, delegate(BehavioralChangeQuantitativeResultDataType[] array, int listKeyFieldsIndex) { BehavioralChangeDataType behavioralChange = behavioralChangeMap[CollectionUtils.NthItem(behavioralChangeMap.Keys, listKeyFieldsIndex)]; behavioralChange.QuantitativeResult = array; }); } } selectText = string.Format("SELECT om.* FROM P2R_OUTCOME_MEASURE om, P2R_PROJECT_DETAILS project, P2R_PROGRAM_DETAILS program WHERE " + "{0} AND om.PROJECT_DETAILS_ID = project.PROJECT_DETAILS_ID", _projectDetailsWhereQuery); { Dictionary <string, OutcomeMeasureDataType> outcomeMeasureMap = _baseDao.MapArrayObjects <OutcomeMeasureDataType>( "PROJECT_DETAILS_ID", idToProjectDetailsMap.Keys, selectText, P2RPluginMappers.MapOutcomeMeasure, "OUTCOME_MEASURE_ID", delegate(OutcomeMeasureDataType[] array, int listKeyFieldsIndex) { ProjectDetailsDataType projectDetails = idToProjectDetailsMap[CollectionUtils.NthItem(idToProjectDetailsMap.Keys, listKeyFieldsIndex)]; projectDetails.OutcomeMeasure = array; }); if (!CollectionUtils.IsNullOrEmpty(outcomeMeasureMap)) { selectText = string.Format("SELECT omr.* FROM P2R_OUTCOME_MEASURE_RESULT omr, P2R_OUTCOME_MEASURE om, P2R_PROJECT_DETAILS project, P2R_PROGRAM_DETAILS program WHERE " + "{0} AND om.PROJECT_DETAILS_ID = project.PROJECT_DETAILS_ID AND om.OUTCOME_MEASURE_ID = omr.OUTCOME_MEASURE_ID", _projectDetailsWhereQuery); _baseDao.MapArrayObjects <OutcomeMeasureResultDataType>( "OUTCOME_MEASURE_ID", outcomeMeasureMap.Keys, selectText, P2RPluginMappers.MapOutcomeMeasureResult, delegate(OutcomeMeasureResultDataType[] array, int listKeyFieldsIndex) { OutcomeMeasureDataType outcomeMeasure = outcomeMeasureMap[CollectionUtils.NthItem(outcomeMeasureMap.Keys, listKeyFieldsIndex)]; outcomeMeasure.OutcomeMeasureResult = array; }); } } }