Ejemplo n.º 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;
     }
 }
Ejemplo n.º 2
0
        public int CompareTo(object obj)
        {
            //if (this.GetType() != obj.GetType())
            //{
            //    throw new PCAxis.Sql.Exceptions.BugException(10000);
            //}
            //else
            {
                PXSqlVariable SqlVariableCompare = (PXSqlVariable)obj;
                return(this.Index.CompareTo(SqlVariableCompare.Index));   //will not compare time-,classification and contens
                // return ((PXSqlVariable)this).Index.CompareTo(SqlVariableCompare.Index);

                /*if (this.Index == sqlVariableCompare.Index)
                 * {
                 *  return(0);
                 * }
                 * else if(this.Index > sqlVariableCompare.Index)
                 * {
                 *  return(1);
                 * }
                 * else if (this.Index < sqlVariableCompare.Index)
                 * {
                 *  return(-1);
                 * }
                 * else
                 * {
                 *  return(-1);
                 * }
                 */
            }
        }
Ejemplo n.º 3
0
        private List <PXSqlValue> GetValuesForParsingWhenSelection()
        {
            PXSqlVariable     var            = variable;
            List <PXSqlValue> tempValuesList = new List <PXSqlValue>();

            if (this.isHierarchy)
            {
                tempValuesList = GetHierarchicalValues(rootGroup, tempValuesList);
            }
            else
            {
                if (this.mIncludeType == GroupingIncludesType.AggregatedValues)
                {
                    foreach (PXSqlGroup group in this.mGroups)
                    {
                        tempValuesList.Add(var.Values[group.ParentCode]);   //todo; sortert etter gruppe sorteringskode
                    }
                }
                else if (this.mIncludeType == GroupingIncludesType.SingleValues)
                {
                    foreach (PXSqlGroup group in this.mGroups)
                    {
                        foreach (string childCode in group.ChildCodes)
                        {
                            tempValuesList.Add(var.Values[childCode]);   //todo; sortert etter gruppe sorteringskode
                        }
                    }
                }
                else if (this.IncludeType == GroupingIncludesType.All)
                {
                    foreach (PXSqlGroup group in this.mGroups)
                    {
                        tempValuesList.Add(var.Values[group.ParentCode]);   //todo; sortert etter gruppe sorteringskode
                        foreach (string childCode in group.ChildCodes)
                        {
                            tempValuesList.Add(var.Values[childCode]);   //todo; sortert etter gruppe sorteringskode
                        }
                    }
                }
                //tempValuesList.Sort(PXSqlValue.SortByVsValue());


                //TODO; Hvorfor hadde Linja under en   if ( this.meta.MetaQuery.metaVersionLE("2.1")) { rundt seg
                tempValuesList.Sort(PXSqlValue.SortByValue());
            }

            return(tempValuesList);
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
0
        public int CompareTo(object obj)

        {
            PXSqlVariable SqlVariableCompare = (PXSqlVariable)obj;

            // return this.Index.CompareTo(SqlVariableCompare.Index);   //will not compare time-,classification and contens
            if (this.Index == SqlVariableCompare.Index)
            {
                return(0);
            }
            else if (this.Index > SqlVariableCompare.Index)
            {
                return(1);
            }
            else if (this.Index < SqlVariableCompare.Index)
            {
                return(-1);
            }
            else
            {
                return(-1);
            }
        }