コード例 #1
0
        internal PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(ContentsRow someContentsRow, PXSqlMeta_21 meta, SqlDbConfig_21 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);
            }
        }
コード例 #2
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
        }
コード例 #3
0
        private List <PXSqlContent> GetSortedContentsList(string mMainTableId, bool contructedFromPxs, BasicValueType[] contentsInPxs)
        {
            List <PXSqlContent> myOut = new List <PXSqlContent>();
            Dictionary <string, ContentsRow> altIBasen = mMetaQuery.GetContentsRows(mMainTableId, false);


            //side effect:
            ContentsRow someContentsRow = null;

            foreach (ContentsRow tmpRow in altIBasen.Values)
            { //just want any one of the rows
                someContentsRow = tmpRow;
                break;
            }

            couldHaveBeenByMainTableOnly = new PXSqlThingsThatWouldBeTheSameInAllPXSqlContent(someContentsRow, this, mConfig);

            PXSqlContact contact = new PXSqlContact(this, this.MainTable.MainTable);


            PXSqlContent mContent = null;

            if (this.ConstructedFromPxs)
            {
                int documentOrder = 0;
                foreach (BasicValueType contents in contentsInPxs)
                {
                    if (altIBasen.ContainsKey(contents.code))
                    {
                        mContent           = new PXSqlContent(altIBasen[contents.code], this, mConfig, contact);
                        mContent.SortOrder = documentOrder;
                        myOut.Add(mContent);
                        documentOrder++;
                    }
                }
            }
            else
            {
                foreach (KeyValuePair <string, ContentsRow> cont in altIBasen)
                {
                    mContent           = new PXSqlContent(cont.Value, this, mConfig, contact);
                    mContent.SortOrder = int.Parse(cont.Value.StoreColumnNo);
                    myOut.Add(mContent);
                }
            }

            if (myOut.Count < 1)
            {
                throw new ApplicationException("No contents to process");
            }
            myOut.Sort();
            return(myOut);
        }
コード例 #4
0
ファイル: myfilms.cs プロジェクト: GuzziMP/my-films
 public MovieRow AddMovieRow(
     int Number,
     string Checked,
     string MediaLabel,
     string MediaType,
     string Source,
     string Date,
     string Borrower,
     decimal Rating,
     decimal RatingUser,
     string OriginalTitle,
     string TranslatedTitle,
     string FormattedTitle,
     string Edition,
     string Director,
     string Producer,
     string Country,
     string Category,
     string Year,
     string Length,
     string Actors,
     string URL,
     string Description,
     string Comments,
     string VideoFormat,
     string VideoBitrate,
     string AudioFormat,
     string AudioBitrate,
     string Resolution,
     string Framerate,
     string Languages,
     string Subtitles,
     string Size,
     string Disks,
     string Picture,
     string Fanart,
     string Certification,
     string Writer,
     string Watched,
     System.DateTime DateWatched,
     string IMDB_Id,
     string TMDB_Id,
     string SourceTrailer,
     string TagLine,
     string Tags,
     string Studio,
     string IMDB_Rank,
     string IsOnline,
     string IsOnlineTrailer,
     string Aspectratio,
     ContentsRow parentContentsRowByContents_Movie)
 {
     MovieRow rowMovieRow = ((MovieRow)(this.NewRow()));
     object[] columnValuesArray = new object[] {
             Number,
             Checked,
             MediaLabel,
             MediaType,
             Source,
             Date,
             Borrower,
             Rating,
             RatingUser,
             OriginalTitle,
             TranslatedTitle,
             FormattedTitle,
             Edition,
             Director,
             Producer,
             Country,
             Category,
             Year,
             Length,
             Actors,
             URL,
             Description,
             Comments,
             VideoFormat,
             VideoBitrate,
             AudioFormat,
             AudioBitrate,
             Resolution,
             Framerate,
             Languages,
             null,
             Subtitles,
             Size,
             Disks,
             null,
             Picture,
             Fanart,
             Certification,
             Writer,
             Watched,
             DateWatched,
             IMDB_Id,
             TMDB_Id,
             SourceTrailer,
             TagLine,
             Tags,
             Studio,
             IMDB_Rank,
             IsOnline,
             IsOnlineTrailer,
             Aspectratio,
             null};
     if ((parentContentsRowByContents_Movie != null)) {
         columnValuesArray[51] = parentContentsRowByContents_Movie[0];
     }
     rowMovieRow.ItemArray = columnValuesArray;
     this.Rows.Add(rowMovieRow);
     return rowMovieRow;
 }
コード例 #5
0
ファイル: myfilms.cs プロジェクト: GuzziMP/my-films
 public ContentsRowChangeEvent(ContentsRow row, global::System.Data.DataRowAction action)
 {
     this.eventRow = row;
     this.eventAction = action;
 }
コード例 #6
0
ファイル: myfilms.cs プロジェクト: GuzziMP/my-films
 public void RemoveContentsRow(ContentsRow row)
 {
     this.Rows.Remove(row);
 }
コード例 #7
0
ファイル: myfilms.cs プロジェクト: GuzziMP/my-films
 public void AddContentsRow(ContentsRow row)
 {
     this.Rows.Add(row);
 }
コード例 #8
0
ファイル: PXSqlContent.cs プロジェクト: trygu/PxWeb
        public PXSqlContent(ContentsRow row, PXSqlMeta_21 pxsqlMeta, SqlDbConfig_21 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))
            {
                //for version 2.0 use default,
                // 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
                if (String.Compare(pxsqlMeta.MetaModelVersion, "2.0", false, System.Globalization.CultureInfo.InvariantCulture) > 0)
                {
                    mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DefaultCodeMissingLineMagic;
                    if (!(String.IsNullOrEmpty(mRow.PresMissingLine)))
                    {
                        mValueOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.DataSymbolNMagic(mRow.PresMissingLine);
                    }
                    mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString();
                }
                else
                {
                    // 2010.11.29 Changed There is no DefaultCodeMissinLine i 2.0.  Use the same symbol as DataNotAvialable
                    //mValueOfCellsInMissingRows = 0;
                    //mCategoryOfCellsInMissingRows = "3";
                    mValueOfCellsInMissingRows    = pxsqlMeta.mPxsqlNpm.DataNotAvailableMagic;
                    mCategoryOfCellsInMissingRows = pxsqlMeta.mPxsqlNpm.GetCategory(mValueOfCellsInMissingRows).ToString();
                }
            }
            #endregion mCategoryOfCellsInMissingRows and mValueOfCellsInMissingRows
        }