Beispiel #1
0
        public static DataTable GetListData(String[] macroIDs, MacroDataType type)
        {
            DataTable               table  = new DataTable();
            DataTransmission        item   = null;
            List <DataTransmission> dtList = null;

            try
            {
                item         = new DataTransmission();
                item.Filters = new List <Expression>(2);
                item.Filters.Add(Expression.In("STR_MACROID", macroIDs));
                item.Filters.Add(Expression.Eq("STR_FLAG", "0"));
                item.DataSource = MongoDBConstant.DicTreeSource[type];
                item.MaxResult  = 0x7fffffff;
                item.Fields     = new String[] { "STR_MACROID", "STR_STARTDATE", "STR_ENDDATE", "STR_GXDATE" };
                dtList          = new List <DataTransmission>(1);
                dtList.Add(item);
                table = _uniqueQuery.Query(dtList).Tables[0];
            }
            catch (Exception exception)
            {
                //EMLoggerHelper.Write(exception);
            }
            finally
            {
                if (item != null)
                {
                    if ((item.Fields != null) && (item.Fields.Length > 0))
                    {
                        Array.Clear(item.Fields, 0, item.Fields.Length);
                        item.Fields = null;
                    }
                    item.Clear();
                    item = null;
                }
                if (dtList != null)
                {
                    dtList.Clear();
                    dtList = null;
                }
            }
            return(table);
        }
Beispiel #2
0
        public static DataSet GetGivenFieldMacroData(FindIndicator queryContditon, String[] fields)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            DataSet set = new DataSet();
            List <DataTransmission> dtList = null;
            DataTransmission        item   = null;

            try
            {
                item           = new DataTransmission();
                item.MaxResult = 0x7fffffff;
                if ((fields != null) && (fields.Length > 0))
                {
                    item.Fields = fields;
                }
                item.Filters = GetFilterExpress(queryContditon);
                dtList       = new List <DataTransmission>();
                if (queryContditon.findRange == MacroDataType.All)
                {
                    item.DataSource = "EDB_MACRO_INDICATOR_TEST";
                    dtList.Add(item);
                    DataTransmission transmission2 = new DataTransmission();
                    transmission2.MaxResult  = 0x7fffffff;
                    transmission2.Fields     = fields;
                    transmission2.DataSource = "EDB_GLOBAL_INDICATOR_TEST";
                    transmission2.Filters    = item.Filters;
                    dtList.Add(transmission2);
                    DataTransmission transmission3 = new DataTransmission();
                    transmission3.MaxResult  = 0x7fffffff;
                    transmission3.Fields     = fields;
                    transmission3.DataSource = "EDB_INDUSTRY_INDICATOR_TEST";
                    transmission3.Filters    = item.Filters;
                    dtList.Add(transmission3);
                }
                else
                {
                    item.DataSource = MongoDBConstant.DicTreeSource[queryContditon.findRange];
                    dtList.Add(item);
                }
                set = _uniqueQuery.Query(dtList);
            }
            catch (Exception exception)
            {
                //EMLoggerHelper.Write(exception);
            }
            finally
            {
                stopwatch.Stop();
                //EMLoggerHelper.Write("搜索耗时{0}", new object[] { stopwatch.ElapsedMilliseconds });
                if (item != null)
                {
                    item.Clear();
                }
                if (dtList != null)
                {
                    dtList.Clear();
                }
            }
            return(set);
        }