示例#1
0
文件: FMainSG.cs 项目: andreyV512/rag
        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
文件: Tube.cs 项目: andreyV512/rag
        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.cs 项目: andreyV512/rag
 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.cs 项目: andreyV512/rag
 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
文件: Group.cs 项目: andreyV512/rag
        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
文件: Tube.cs 项目: andreyV512/rag
        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
文件: Tresh.cs 项目: andreyV512/rag
        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
文件: Group.cs 项目: andreyV512/rag
        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
文件: Tresh.cs 项目: andreyV512/rag
        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
文件: Tube.cs 项目: andreyV512/rag
 public DBKey(TypeSize.DBKey _parentKey, Int64 _Id)
     : base(_parentKey)
 {
     TubeId = _Id;
 }
示例#11
0
文件: Tresh.cs 项目: andreyV512/rag
 Tresh(TypeSize.DBKey _parentKey, int _Id, double _Val)
 {
     ownKey = new DBKey(_parentKey, _Id);
     Val    = _Val;
 }
示例#12
0
文件: Tresh.cs 项目: andreyV512/rag
 public DBKey(TypeSize.DBKey _parentKey, int _TreshId)
     : base(_parentKey)
 {
     TreshId = _TreshId;
 }
示例#13
0
文件: Group.cs 项目: andreyV512/rag
 public DBKey(TypeSize.DBKey _parentKey, string _Name)
     : base(_parentKey)
 {
     GroupName = _Name;
 }