Esempio n. 1
0
        public static void LoadKey(BaseDBKey _Key, BindingSource _bs)
        {
            _bs.Clear();
            if (_Key == null)
            {
                return;
            }
            TypeSize.DBKey Key = _Key as TypeSize.DBKey;
            Select         S   = new Select(string.Format("SELECT id, dt, name, sGroup, probability, SOP from {0}.SGTubes where typeSize='{1}' order by id desc",
                                                          BaseItem.Schema, Key.TSName));

            while (S.Read())
            {
                object oMetric = S["probability"];
                _bs.Add(new Tube(
                            Key,
                            (Int64)S["id"],
                            (DateTime)S["dt"],
                            S["name"] as string,
                            S["sGroup"] as string,
                            oMetric.GetType() == typeof(Single) ? Convert.ToDouble(oMetric) : 0,
                            S["SOP"] as string
                            ));
            }
            S.Dispose();
        }
Esempio n. 2
0
        public static bool InsertKey(BaseDBKey _Key, BindingSource _bs)
        {
            string new_name = FindNewName(_bs);

            if (new ExecSQLX(string.Format("insert into {0}.SGTypeSizes values('{1}')", BaseItem.Schema, new_name)).Exec() == 1)
            {
                _bs.Position = _bs.Add(new TypeSize(new_name));
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        public static bool InsertKey(BaseDBKey _Key, BindingSource _bs)
        {
            TypeSize.DBKey key      = _Key as TypeSize.DBKey;
            string         new_name = FindNewName(_bs);

            if (new ExecSQLX(string.Format("insert into {0}.SGroups (typeSize, name, color) values('{1}','{2}',3)", BaseItem.Schema, key.TSName, new_name, Color.Black.ToArgb())).Exec() == 1)
            {
                _bs.Position = _bs.Add(new Group(key, new_name, Color.Black, true));
                return(true);
            }
            return(false);
        }
Esempio n. 4
0
        public static void LoadKey(BaseDBKey _Key, BindingSource _bs)
        {
            Adjust();
            _bs.Clear();
            Select S = new Select(string.Format("SELECT * from {0}.SGTypeSizes order by name", BaseItem.Schema));

            while (S.Read())
            {
                _bs.Add(new TypeSize(S["name"] as string));
            }
            S.Dispose();
        }
Esempio n. 5
0
        public static bool InsertKey(BaseDBKey _Key, BindingSource _bs)
        {
            TypeSize.DBKey Key = _Key as TypeSize.DBKey;
            Select         S   = new Select(string.Format("insert into {0}.SGTubes (typeSize) output Inserted.id,inserted.dt values('{1}')",
                                                          BaseItem.Schema, Key.TSName));
            bool ret = S.Read();

            if (ret)
            {
                _bs.Position = _bs.Add(new Tube(Key, (Int64)S["id"], (DateTime)S["dt"], null, null, 0, null));
            }
            S.Dispose();
            return(ret);
        }
Esempio n. 6
0
        public static bool InsertKey(BaseDBKey _Key, BindingSource _bs)
        {
            Etalon.DBKey Key    = _Key as Etalon.DBKey;
            int          new_id = FindNewId(_bs);

            if (new ExecSQLX(string.Format("insert into {0}.SGEtalonPars values('{1}','{2}',{3},{4})",
                                           BaseItem.Schema, Key.TSName, Key.GroupName, Key.EtalonId.ToString(), new_id.ToString())).Exec() == 1)
            {
                _bs.Position = _bs.Add(new EtalonPars(Key, new_id, 0));
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 7
0
        public static bool InsertKey(BaseDBKey _Key, BindingSource _bs)
        {
            TypeSize.DBKey key    = _Key as TypeSize.DBKey;
            int            new_id = FindNewId(_bs);

            if (new ExecSQLX(string.Format("insert into {0}.SGTresh values('{1}',{2},0)",
                                           BaseItem.Schema, key.TSName, new_id.ToString())).Exec() == 1)
            {
                _bs.Position = _bs.Add(new Tresh(key, new_id, 0));
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 8
0
        public static bool InsertKey(BaseDBKey _Key, BindingSource _bs)
        {
            Tube.DBKey Key    = _Key as Tube.DBKey;
            int        new_id = FindNewId(_bs);

            if (new ExecSQLX(string.Format("insert into {0}.SGTubePars values({1},{2},0)",
                                           BaseItem.Schema, Key.TubeId.ToString(), new_id.ToString())).Exec() == 1)
            {
                _bs.Position = _bs.Add(new TubePars(Key, new_id, 0));
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 9
0
        public static void LoadKey(BaseDBKey _Key, BindingSource _bs)
        {
            _bs.Clear();
            if (_Key == null)
            {
                return;
            }
            TypeSize.DBKey Key = _Key as TypeSize.DBKey;
            Select         S   = new Select(string.Format("SELECT * from {0}.SGroups where typeSize='{1}' order by name", BaseItem.Schema, Key.TSName));

            while (S.Read())
            {
                _bs.Add(new Group(Key, S["name"] as string, Color.FromArgb((int)S["color"]), Convert.ToBoolean(S["IsOn"])));
            }
            S.Dispose();
        }
Esempio n. 10
0
        public static bool InsertKey(BaseDBKey _Key, BindingSource _bs)
        {
            if (_Key == null)
            {
                return(false);
            }
            Group.DBKey Key    = _Key as Group.DBKey;
            int         new_id = FindNewId(_bs);
            Select      S      = new Select(string.Format("insert into {0}.SGEtalons (typeSize,sGroup,id) output inserted.dt values('{1}','{2}',{3})",
                                                          BaseItem.Schema, Key.TSName, Key.GroupName, new_id.ToString()));
            bool ret = S.Read();

            if (ret)
            {
                _bs.Position = _bs.Add(new Etalon(Key, new_id, (DateTime)S["dt"], null, true));
            }
            S.Dispose();
            return(ret);
        }
Esempio n. 11
0
        public static void LoadKey(BaseDBKey _Key, BindingSource _bs)
        {
            _bs.Clear();
            if (_Key == null)
            {
                return;
            }
            Group.DBKey Key = _Key as Group.DBKey;
            Select      S   = new Select(string.Format("SELECT id, dt, sop, IsOn from {0}.SGEtalons where typeSize='{1}' and sGroup='{2}' order by id",
                                                       BaseItem.Schema,
                                                       Key.TSName,
                                                       Key.GroupName
                                                       ));

            while (S.Read())
            {
                _bs.Add(new Etalon(Key, (int)S["id"], (DateTime)S["dt"], S["SOP"] as string, Convert.ToBoolean(S["IsOn"])));
            }
            S.Dispose();
        }
Esempio n. 12
0
        public static void LoadKey(BaseDBKey _Key, BindingSource _bs)
        {
            _bs.Clear();
            if (_Key == null)
            {
                return;
            }
            Tube.DBKey Key = _Key as Tube.DBKey;
            _bs.Clear();
            Select S = new Select(string.Format("SELECT par, val from {0}.SGTubePars where tube_id={1} order by par",
                                                BaseItem.Schema,
                                                Key.TubeId
                                                ));

            while (S.Read())
            {
                _bs.Add(new TubePars(Key, (int)S["par"], SD(S["val"])));
            }
            S.Dispose();
        }
Esempio n. 13
0
        public static void LoadKey(BaseDBKey _Key, BindingSource _bs)
        {
            TypeSize.DBKey key = _Key as TypeSize.DBKey;
            if (key == null)
            {
                return;
            }
            _bs.Clear();
            double[] vals = ValsPercent(key.TSName);
            if (vals == null)
            {
                return;
            }
            int i = 0;

            foreach (double val in vals)
            {
                Tresh p = new Tresh(key, i++, val);
                _bs.Add(p);
            }
        }
Esempio n. 14
0
        public static void LoadKey(BaseDBKey _Key, BindingSource _bs)
        {
            _bs.Clear();
            if (_Key == null)
            {
                return;
            }
            Etalon.DBKey Key = _Key as Etalon.DBKey;
            _bs.Clear();
            Select S = new Select(string.Format("SELECT par, val from {0}.SGEtalonPars where typeSize='{1}' and sGroup='{2}' and etalon={3} order by par",
                                                BaseItem.Schema,
                                                Key.TSName,
                                                Key.GroupName,
                                                Key.EtalonId
                                                ));

            while (S.Read())
            {
                _bs.Add(new EtalonPars(Key, (int)S["par"], SD(S["val"])));
            }
            S.Dispose();
        }
Esempio n. 15
0
 public void RLoad(BaseDBKey _parentKey)
 {
     parentKey = _parentKey;
     RLoad();
 }