Exemple #1
0
        public List <ISourceClass> GetSources()
        {
            if (_sources.Count == 0 && !_isLoadSrcs)
            {
                DataTable dt    = _oracleHelper.ExecuteDataTable("select * from user_source order by name,type,line");
                int       start = -1;
                int       end   = -1;
                string    temp  = null;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow item = dt.Rows[i];
                    if (temp == null)
                    {
                        temp  = Convert.ToString(item["NAME"]);
                        start = i;
                    }
                    else if (temp != Convert.ToString(item["NAME"]))
                    {
                        end = i - 1;

                        OracleSourceClass osc = new OracleSourceClass(dt, start, end);
                        _sources.Add(osc);

                        temp  = Convert.ToString(item["NAME"]);
                        start = i;
                    }
                    if (i == dt.Rows.Count - 1)
                    {
                        end = dt.Rows.Count - 1;
                        OracleSourceClass osc = new OracleSourceClass(dt, start, end);
                        _sources.Add(osc);
                    }
                }
                _isLoadSrcs = true;
            }
            List <ISourceClass> t = new List <ISourceClass>();

            t.AddRange(_sources);
            return(t);
        }
Exemple #2
0
        public List<ISourceClass> GetSources()
        {
            if (_sources.Count==0&&!_isLoadSrcs)
            {
                DataTable dt = _oracleHelper.ExecuteDataTable("select * from user_source order by name,type,line");
                int start = -1;
                int end = -1;
                string temp = null;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow item = dt.Rows[i];
                    if (temp == null)
                    {
                        temp = Convert.ToString(item["NAME"]);
                        start = i;
                    }
                    else if (temp != Convert.ToString(item["NAME"]))
                    {
                        end = i - 1;

                        OracleSourceClass osc = new OracleSourceClass(dt, start, end);
                        _sources.Add(osc);

                        temp = Convert.ToString(item["NAME"]);
                        start = i;
                    }
                    if (i==dt.Rows.Count-1)
                    {
                        end = dt.Rows.Count - 1;
                        OracleSourceClass osc = new OracleSourceClass(dt, start, end);
                        _sources.Add(osc);
                    }
                }
                _isLoadSrcs = true;
            }
            List<ISourceClass> t = new List<ISourceClass>();
            t.AddRange(_sources);
            return t;
        }