Exemple #1
0
        public override void ApplyGrouping(string variableCode, GroupingInfo groupInfo, GroupingIncludesType include)
        {
            //JFI: ingen recreateValues?
            Variable paxiomVariable = base.Model.Meta.Variables.GetByCode(variableCode);

            //alter state of mPXSqlMeta, and change paxiomVariable (except sendeing codelists):
            mPXSqlMeta.ApplyGrouping(paxiomVariable, variableCode, groupInfo.ID, include);
            paxiomVariable.CurrentGrouping.GroupPres = include;

            //send the codelist:
            m_parser = PXSqlParserForCodelists.GetPXSqlParserForCodelists(mPXSqlMeta, variableCode);
            base.BuildForSelection();
            //JFI: Ingen .CurrentValueSet= ?
        }
Exemple #2
0
 public override void ApplyValueSet(String subTable)
 {
     if (this.mPXSqlMeta.CNMMVersion.Equals("2.3"))
     {
         string variableID;
         string valueSetID;
         Dictionary <string, PCAxis.Sql.QueryLib_23.SubTableVariableRow> mySubTableVariableRows = ((PCAxis.Sql.Parser_23.PXSqlMeta_23) this.mPXSqlMeta).MetaQuery.GetSubTableVariableRowskeyVariable(maintableId, subTable, true);
         foreach (KeyValuePair <string, PCAxis.Sql.QueryLib_23.SubTableVariableRow> mySubTableVariableRow in mySubTableVariableRows)
         {
             if (mySubTableVariableRow.Value.VariableType != ((SqlDbConfig_23)dbConf).Codes.VariableTypeT)
             {
                 variableID = mySubTableVariableRow.Value.Variable;
                 valueSetID = mySubTableVariableRow.Value.ValueSet;
                 base.Model.Meta.Variables.GetByCode(variableID).RecreateValues();// per inge values for variable must be deleted before created for new valueset.
                 //alter state of mPXSqlMeta:
                 mPXSqlMeta.ApplyValueSet(variableID, valueSetID);
                 //send new state to paxiom:
                 m_parser = PXSqlParserForCodelists.GetPXSqlParserForCodelists(mPXSqlMeta, variableID);
                 base.BuildForSelection();
                 base.Model.Meta.Variables.GetByCode(variableID).CurrentValueSet = base.Model.Meta.Variables.GetByCode(variableID).GetValuesetById(valueSetID);
             }
         }
     }
     else if (this.mPXSqlMeta.CNMMVersion.Equals("2.4"))
     {
         string variableID;
         string valueSetID;
         Dictionary <string, PCAxis.Sql.QueryLib_24.SubTableVariableRow> mySubTableVariableRows = ((PCAxis.Sql.Parser_24.PXSqlMeta_24) this.mPXSqlMeta).MetaQuery.GetSubTableVariableRowskeyVariable(maintableId, subTable, true);
         foreach (KeyValuePair <string, PCAxis.Sql.QueryLib_24.SubTableVariableRow> mySubTableVariableRow in mySubTableVariableRows)
         {
             if (mySubTableVariableRow.Value.VariableType != ((SqlDbConfig_24)dbConf).Codes.VariableTypeT)
             {
                 variableID = mySubTableVariableRow.Value.Variable;
                 valueSetID = mySubTableVariableRow.Value.ValueSet;
                 base.Model.Meta.Variables.GetByCode(variableID).RecreateValues();// per inge values for variable must be deleted before created for new valueset.
                 //alter state of mPXSqlMeta:
                 mPXSqlMeta.ApplyValueSet(variableID, valueSetID);
                 //send new state to paxiom:
                 m_parser = PXSqlParserForCodelists.GetPXSqlParserForCodelists(mPXSqlMeta, variableID);
                 base.BuildForSelection();
                 base.Model.Meta.Variables.GetByCode(variableID).CurrentValueSet = base.Model.Meta.Variables.GetByCode(variableID).GetValuesetById(valueSetID);
             }
         }
     }
     else
     {
         throw new NotImplementedException("Only implemented for version 2.3");
     }
 }
Exemple #3
0
        public override void ApplyValueSet(String variableCode, ValueSetInfo valueSet)
        {                                                                       //Implements IPXModelBuilder.ApplyValueSet
            base.Model.Meta.Variables.GetByCode(variableCode).RecreateValues(); // per inge values for variable must be deleted before created for new valueset.
            //alter state of mPXSqlMeta:
            if (valueSet == null)
            {
                mPXSqlMeta.ApplyValueSet(variableCode, null);
            }
            else
            {
                mPXSqlMeta.ApplyValueSet(variableCode, valueSet.ID);
            }

            //send new state to paxiom:
            m_parser = PXSqlParserForCodelists.GetPXSqlParserForCodelists(mPXSqlMeta, variableCode);
            base.BuildForSelection();
            // piv 04.02.2010
            base.Model.Meta.Variables.GetByCode(variableCode).CurrentValueSet = valueSet;
            base.Model.Meta.Variables.GetByCode(variableCode).CurrentGrouping = null;
        }