コード例 #1
0
ファイル: PXSqlSubTables.cs プロジェクト: trygu/PxWeb
        private void SetSelectedSubTable(PXSqlMeta_22 pxsqlMeta)
        {
            Boolean isEqualValueSet;

            foreach (KeyValuePair <string, PCAxis.Sql.Parser_22.PXSqlSubTable> subTable in this)
            {
                isEqualValueSet = true;
                string subTableName = subTable.Value.SubTable;
                Dictionary <string, SubTableVariableRow> fromDb = pxsqlMeta.MetaQuery.GetSubTableVariableRowskeyVariable(pxsqlMeta.MainTable.MainTable, subTableName, false);

                foreach (PQVariable pqvariable in mPxsQuery.Query.Variables)
                {
                    string variableName     = pqvariable.code;
                    string selectedValueset = pqvariable.SelectedValueset;
                    if (!fromDb.ContainsKey(variableName))
                    {
                        throw new Exception("The variable \"" + variableName + "\" given in the query, does not exist in the database, for the maintable \"" + pxsqlMeta.MainTable.MainTable + "\". Is the query of date? Or the database?");
                    }
                    string valuesetIdFromSubTableVariableRow = fromDb[variableName].ValueSet;
                    if (selectedValueset != valuesetIdFromSubTableVariableRow && selectedValueset != PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS)
                    {
                        isEqualValueSet = false;
                        break;
                    }
                }
                if (isEqualValueSet)
                {
                    this[subTableName].IsSelected = true;
                }
            }
        }
コード例 #2
0
ファイル: PXSqlNpm.cs プロジェクト: trygu/PxWeb
            public NPMCharacter(KeyValuePair <string, SpecialCharacterRow> myRow, PXSqlMeta_22 mMeta)
            {
                //this.id = npmId;
                this.characterType  = myRow.Value.CharacterType;
                this.presCharacters = new Dictionary <string, string>();
                this.presTexts      = new Dictionary <string, string>();
                foreach (string lang in mMeta.LanguageCodes)
                {
                    this.presCharacters[lang] = myRow.Value.texts[lang].PresCharacter;
                    this.presTexts[lang]      = myRow.Value.texts[lang].PresText;
                }

                if (myRow.Value.DataCellPres == mMeta.Config.Codes.Yes && myRow.Value.AggregPossible == mMeta.Config.Codes.Yes)
                {
                    this.category = 1;
                }
                else if (myRow.Value.DataCellPres == mMeta.Config.Codes.No && myRow.Value.AggregPossible == mMeta.Config.Codes.Yes)
                {
                    this.category = 2;
                }
                else if (myRow.Value.DataCellPres == mMeta.Config.Codes.No && myRow.Value.AggregPossible == mMeta.Config.Codes.No)
                {
                    this.category = 3;
                }
            }
コード例 #3
0
ファイル: PXSqlNpm.cs プロジェクト: trygu/PxWeb
        internal PXSqlNpm(PXSqlMeta_22 mMeta)
        {
            this.mMeta = mMeta;


            cat2Counter = 0;
            cat3Counter = 0;

            SpecialCharacterIDbyMetaAdmProprety = new Dictionary <string, string>();

            //DataNotAvailable
            SpecialCharacterIDbyMetaAdmProprety.Add(mMeta.Config.Keywords.DataNotAvailable, mMeta.PXMetaAdmValues.DataNotAvailable);
            //DATANOTESUM
            SpecialCharacterIDbyMetaAdmProprety.Add(mMeta.Config.Keywords.DataNoteSum, mMeta.PXMetaAdmValues.DataNoteSum);

            //DATASYMBOLNIL
            SpecialCharacterIDbyMetaAdmProprety.Add(mMeta.Config.Keywords.DataSymbolNIL, mMeta.PXMetaAdmValues.DataSymbolNIL);

            //DATASYMBOLSUM
            SpecialCharacterIDbyMetaAdmProprety.Add(mMeta.Config.Keywords.DataSymbolSum, mMeta.PXMetaAdmValues.DataSymbolSum);

            //DEFAULTCODEMISSINGLINE
            SpecialCharacterIDbyMetaAdmProprety.Add(mMeta.Config.Keywords.DefaultCodeMissingLine, mMeta.PXMetaAdmValues.DefaultCodeMissingLine);

            // assign properties for specialcharacters

            setNpmCharacters();
            setMetaAdm();
            maxDatasymbolN = cat3Counter;
        }
コード例 #4
0
ファイル: PXSqlNotes.cs プロジェクト: trygu/PxWeb
        internal PXSqlNotes(PXSqlMeta_22 mMeta, string mMainTableId, bool inPresentationModus)
        {
            this.mMeta      = mMeta;
            this.mVariables = mMeta.Variables;

            this.mSubTables    = mMeta.SubTables;
            this.mContents     = mMeta.Contents;
            this.mTimeVariable = mMeta.TimeVariable;
            this.mMainTableId  = mMainTableId;


            this.showFootnotesCodes = new StringCollection();
            if (inPresentationModus)
            {
                showFootnotesCodes.Add(mMeta.Config.Codes.FootnoteShowP);
            }
            else
            {
                showFootnotesCodes.Add(mMeta.Config.Codes.FootnoteShowS);
            }
            showFootnotesCodes.Add(mMeta.Config.Codes.FootnoteShowB);

            allRelevantFoonotes = mMeta.MetaQuery.GetRelevantFoonotes(this.mMainTableId);
            //Adding footnotes for grouping
            allRelevantFoonotes.AddRange(this.getRelevantGroupingNotes(inPresentationModus));



            this.SetFootNotes();
        }
コード例 #5
0
ファイル: PXSqlNotes.cs プロジェクト: trygu/PxWeb
        public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode)
        {
            string           keyWord;
            string           subKeyWord;
            StringCollection parseValue;

            foreach (PXSqlNote note in this)
            {
                if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB))
                {
                    if (note.MandOpt == mMeta.Config.Codes.FootnoteM)
                    {
                        keyWord = "VALUENOTEX";
                    }
                    else
                    {
                        keyWord = "VALUENOTE";
                    }
                    subKeyWord = note.Variable + "\",\"" + note.ValueCode;
                    parseValue = new StringCollection();
                    parseValue.Add(note.NotePresTexts[langCode]);
                    handler(keyWord, langCode, subKeyWord, parseValue);
                }
            }
        }
コード例 #6
0
ファイル: PXSqlValuePool.cs プロジェクト: trygu/PxWeb
        //public PXSqlValuepool() { }

        /// <summary>Loads the data from a row
        /// </summary>
        /// <param name="inRow">The data row</param>
        /// <param name="meta">For config.codes </param>
        public PXSqlValuepool(QueryLib_22.ValuePoolRow inRow, PXSqlMeta_22 meta)
        {
            this.vpRow = inRow;

            if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsN))
            {
                this.mValueTextOption = PXConstant.VALUETEXTOPTION_NOTEXT;
            }
            else if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsX))
            {
                this.mValueTextOption = PXConstant.VALUETEXTOPTION_TOOLONG;
            }
            else
            {
                this.mValueTextOption = PXConstant.VALUETEXTOPTION_NORMAL;
            }

            mPresText = new Dictionary <string, string>();
            mDomain   = new Dictionary <string, string>();
            foreach (string langCode in vpRow.texts.Keys)
            {
                mPresText[langCode] = vpRow.texts[langCode].PresText;
                mDomain[langCode]   = vpRow.texts[langCode].ValuePoolAlias;
            }
        }
コード例 #7
0
ファイル: PXSqlGroupingInfos.cs プロジェクト: trygu/PxWeb
        /// <summary>Initializes a new instance of the PXSqlGroupingInfos class, and fills the list of PXSqlGroupingInfo</summary>
        /// <param name="meta">Holds the state of the builder</param>
        /// <param name="variableName">The variable which has these groupings.</param>
        /// <param name="valueSetIds">The valueSets that apply to this builder </param>
        internal PXSqlGroupingInfos(PXSqlMeta_22 meta, string variableName, StringCollection valueSetIds)
        {
            this.variableName = variableName;
            // finding the IDs of the grouping which may be used for this
            groupingIDs = new StringCollection();
            foreach (string valueSetId in valueSetIds)
            {
                foreach (string groupingId in meta.MetaQuery.GetValueSetGroupingRowskeyGrouping(valueSetId, true).Keys)
                {
                    groupingIDs.Add(groupingId);
                }
            }

            // finding the ID's of hierarchical groups
            foreach (string groupingId in meta.MetaQuery.GetMainTableVariableHierarchyRows_KeyIsGroupingID(meta.MainTable.MainTable, variableName, true).Keys)
            {
                groupingIDs.Add(groupingId);
            }

            // creating Info for them;
            foreach (string groupingId in groupingIDs)
            {
                infos.Add(new PXSqlGroupingInfo(meta.MetaQuery.GetGroupingRow(groupingId), meta.Config.Codes));
            }
        }
コード例 #8
0
ファイル: PXSqlNotes.cs プロジェクト: trygu/PxWeb
        public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode)
        {
            string           keyWord;
            string           subKeyWord = null;
            StringCollection parseValue;

            foreach (PXSqlNote note in this.tableNotes.Values)
            {
                if (note.MandOpt == mMeta.Config.Codes.FootnoteM)
                {
                    keyWord = "NOTEX";
                }
                else
                {
                    keyWord = "NOTE";
                }
                parseValue = new StringCollection();
                parseValue.Add(note.NotePresTexts[langCode]);
                handler(keyWord, langCode, subKeyWord, parseValue);
            }



            foreach (PXSqlNote note in this.variableNotes)
            {
                if (note.MandOpt == mMeta.Config.Codes.FootnoteM)
                {
                    keyWord = "NOTEX";
                }
                else
                {
                    keyWord = "NOTE";
                }
                subKeyWord = note.Variable;
                parseValue = new StringCollection();
                parseValue.Add(note.NotePresTexts[langCode]);
                handler(keyWord, langCode, subKeyWord, parseValue);
            }



            foreach (PXSqlNote note in this.contentsNotes)
            {
                subKeyWord = mMeta.ContensCode + "\",\"" + mMeta.ContentsVariable.Values.GetValueByContentsCode(note.Contents).ValueCode;
                //subKeyWord = mMeta.ContensCode + "," + note.Contents;
                if (note.MandOpt == mMeta.Config.Codes.FootnoteM)
                {
                    keyWord = "VALUENOTEX";
                }
                else
                {
                    keyWord = "VALUENOTE";
                }

                parseValue = new StringCollection();
                parseValue.Add(note.NotePresTexts[langCode]);
                handler(keyWord, langCode, subKeyWord, parseValue);
            }
        }
コード例 #9
0
        // public PXSqlParser_22() { }


        public PXSqlParser_22(PXSqlMeta_22 inPXSqlMeta)
        {
            mPXSqlMeta = inPXSqlMeta;
            if (mPXSqlMeta.inPresentationModus)
            {
                symbols = mPXSqlMeta.mPxsqlNpm;
            }
        }
コード例 #10
0
        public PXSqlContent(ContentsRow row, PXSqlMeta_22 pxsqlMeta, SqlDbConfig_22 config, PXSqlContact contact)
        {
            mRow     = row;
            mContact = contact;
            //pxsqlMeta.MetaQuery.DB.Codes.Copyright1;
            mContents = row.Contents;
            //mFootnoteContents = row.FootnoteContents;
            //mFootnoteTime = row.FootnoteTime;
            //mFootnoteValue = row.FootnoteValue;
            //mFootnoteVariable = row.FootnoteVariable;
            mPresText  = new Dictionary <string, string>();
            mPresTextS = new Dictionary <string, string>();
            mPresCode  = row.PresCode;

            mBasePeriod = new Dictionary <string, string>();
            mRefPeriod  = new Dictionary <string, string>();
            mUnit       = new Dictionary <string, string>();


            foreach (string langCode in pxsqlMeta.LanguageCodes)
            {
                mPresText[langCode]   = row.texts[langCode].PresText;
                mPresTextS[langCode]  = row.texts[langCode].PresTextS;
                mBasePeriod[langCode] = row.texts[langCode].BasePeriod;
                mRefPeriod[langCode]  = row.texts[langCode].RefPeriod;
                mUnit[langCode]       = row.texts[langCode].Unit;
            }

            mPresDecimals = mRow.PresDecimals;
            pxsqlMeta.DecimalHandler.ShowDecimals  = mPresDecimals;
            pxsqlMeta.DecimalHandler.StoreDecimals = mRow.StoreDecimals;

            mSeasAdj     = mRow.SeasAdj.Equals(config.Codes.Yes);
            mDayAdj      = mRow.DayAdj.Equals(config.Codes.Yes);
            mLastUpdatet = mRow.LastUpdated;
            mStockFA     = PaxiomifyStockFA(mRow.StockFA, config);
            mCFPrices    = PaxiomifyCFPrices(mRow.CFPrices, config);


            mAggregPossible = !mRow.AggregPossible.Equals(config.Codes.No); //not notPossible since yes is default

            #region mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows
            if (pxsqlMeta.inPresentationModus && mRow.PresCellsZero.Equals(config.Codes.No))
            {
                // both 2.1 and 2.2 uses a mRow.PresMissingLine from the SpecialCharacter.CharacterType( which is the primary key)
                // or if mRow.PresMissingLine is missing: the default

                mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineMagic;
                if (!(String.IsNullOrEmpty(mRow.PresMissingLine)))
                {
                    mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine);
                }
                mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString();
            }
            #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows
        }
コード例 #11
0
        /// <summary>
        /// Constructor called when parser is in selectionmode and there are no grouping ids in pxs or no pxs at all.
        /// </summary>
        /// <returns></returns>
        public PXSqlGrouping(GroupingRow groupingRow, PXSqlMeta_22 meta, PXSqlVariableClassification var, GroupingIncludesType include)
        {
            Init(groupingRow, meta, var);
            //TODO overriding include from paxiom, have to discuss how paxion can override database default.
            this.mIncludeType = include;
            // DONE, is now passed to paxiom as part of GroupingInfo ... this.mIncludeType = this.mDefaultIncludeType;
            //TODO end
            tempValueList = new StringCollection();
            StringCollection tempParentList = new StringCollection();

            mGroups = new List <PXSqlGroup>();
            PXSqlGroup tmpGroup = null;

            this.isHierarchy = this.mHierarchy != meta.Config.Codes.HierarchyNon;
            if (!isHierarchy)
            // Not hierarchical groups
            {
                this.mIncludeType = include;
                List <ValueGroupRow> myValuegroupRows = meta.MetaQuery.GetValueGroupRowsSorted(mGroupingId, null, true, meta.MainLanguageCode);

                foreach (ValueGroupRow myRow in myValuegroupRows)
                {
                    if (!tempParentList.Contains(myRow.GroupCode))
                    {
                        tmpGroup = new PXSqlGroup(myRow.GroupCode);
                        mGroups.Add(tmpGroup);
                        tempParentList.Add(myRow.GroupCode);
                    }
                    else
                    {
                        foreach (PXSqlGroup group in mGroups)
                        {
                            if (group.ParentCode == myRow.GroupCode)
                            {
                                tmpGroup = group;
                                break;
                            }
                        }
                    }
                    tmpGroup.AddChildCode(myRow.ValueCode);
                }
                AddValues(mValuePoolId, tempParentList, valuePoolValueTextExists);
            }
            else
            //hierarchical groups
            {
                this.mIncludeType = GroupingIncludesType.All;
                createHierarchy(meta.MetaQuery.GetValueGroupRowsSorted(mGroupingId, levelOne, true, meta.MainLanguageCode));
                setHierarchyLevelsOpen();
                setHierarchyLevels();
                setHierarchyNames();
                variable.Values.Clear();
                AddValues(mValuePoolId, tempValueList, valuePoolValueTextExists);
            }
        }
コード例 #12
0
ファイル: PXSqlNpm.cs プロジェクト: trygu/PxWeb
        public void ParseMeta(IPXModelParser.MetaHandler handler, PXSqlMeta_22 mPXSqlMeta)
        {
            string keyword;

            string           noLanguage = null;
            string           subkey     = null;
            StringCollection values;

            if (mPXSqlMeta.inPresentationModus)
            {
                // NPM Characters
                //DataNoteSum
                {
                    subkey  = null;
                    keyword = PXKeywords.DATANOTESUM;
                    foreach (string langCode in mPXSqlMeta.LanguageCodes)
                    {
                        values = new StringCollection();
                        values.Add(this.DataSymbolSumPresChar(langCode));
                        handler(keyword, langCode, subkey, values);
                    }
                    values = null;
                }
                //DataSymbolN
                {
                    for (int i = 1; i <= this.maxDatasymbolN; i++)
                    {
                        subkey  = null;
                        values  = new StringCollection();
                        keyword = "DATASYMBOL" + i.ToString();
                        values.Add(this.DataSymbolNPresChar(i, mPXSqlMeta.LanguageCodes[0]));
                        handler(keyword, noLanguage, subkey, values);
                        values = null;
                    }
                }
                //DataSymbolNil
                {
                    subkey  = null;
                    values  = new StringCollection();
                    keyword = PXKeywords.DATASYMBOLNIL;
                    values.Add(this.DataSymbolNilPresChar(mPXSqlMeta.LanguageCodes[0]));
                    handler(keyword, noLanguage, subkey, values);
                    values = null;
                }
                //DataSymbolSum
                {
                    subkey  = null;
                    values  = new StringCollection();
                    keyword = PXKeywords.DATASYMBOLSUM;
                    values.Add(this.DataSymbolSumPresChar(mPXSqlMeta.LanguageCodes[0]));
                    handler(keyword, noLanguage, subkey, values);
                    values = null;
                }
            }
        }
コード例 #13
0
ファイル: PXSqlVariableContents.cs プロジェクト: trygu/PxWeb
 public PXSqlVariableContents(String name, PXSqlMeta_22 meta)
     : base(name, meta, true, false, false)
 {
     mStoreColumnNo = -1;
     SetSelected();
     if (!meta.ConstructedFromPxs)
     {
         mIndex = mStoreColumnNo;
     }
     SetDefaultPresTextOption();
     SetPresText();
 }
コード例 #14
0
        internal PXSqlMaintable(MainTableRow mtRow, DataStorageRow dataStorageRow, MenuSelectionRow menuSelectionRow, PXSqlMeta_22 meta)
        {
            this.meta            = meta;
            this.mtRow           = mtRow;
            this.mDataStorageRow = dataStorageRow;

            this.mSubjectCode = menuSelectionRow.Selection;

            foreach (string langCode in menuSelectionRow.texts.Keys)
            {
                mSubjectAreaByLanguage[langCode] = menuSelectionRow.texts[langCode].PresText;
            }
        }
コード例 #15
0
        //for selection or presentation with grouping id in from pxs
        public PXSqlGrouping(GroupingRow groupingRow, PXSqlMeta_22 meta, PXSqlVariableClassification var, StringCollection outputCodes)
        {
            Init(groupingRow, meta, var);


            StringCollection tempParentList = new StringCollection();

            mGroups = new List <PXSqlGroup>();
            PXSqlGroup tmpGroup = null;

            this.isHierarchy = this.mHierarchy != meta.Config.Codes.HierarchyNon;
            foreach (string code in outputCodes)
            {
                tmpGroup = new PXSqlGroup(code);
                mGroups.Add(tmpGroup);
            }

            foreach (PXSqlGroup group in mGroups)
            {
                //TODO; 2.2 bytt VSGroupRow
                // throw new NotImplementedException("i PXSqlGrouping");

                Dictionary <string, ValueGroupRow> templist = meta.MetaQuery.GetValueGroupRowskeyValueCode(mGroupingId, group.ParentCode, true);
                if (templist.Count > 0)
                {
                    foreach (KeyValuePair <string, ValueGroupRow> row in templist)
                    {
                        group.AddChildCode(row.Key);
                    }
                }
                else
                {
                    group.AddChildCode(group.ParentCode);
                }

                //List<VSGroupRow> tempList = meta.MetaQuery.GetVSGroupRow(mValuePoolId, mValuesetIds, mGroupingId,group.ParentCode);
                //if (tempList.Count > 0)
                //{
                //    foreach(VSGroupRow row in tempList)
                //    {
                //    group.AddChildCode(row.ValueCode);
                //    }
                //}
                //else
                //{
                //    group.AddChildCode(group.ParentCode);
                //}
            }
            // Add the values to valuecollection of this variable
            AddValues(mValuePoolId, outputCodes, valuePoolValueTextExists);
        }
コード例 #16
0
ファイル: PXSqlNotes.cs プロジェクト: trygu/PxWeb
 public PXSqlNote(PXSqlMeta_22 mMeta)
 {
     this.mShowFootNote  = mMeta.Config.Codes.FootnoteShowB;
     this.mMandOpt       = mMeta.Config.Codes.FootnoteM;
     this.mFootNoteNo    = FootNoteTableContainsOnlyMetadataDummyNumber;
     this.mContents      = "";
     this.mVariable      = "";
     this.mValueCode     = "";
     this.mTimePeriode   = "";
     this.mNotePresTexts = new Dictionary <string, String>();
     foreach (string langCode in mMeta.LanguageCodes)
     {
         this.mNotePresTexts.Add(langCode, FootNoteTableContainsOnlyMetadata);
     }
 }
コード例 #17
0
ファイル: PXSqlNotes.cs プロジェクト: trygu/PxWeb
 public PXSqlNote(RelevantFootNotesRow footNoteRow, PXSqlMeta_22 mMeta)
 {
     this.mShowFootNote  = footNoteRow.ShowFootNote;
     this.mMandOpt       = footNoteRow.MandOpt;
     this.mFootNoteNo    = footNoteRow.FootNoteNo;
     this.mContents      = footNoteRow.Contents;
     this.mVariable      = footNoteRow.Variable;
     this.mValueCode     = footNoteRow.ValueCode;
     this.mTimePeriode   = footNoteRow.TimePeriod;
     this.mNotePresTexts = new Dictionary <string, String>();
     foreach (string langCode in mMeta.LanguageCodes)
     {
         this.mNotePresTexts.Add(langCode, footNoteRow.texts[langCode].FootNoteText);
     }
 }
コード例 #18
0
ファイル: PXSqlNotes.cs プロジェクト: trygu/PxWeb
        public void ParseNote(PXSqlMeta_22 mMeta, PCAxis.Paxiom.IPXModelParser.MetaHandler handler, string langCode)
        {
            string           keyWord;
            string           subKeyWord = null;
            StringCollection parseValue;

            foreach (PXSqlNote note in this)
            {
                if (mMeta.Contents.Count == 1)
                {
                    if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB))
                    {
                        if (note.MandOpt == mMeta.Config.Codes.FootnoteM)
                        {
                            keyWord = "NOTEX";
                        }
                        else
                        {
                            keyWord = "NOTE";
                        }
                        subKeyWord = note.Variable;
                        parseValue = new StringCollection();
                        parseValue.Add(note.NotePresTexts[langCode]);
                        handler(keyWord, langCode, subKeyWord, parseValue);
                    }
                }
                // if more than one contentsvariable is selected the note should be presented different, but there are
                // no way to parse it to PAXIOm and specify that the note is valid for only one contents.
                else
                {
                    if ((note.ShowFootNote == mMeta.Config.Codes.FootnoteShowP) || (note.ShowFootNote == mMeta.Config.Codes.FootnoteShowB))
                    {
                        if (note.MandOpt == mMeta.Config.Codes.FootnoteM)
                        {
                            keyWord = "NOTEX";
                        }
                        else
                        {
                            keyWord = "NOTE";
                        }
                        subKeyWord = note.Variable;
                        parseValue = new StringCollection();
                        parseValue.Add(note.NotePresTexts[langCode]);
                        handler(keyWord, langCode, subKeyWord, parseValue);
                    }
                }
            }
        }
コード例 #19
0
ファイル: PXSqlVariableTime.cs プロジェクト: trygu/PxWeb
        //private bool mTableContainsMetaOnly;
        #endregion props


        #region  contructor
        public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_22 meta)
            : base(aTVRow.Variable, meta, false, true, false)
        {
            mStoreColumnNo = int.Parse(aTVRow.StoreColumnNo);
            if (!meta.ConstructedFromPxs)
            {
                mIndex = mStoreColumnNo;
            }
            SetSelected();
            SetPresText();
            SetDefaultPresTextOption();
            SetTimeValues();
            mTimeScale = new PXSqlTimeScale(meta.MetaQuery.GetTimeScaleRow(meta.MainTable.TimeScale), meta.Config);
            SetTimeVal();
            PossiblyResetPresText();
        }
コード例 #20
0
ファイル: PXSqlVariable.cs プロジェクト: trygu/PxWeb
 public PXSqlVariable(string name, PXSqlMeta_22 meta, bool isContVar, bool isTimeVar, bool isClassVar)
 {
     this.Name                     = name;
     this.IsTimevariable           = isTimeVar;
     this.IsContentVariable        = isContVar;
     this.IsClassificationVariable = isClassVar;
     this.IsStub                   = false;
     this.IsHeading                = false;
     this.Values                   = new PxSqlValues();
     this.PresText                 = new Dictionary <string, string>();
     this.meta                     = meta;
     this.metaQuery                = meta.MetaQuery;
     // should be moved to classvar
     this.IsEliminatedByValue = false;
     this.selectedValueset    = PXSqlKeywords.FICTIONAL_ID_ALLVALUESETS;
 }
コード例 #21
0
        //for presentation without grouping id in from pxs
        public PXSqlGrouping(PXSqlMeta_22 meta, PXSqlVariableClassification var, List <PXSqlGroup> groupFromPxs)
        {
            this.meta     = meta;
            this.variable = var;
            this.valuePoolValueTextExists = var.ValuePool.ValueTextExists;
            this.mValuePoolId             = var.ValuePool.ValuePool;
            this.mGroups = groupFromPxs;

            StringCollection parentCodes = new StringCollection();

            foreach (PXSqlGroup group in groupFromPxs)
            {
                parentCodes.Add(group.ParentCode);
            }
            AddValues(mValuePoolId, parentCodes, valuePoolValueTextExists);
        }
コード例 #22
0
        private void Init(GroupingRow groupingRow, PXSqlMeta_22 meta, PXSqlVariableClassification var)
        {
            this.meta = meta;

            this.variable = var;
            this.valuePoolValueTextExists = var.ValuePool.ValueTextExists;
            this.mValuePoolId             = groupingRow.ValuePool;
            this.mValuesetIds             = var.ValusetIds;
            this.mGroupingId = groupingRow.Grouping;
            this.mGroupPres  = groupingRow.GroupPres;
            // throw new NotImplementedException("I init i PXSqlGrouping");
            //TODO; tok bort this.mGeoAreaNo = groupingRow.GeoAreaNo;
            //           this.mGeoAreaNo = groupingRow.GeoAreaNo;
            this.mHierarchy  = groupingRow.Hierarchy;
            this.Description = groupingRow.Description;
            this.PresText    = new Dictionary <string, string>();
            foreach (string langCode in meta.LanguageCodes)
            {
                this.PresText[langCode] = groupingRow.texts[langCode].PresText;
            }
            this.SortCode = groupingRow.texts[meta.MainLanguageCode].SortCode;
            //TODO added databasedefault to override value from paxiom, should be possible to do both
            switch (this.mGroupPres.ToUpper())
            {
            case "I":
                mDefaultIncludeType = GroupingIncludesType.SingleValues;
                break;

            case "A":
                mDefaultIncludeType = GroupingIncludesType.AggregatedValues;
                break;

            case "B":
                mDefaultIncludeType = GroupingIncludesType.All;
                break;

            default:
                mDefaultIncludeType = GroupingIncludesType.AggregatedValues;
                break;
            }
        }
コード例 #23
0
 /// <summary>
 /// Creating a parser that sends data for the named variable
 /// </summary>
 /// <param name="inPXSqlMeta">PXSqlMeta holding variables</param>
 /// <param name="variableCode">Name of the vaiable</param>
 public PXSqlParserForCodelists_22(PXSqlMeta_22 inPXSqlMeta, String variableCode)
 {
     mPXSqlMeta = inPXSqlMeta;
     _variables = new List <PXSqlVariableClassification>();
     _variables.Add(inPXSqlMeta.VariablesClassification[variableCode]);
 }
コード例 #24
0
        internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_22 meta, SqlDbConfig_22 config)
        {
            mStatAuthorityCode = someContentsRow.StatAuthority;
            string copyright = someContentsRow.Copyright;

            if (copyright.Equals(config.Codes.Copyright1) || copyright.Equals(config.Codes.Copyright2))
            {
                mCopyright = false;
            }
            else if (copyright.Equals(config.Codes.Copyright3))
            {
                mCopyright = true;
            }
            else
            {
                mCopyright = true;
                log.Error("The database has copyright=" + copyright + ", but the valid codes from config are " + config.Codes.Copyright1 + "," + config.Codes.Copyright2 + " or " + config.Codes.Copyright3 + ".");
            }
            if (copyright.Equals(config.Codes.Copyright1))
            {
                mOfficialStatistics = true;
            }
            else
            {
                mOfficialStatistics = false;
            }
            OrganizationRow org = meta.MetaQuery.GetOrganizationRow(mStatAuthorityCode);

            foreach (string language in org.texts.Keys)
            {
                nameByLangCode.Add(language, org.texts[language].OrganizationName);
            }
        }
コード例 #25
0
        //     public PXSqlVariableClassification() { }


        public PXSqlVariableClassification(MainTableVariableRow aTVRow, PXSqlMeta_22 meta)
            : base(aTVRow.Variable, meta, false, false, true)
        {
            if (this.meta.ConstructedFromPxs)
            {
                foreach (PQVariable tmpVar in this.meta.PxsFile.Query.Variables)
                {
                    if (this.Name == tmpVar.code)
                    {
                        this.pxsQueryVariable = tmpVar;
                    }
                }
            }
            SetSelected();

            if (this.isSelected)
            {
                this.mStoreColumnNo = int.Parse(aTVRow.StoreColumnNo);
                if (!this.meta.ConstructedFromPxs)
                {
                    this.mIndex = this.mStoreColumnNo;
                }

                SetValueset();
                SetValuePool();
                SetPresText();
                SetDefaultPresTextOption(); // would be overwritten if options set in pxs
                if (this.meta.ConstructedFromPxs)
                {
                    SetOptionsFromPxs();
                }

                if (this.meta.inSelectionModus)
                {
                    this.groupingInfos = new PXSqlGroupingInfos(this.meta, this.Name, valusetIds);
                }
            }
            else
            {
                SetValueset();
            }
            //  Elimination must be done after SetValues moved down.
            //   if (this.meta.InstanceModus == Instancemodus.selection)
            //       SetElimForSelection();
            //   else
            //       SetElimForPresentation();



            if (this.aggregationType.Equals("G"))
            {
                if (String.IsNullOrEmpty(this.aggregatingStructureId))
                {
                    throw new ApplicationException("Not implemented yet");
                }
                else if (this.aggregatingStructureId.Equals("UNKNOWNSTRUCTUREID"))
                {
                    List <PXSqlGroup> groupFromFile = GetListOfGroupFromPxs();

                    currentGrouping = new PXSqlGrouping(this.meta, this, groupFromFile);
                }
                else
                {
                    currentGrouping = new PXSqlGrouping(this.metaQuery.GetGroupingRow(this.aggregatingStructureId), this.meta, this, this.pxsQueryVariable.GetCodesNoWildcards());
                }
            }
            else
            {
                SetValues();
                SetCodelists();
            }
            if (this.meta.inSelectionModus)
            {
                SetElimForSelection();
            }
            else
            {
                SetElimForPresentation();
            }
        }
コード例 #26
0
ファイル: PXSqlContact.cs プロジェクト: trygu/PxWeb
        /// <summary>
        /// Builds the Contactstring for each language in meta.LanguageCodes.
        /// </summary>
        public PXSqlContact(PXSqlMeta_22 meta, string mMainTableId)
        {
            foreach (string language in meta.LanguageCodes)
            {
                mBigFatContactStringsByLanguage.Add(language, "");
            }

            try
            {
                Dictionary <string, MainTablePersonRow> personIDs = new Dictionary <string, MainTablePersonRow>();
                try
                {
                    foreach (KeyValuePair <string, MainTablePersonRow> RoleHead in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleHead, false))
                    {
                        if (!personIDs.ContainsKey(RoleHead.Key))
                        {
                            personIDs.Add(RoleHead.Key, RoleHead.Value);
                        }
                    }
                } catch (Exceptions.PCAxisSqlException e)
                {
                    log.Error("Cant add RoleHead", e);
                }

                try
                {
                    foreach (KeyValuePair <string, MainTablePersonRow> RoleContact in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleContact, false))
                    {
                        if (!personIDs.ContainsKey(RoleContact.Key))
                        {
                            personIDs.Add(RoleContact.Key, RoleContact.Value);
                        }
                    }
                } catch (Exceptions.PCAxisSqlException e)
                {
                    log.Error("Cant add RoleContact", e);
                }



                bool firstPerson = true;
                foreach (string personId in personIDs.Keys)
                {
                    PersonRow person = meta.MetaQuery.GetPersonRow(personId);

                    if (!orgs.ContainsKey(person.OrganizationCode))
                    {
                        orgs.Add(person.OrganizationCode, meta.MetaQuery.GetOrganizationRow(person.OrganizationCode));
                    }
                    OrganizationRow org = orgs[person.OrganizationCode];

                    foreach (string language in meta.LanguageCodes)
                    {
                        if (!firstPerson)
                        {
                            mBigFatContactStringsByLanguage[language] += "#";
                        }
                        // mBigFatContactStringsByLanguage[language] += person.Forename + " " + person.Surname +
                        //    "," + org.texts[language].OrganizationName + "," + person.PhonePrefix + " " + person.PhoneNo +
                        //    "," + person.PhonePrefix + " " + person.FaxNo + "," + person.Email;



                        mBigFatContactStringsByLanguage[language] += person.Forename + " " + person.Surname + ", " + org.texts[language].OrganizationName +
                                                                     "# " + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactPhone", language) + ": " + person.PhonePrefix + " " + person.PhoneNo +
                                                                     "#" + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactFax", language) + ": " + person.PhonePrefix + " " + person.FaxNo +
                                                                     "#" + PCAxis.Paxiom.Localization.PxResourceManager.GetResourceManager().GetString("PxcContactEMail", language) + ": " + person.Email;
                    }

                    firstPerson = false;
                }
            } catch (Exceptions.PCAxisSqlException e)
            {
                log.Error("Cant find contact info", e);
            }
        }
コード例 #27
0
 public PXSqlVariables(PXSqlMeta_22 meta)
 {
     this.meta = meta;
 }
コード例 #28
0
 /// <summary>
 /// Receives the data and stores it.
 /// </summary>
 /// <param name="inDataNoteCellEntries">the data</param>
 public PXSqlParseMetaPostData_22(Dictionary <string, string> inDataNoteCellEntries, PCAxis.Sql.Parser_22.PXSqlMeta_22 meta)
 {
     theDataNoteCellEntries = inDataNoteCellEntries;
     mMeta = meta;
 }
コード例 #29
0
ファイル: PXSqlSubTables.cs プロジェクト: trygu/PxWeb
        public PXSqlSubTables(Dictionary <string, SubTableRow> altIBasen, PxsQuery pPxsQuery, PXSqlMeta_22 pxsqlMeta)
            : base()
        {
            this.mPxsQuery = pPxsQuery;
            PXSqlSubTable mSubTable;

            foreach (SubTableRow subTableRow in altIBasen.Values)
            {
                mSubTable = new PXSqlSubTable(subTableRow);
                this.Add(mSubTable.SubTable, mSubTable);
            }
            // set selected subtables.
            if (pPxsQuery == null)
            {
                foreach (PXSqlSubTable subTable in this.Values)
                {
                    subTable.IsSelected = true;
                }
            }
            else
            {
                SetSelectedSubTable(pxsqlMeta);
            }
        }
コード例 #30
0
 /// <summary>
 /// IDisposable implemenatation
 /// </summary>
 override public void Dispose()
 {
     mPXSqlMeta = null;
 }