Пример #1
0
        private void FMain_Load(object sender, EventArgs e)
        {
//            new Execute("Uran.SGtubesLock").Exec();
            L_WindowLPars.CurrentWins.LoadFormRect(this);
            BaseItem.Schema = Schema;

            splitContainer1.SplitterDistance = ParAll.SG.Some.FMain_SplitterDistance;
            foreach (DGV p in splitContainer1.Panel1.Controls.OfType <DGV>())
            {
                p.LoadRectangle();
                p.CC    = splitContainer1.Panel1.Controls;
                p.OnPrs = prs;
            }

            ucGraph1.Schema = Schema;

            //TODO:
//            dgvTypeSize.AddButton("График", OnGraphCur);

            dgvGroup.OnCurrent += dgvEtalon.RLoad;
            dgvGroup.AddButton("Перерасчет", GroupRecalc);

            dgvEtalon.OnCurrent += dgvEtalonPars.RLoad;
            dgvEtalon.AddButton("Действия", OnExec);

            dgvTube.OnCurrent += dgvTubePars.RLoad;
            dgvTube.AddButton("Действия", OnExec);

            TypeSize.Adjust();
            TSKey = new TypeSize.DBKey(ParAll.CTS.Name);
            dgvTresh.RLoad(TSKey);
            dgvGroup.RLoad(TSKey);
            dgvTube.RLoad(TSKey);
        }
Пример #2
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();
        }
Пример #3
0
 Group(TypeSize.DBKey _parentKey, string _name, Color _color, bool _IsOn)
 {
     ownKey     = new DBKey(_parentKey, _name);
     saved_name = Name;
     RColor     = _color;
     IsOn       = _IsOn;
 }
Пример #4
0
 Tube(TypeSize.DBKey _parentKey, Int64 _Id, DateTime _Dt, string _Name, string _SG, double _Metric, string _SOP)
     : base(_parentKey.TSName)
 {
     ownKey = new DBKey(_parentKey, _Id);
     Dt     = _Dt;
     Name   = _Name;
     SG     = _SG;
     Metric = _Metric;
     SOP    = _SOP;
 }
Пример #5
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);
        }
Пример #6
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);
        }
Пример #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);
            }
        }
Пример #8
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();
        }
Пример #9
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);
            }
        }
Пример #10
0
 public DBKey(TypeSize.DBKey _parentKey, Int64 _Id)
     : base(_parentKey)
 {
     TubeId = _Id;
 }
Пример #11
0
 Tresh(TypeSize.DBKey _parentKey, int _Id, double _Val)
 {
     ownKey = new DBKey(_parentKey, _Id);
     Val    = _Val;
 }
Пример #12
0
 public DBKey(TypeSize.DBKey _parentKey, int _TreshId)
     : base(_parentKey)
 {
     TreshId = _TreshId;
 }
Пример #13
0
 public DBKey(TypeSize.DBKey _parentKey, string _Name)
     : base(_parentKey)
 {
     GroupName = _Name;
 }