Esempio n. 1
0
 private void OnRetrieveOverviewData(TSGetOverviewDataEventArgs e)
 {
     if (RetrieveOverviewDataEvent != null)
     {
         RetrieveOverviewDataEvent(this, e);
     }
 }
Esempio n. 2
0
        public virtual DataTable RetrieveOverviewData(object tag)
        {
            mTag         = tag;
            mbHasSumLine = false;
            mlstQueriedFields.Clear();

            TSGetDataEventArgs argsSchema = new TSGetDataEventArgs(tag);

            OnRetrieveSchemaData(argsSchema);
            DataTable dtSchema = argsSchema.ReturnTable;

            if (dtSchema != null)
            {
                TSGetOverviewDataEventArgs argsOverview = new TSGetOverviewDataEventArgs(dtSchema, tag);
                OnRetrieveOverviewData(argsOverview);
                DataTable dtOverview = argsOverview.ReturnTable;

                if (dtOverview != null)
                {
                    for (int i = 0, j = dtSchema.Columns.Count; i < j; i++)
                    {
                        string strColName = dtSchema.Columns[i].ColumnName;
                        if (!dtOverview.Columns.Contains(strColName))
                        {
                            dtOverview.Columns.Add(strColName, dtSchema.Columns[i].DataType);
                        }
                    }

                    for (int i = 0, j = dtSchema.Columns.Count; i < j; i++)
                    {
                        string strColName = dtSchema.Columns[i].ColumnName;
                        dtOverview.Columns[strColName].SetOrdinal(i);

                        if (!mlstQueriedFields.Contains(strColName))
                        {
                            mlstQueriedFields.Add(strColName);
                        }
                    }

                    mdtSource = dtOverview;
                    mRange.ResetRange(mdtSource.Rows.Count - 1);
                    mlstRemovedRows.Clear();
                }
            }

            return(mdtSource);
        }