Пример #1
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);
            }
        }
Пример #2
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();
        }
Пример #3
0
 EtalonPars(Etalon.DBKey _parentKey, int _Id, double _Val)
 {
     ownKey = new DBKey(_parentKey, _Id);
     Val    = _Val;
 }
Пример #4
0
 public DBKey(Etalon.DBKey _parentKey, int _Id) : base(_parentKey)
 {
     EtalonParsId = _Id;
 }