Exemplo n.º 1
0
        public override void Add(string colname, object value)
        {
            colname = colname.ToLower();

            for (int level = 0; level < _datas.Count; level++)
            {
                Hashtable ht = null;
                if (_datas.Contains(level))
                {
                    if (_datas[level] == null)
                    {
                        ht            = new Hashtable();
                        _datas[level] = ht;
                    }
                    else
                    {
                        ht = _datas[level] as Hashtable;
                    }
                }

                if (ht != null)
                {
                    if (ht.Contains(colname))
                    {
                        ht[colname] = UFConvert.ToDouble(ht[colname]) + UFConvert.ToDouble(value);
                    }
                    else
                    {
                        ht[colname] = value;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public override void StartNext(int fromlevel)
        {
            if (fromlevel == _baselevel + 1)
            {
                Hashtable ht = _datas[fromlevel] as Hashtable;
                if (ht != null)
                {
                    for (int i = 0; i <= _baselevel; i++)
                    {
                        Hashtable httmp = _datas[i] as Hashtable;
                        foreach (string key in ht.Keys)
                        {
                            if (httmp.Contains(key))
                            {
                                httmp[key] = UFConvert.ToDouble(httmp[key]) + UFConvert.ToDouble(ht[key]);
                            }
                            else
                            {
                                httmp.Add(key, ht[key]);
                            }
                        }
                    }
                }
            }

            for (int i = fromlevel; i < _datas.Count; i++)
            {
                if (_datas[i] != null)
                {
                    (_datas[i] as Hashtable).Clear();
                }
            }
        }