Пример #1
0
        internal PXSqlNpm(PXSqlMeta_23 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;
        }
Пример #2
0
        /// <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_23.ValuePoolRow inRow, PXSqlMeta_23 meta)
        {
            this.vpRow = inRow;

            if (this.ValueTextExists.Equals(meta.Config.Codes.ValueTextExistsN))
            {
                this.mValueTextOption = PXConstant.VALUETEXTOPTION_NOTEXT;
            }
            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;
                if (String.IsNullOrEmpty(mDomain[langCode]))
                {
                    mDomain[langCode] = vpRow.texts[langCode].ValuePoolAlias;
                }
            }
        }
Пример #3
0
        private void SetSelectedSubTable(PXSqlMeta_23 pxsqlMeta)
        {
            Boolean isEqualValueSet;

            foreach (KeyValuePair <string, PCAxis.Sql.Parser_23.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;
                }
            }
        }
Пример #4
0
        /// <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_23 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));
            }
        }
Пример #5
0
            public NPMCharacter(KeyValuePair <string, SpecialCharacterRow> myRow, PXSqlMeta_23 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;
                }
            }
Пример #6
0
        public PXSqlContent(ContentsRow row, PXSqlMeta_23 pxsqlMeta, SqlDbConfig_23 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;
                mNPMcharacterinMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineNPMCharacter;

                if (!(String.IsNullOrEmpty(mRow.PresMissingLine)))
                {
                    mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine);
                    mNPMcharacterinMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNNPMCharacter(mRow.PresMissingLine);
                }
                mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString();
            }
            #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows
        }
Пример #7
0
        // public PXSqlParser_23() { }


        public PXSqlParser_23(PXSqlMeta_23 inPXSqlMeta)
        {
            mPXSqlMeta = inPXSqlMeta;
            if (mPXSqlMeta.inPresentationModus)
            {
                symbols = mPXSqlMeta.mPxsqlNpm;
            }
        }
Пример #8
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_23 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);
            }
        }
Пример #9
0
        public void ParseMeta(IPXModelParser.MetaHandler handler, PXSqlMeta_23 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;
                }
            }
        }
Пример #10
0
        /// <summary>
        /// Receives the data and stores it.
        /// </summary>
        /// <param name="inDataNoteCellEntries">the data</param>
        internal PXSqlParseMetaPostData_23(Dictionary <string, string> inDataNoteCellEntries, Dictionary <string, StringCollection> attributeEntries, string defaultAttributes, PXSqlAttributes attributes, StringCollection languages, IEnumerable <PXSqlNpm.NPMCharacter> usedNPMCharacters, PXSqlMeta_23 meta)
        {
            theDataNoteCellEntries = inDataNoteCellEntries;
            this.defaultAttributes = defaultAttributes;
            this.attributeEntries  = attributeEntries;
            this.attributes        = attributes;
            this.languages         = languages;
            this.usedNPMCharacters = usedNPMCharacters;

            mMeta = meta;
        }
Пример #11
0
 public PXSqlVariableContents(String name, PXSqlMeta_23 meta)
     : base(name, meta, true, false, false)
 {
     mStoreColumnNo = -1;
     SetSelected();
     if (!meta.ConstructedFromPxs)
     {
         mIndex = mStoreColumnNo;
     }
     SetDefaultPresTextOption();
     SetPresText();
 }
Пример #12
0
        internal PXSqlMaintable(MainTableRow mtRow, DataStorageRow dataStorageRow, MenuSelectionRow menuSelectionRow, PXSqlMeta_23 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;
            }
        }
Пример #13
0
        //for selection or presentation with grouping id in from pxs
        public PXSqlGrouping(GroupingRow groupingRow, PXSqlMeta_23 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);
        }
Пример #14
0
        //protected Dictionary<string, StringCollection> _AttributesEntries;

        internal PXSqlAttributes(PXSqlMeta_23 meta)
        {
            this.mMeta           = meta;
            mAvailableAttributes = mMeta.MetaQuery.GetAttributeRows(meta.MainTable.MainTable, true);
            if (mAvailableAttributes.Count > 0)
            {
                mHasAttributes            = true;
                mSortedAttributes         = getAttributesSorted();
                mAllAttributesInOneColumn = CheckIfMoreAttributesInOneColumn();
                if (AllAttributesInOneColumn)
                {
                    mTheOneAndOnlyAttributeColumn = mAvailableAttributes.First().Value.AttributeColumn;
                }
            }
        }
Пример #15
0
 public PXSqlVariable(string name, PXSqlMeta_23 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;
 }
Пример #16
0
        //for presentation without grouping id in from pxs
        public PXSqlGrouping(PXSqlMeta_23 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);
        }
        //private bool mTableContainsMetaOnly;
        #endregion props


        #region  contructor
        public PXSqlVariableTime(MainTableVariableRow aTVRow, PXSqlMeta_23 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();
        }
Пример #18
0
        private void Init(GroupingRow groupingRow, PXSqlMeta_23 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;
            }
        }
Пример #19
0
        //     public PXSqlVariableClassification() { }


        public PXSqlVariableClassification(MainTableVariableRow aTVRow, PXSqlMeta_23 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();
            }

            SetMetaIdFromAllGroupings();

            if (this.meta.inSelectionModus)
            {
                SetElimForSelection();
            }
            else
            {
                SetElimForPresentation();
            }
        }
Пример #20
0
 /// <summary>
 /// IDisposable implemenatation
 /// </summary>
 override public void Dispose()
 {
     mPXSqlMeta = null;
 }
Пример #21
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_23(PXSqlMeta_23 inPXSqlMeta, String variableCode)
 {
     mPXSqlMeta = inPXSqlMeta;
     _variables = new List <PXSqlVariableClassification>();
     _variables.Add(inPXSqlMeta.VariablesClassification[variableCode]);
 }
Пример #22
0
        internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_23 meta, SqlDbConfig_23 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);
            }
        }
Пример #23
0
        public PXSqlSubTables(Dictionary <string, SubTableRow> altIBasen, PxsQuery pPxsQuery, PXSqlMeta_23 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);
            }
        }
Пример #24
0
        /// <summary>
        /// Builds the Contactstring for each language in meta.LanguageCodes.
        /// </summary>
        public PXSqlContact(PXSqlMeta_23 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> RoleMain in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleMain, false))
                    {
                        if (!personIDs.ContainsKey(RoleMain.Key))
                        {
                            personIDs.Add(RoleMain.Key, RoleMain.Value);
                        }
                    }
                } catch (Exceptions.PCAxisSqlException e)
                {
                    log.Error("Cant add RoleMain", e);
                }

                try
                {
                    foreach (KeyValuePair <string, MainTablePersonRow> RoleContact in meta.MetaQuery.GetMainTablePersonRows(mMainTableId, meta.Config.Codes.RoleContact, true))
                    {
                        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] += "||";
                        }



                        //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;

                        mBigFatContactStringsByLanguage[language] +=
                            person.Forename +
                            "#" + person.Surname +
                            "# " + person.PhonePrefix +
                            "#" + person.PhoneNo +
                            "#" + person.Email +
                            "#" + org.texts[language].OrganizationName +
                            "#" + org.texts[language].Department +
                            "#" + org.texts[language].Unit +
                            "||";
                    }

                    firstPerson = false;
                }
            } catch (Exceptions.PCAxisSqlException e)
            {
                log.Error("Cant find contact info", e);
            }
        }
Пример #25
0
 public PXSqlVariables(PXSqlMeta_23 meta)
 {
     this.meta = meta;
 }