Пример #1
0
        private TimeSeriesDatabaseDataSet.SeriesCatalogDataTable GetChildrenRows(PiscesObject parent)
        {
            if (Filter.Trim() == "")
            {
                string sql = "select * from seriescatalog where parentid = " + parent.ID + " and  id <> " + parent.ID + " order by sortorder";
                var    tbl = new TimeSeriesDatabaseDataSet.SeriesCatalogDataTable();
                m_server.FillTable(tbl, sql);
                return(tbl);
            }
            else
            {// filtered catalog
                var sc   = GetFilteredCatalog();
                var tbl  = new TimeSeriesDatabaseDataSet.SeriesCatalogDataTable();
                var rows = sc.Select("parentid=" + parent.ID + " and id <> parentid", "sortorder");

                foreach (var item in rows)
                {
                    var newRow = tbl.NewSeriesCatalogRow();
                    newRow.ItemArray = item.ItemArray;
                    tbl.Rows.Add(newRow);
                }
                tbl.AcceptChanges();
                return(tbl);
            }
        }
Пример #2
0
 protected PiscesObject()
 {
     catalog = new TimeSeriesDatabaseDataSet.SeriesCatalogDataTable();
     row     = catalog.NewSeriesCatalogRow();
     row.id  = -1;
     // Catalog.Rows.Add(row);
     // Console.WriteLine("PiscesObject()");
 }
Пример #3
0
 /// <summary>
 /// Creates a new SeriesRow and Assigns SiteDataTypeID
 /// </summary>
 /// <returns></returns>
 public SeriesCatalogRow GetNewSeriesRow(bool assignID = true)
 {
     var tbl = new TimeSeriesDatabaseDataSet.SeriesCatalogDataTable();
     var rval = tbl.NewSeriesCatalogRow();
     rval.id = NextSDI();
     rval.enabled = 1;
     tbl.Rows.Add(rval);
     return rval;
 }
Пример #4
0
        private TimeSeriesDatabaseDataSet.SeriesCatalogDataTable GetChildrenRows(PiscesObject parent)
        {
            if (Filter.Trim() == "")
            {
                string sql = "select * from seriescatalog where parentid = " + parent.ID + " and  id <> " + parent.ID + " order by sortorder";
                var tbl = new TimeSeriesDatabaseDataSet.SeriesCatalogDataTable();
                m_server.FillTable(tbl, sql);
                return tbl;
            }
            else
            {// filtered catalog

                var sc = GetFilteredCatalog();
                var tbl = new TimeSeriesDatabaseDataSet.SeriesCatalogDataTable();
                var rows = sc.Select("parentid=" + parent.ID+ " and id <> parentid","sortorder");

                foreach (var item in rows)
                {
                    var newRow = tbl.NewSeriesCatalogRow();
                    newRow.ItemArray = item.ItemArray;
                    tbl.Rows.Add(newRow);
                }
                tbl.AcceptChanges();
                return tbl;
            }
        }