예제 #1
0
 private void SetVariables()
 {
     //mVariables = new Dictionary<string, PXSqlVariable>();
     mVariables = new PXSqlVariables(this);
     mVariablesClassification = new PXSqlVariablesClassification();
     // Get all the variables connected to the selected maintable
     foreach (MainTableVariableRow aTVRow in mMetaQuery.GetMainTableVariableRows(mMainTableId))
     {
         if (aTVRow.VariableType == mConfig.Codes.VariableTypeT)
         {
             mTimeVariable = new PXSqlVariableTime(aTVRow, this);
             mSqlVariable  = mTimeVariable;
             mVariables.Add(mSqlVariable.Name, mSqlVariable);
         }
         else
         { // Should be changed so that variabletype is set separate.
             if (!mVariables.ContainsKey(aTVRow.Variable))
             {
                 mSqlVariable = new PXSqlVariableClassification(aTVRow, this);
                 mVariablesClassification.Add(mSqlVariable.Name, (PXSqlVariableClassification)mSqlVariable);
                 mVariables.Add(mSqlVariable.Name, mSqlVariable);
             }
         }
         mSqlVariable.VariableType = aTVRow.VariableType;
     }
 }
예제 #2
0
        private void SetContents()
        {
            BasicValueType[] contentsInPxs = new BasicValueType[0];
            if (this.ConstructedFromPxs)
            {
                contentsInPxs = mPxsFile.Query.Contents.Content;
            }
            List <PXSqlContent> mTempContentsList = GetSortedContentsList(mMainTableId, this.ConstructedFromPxs, contentsInPxs);

            mFirstContents = mTempContentsList[0].Contents;



            this.mContents = new Dictionary <string, PXSqlContent>();
            foreach (PXSqlContent sortedCont in mTempContentsList)
            {
                sortedCont.AdjustPresDecimalsToCommonDecimals(this.mDecimalHandler.ShowDecimals);
                mContents.Add(sortedCont.Contents, sortedCont);
            }



            PxSqlValues mValues = new PxSqlValues();
            int         counter = 0;

            foreach (PXSqlContent content in mContents.Values)
            {
                mValue = new PXSqlValue(content, counter);
                mValues.Add(mValue.ValueCode, mValue);
                counter++;
            }


            mSqlVariable        = new PXSqlVariableContents(mContVariableCode, this);
            mSqlVariable.Values = mValues;

            mVariables.Add(mSqlVariable.Name, mSqlVariable);
            mContentsVariable = mSqlVariable;
        }