Exemple #1
0
        public DataSetConfig put(string dsName, DataSetConfig config)
        {
            DataSetConfig config2 = null;
            int           num     = 0;

            while (true)
            {
                if (num >= this.arrayList_0.Count)
                {
                    break;
                }
                if (this.arrayList_0[num].ToString().ToUpper().Equals(dsName.ToUpper()))
                {
                    config2 = (DataSetConfig)this.arrayList_2[num];
                    this.arrayList_2[num] = config;
                    break;
                }
                num++;
            }
            if (num == this.arrayList_0.Count)
            {
                this.arrayList_2.Add(config);
                this.arrayList_0.Add(dsName);
            }
            return(config2);
        }
Exemple #2
0
        public DataSetConfigs(string cfgStr)
        {
            ArgToken token = new ArgToken(cfgStr, ';');
            int      num   = token.countTokens();

            if ((cfgStr == null) || (cfgStr.Trim().Length == 0))
            {
                num = 0;
            }
            this.arrayList_2 = new ArrayList(num);
            this.arrayList_1 = new ArrayList();
            this.arrayList_0 = new ArrayList(num);
            if ((cfgStr != null) && (cfgStr.Trim().Length != 0))
            {
                while (token.hasNext())
                {
                    string configString = token.next();
                    if ((configString != null) && (configString.Trim().Length != 0))
                    {
                        DataSetConfig config = new DataSetConfig(configString);
                        this.arrayList_2.Add(config);
                        string name = config.Name;
                        if ((name != null) && (name.Trim().Length > 0))
                        {
                            this.arrayList_0.Add(config.Name);
                        }
                        string dataSourceName = config.DataSourceName;
                        if ((dataSourceName == null) && (config.SQLType != 8))
                        {
                            dataSourceName = "";
                        }
                        if ((dataSourceName != null) && (this.arrayList_1.IndexOf(dataSourceName) < 0))
                        {
                            this.arrayList_1.Add(dataSourceName);
                        }
                    }
                }
            }
        }
Exemple #3
0
        public static DataSet calcDataSet(Env env, DataSetConfig dsc, CellExt1 ecs)
        {
            DataSet   set;
            Hashtable hashtable2;

            if (dsc == null)
            {
                return(null);
            }
            switch (dsc.SQLType)
            {
            case 7:
                break;

            case 8:
                goto Label_0179;

            default:
            {
                Hashtable hashtable = new Hashtable();
                hashtable["dsc"] = dsc;
                hashtable["ecs"] = ecs;
                SQLDataSetFactory factory = new SQLDataSetFactory {
                    Properties = hashtable
                };
                try
                {
                    return(factory.getDataSet(env));
                }
                catch (ReportError error)
                {
                    throw error;
                }
                catch (Exception exception)
                {
                    throw new ReportError(exception.Message, exception);
                }
                break;
            }
            }
            UnitSet        set5       = new UnitSet(dsc.SQL, ';');
            string         s          = Escape.removeEscAndQuote(set5["args"]);
            string         str5       = Escape.removeEscAndQuote(set5["class"]);
            DataSetFactory factory3   = new XMLDataSetFactory();
            ArgToken       token      = new ArgToken(s, ';');
            Hashtable      collection = new Hashtable();

            while (token.hasMoreTokens())
            {
                string str   = token.nextToken();
                int    index = str.IndexOf(",");
                if (index > 0)
                {
                    string   expStr = Escape.unescape(str.Substring(index + 1, str.Length - (index + 1)));
                    ExpParse parse  = new ExpParse(ecs, expStr);
                    SupportClass.PutElement(collection, str.Substring(0, index), ConvertTool.getValue(parse.calculate()));
                }
            }
            factory3.Properties = collection;
            try
            {
                return(factory3.getDataSet(env));
            }
            catch (Exception exception3)
            {
                throw new ReportError(exception3.Message, exception3);
            }
Label_0179:
            hashtable2 = new Hashtable();
            hashtable2.Add("dsc", dsc);
            BuildinDataSetFactory factory2 = new BuildinDataSetFactory {
                Properties = hashtable2
            };

            try
            {
                set = factory2.getDataSet(env);
            }
            catch (Exception exception2)
            {
                throw new ReportError(exception2.Message, exception2);
            }
            return(set);
        }
Exemple #4
0
 public static DataSet calcDataSet(Env env, DataSetConfig dsc)
 {
     return(calcDataSet(env, dsc, new CellExt1(env)));
 }
Exemple #5
0
 public DataSetConfig put(DataSetConfig config)
 {
     return(this.put(config.Name, config));
 }