示例#1
0
        public void ReadMethodInfo(string _methodName)
        {
            BLL.ControlMethod_B   bllts_B = new HR_Test.BLL.ControlMethod_B();
            Model.ControlMethod_B mb      = bllts_B.GetModel(_methodName);
            if (mb != null)
            {
                _sendCompany     = mb.sendCompany;
                _hotStatus       = mb.hotStatus;
                _condition       = mb.condition;
                _controlMode     = mb.controlmode;
                _temperature     = mb.temperature.ToString();
                _humidity        = mb.humidity.ToString();
                _sampleCharacter = mb.sampleCharacter;

                this._b_a  = (double)mb.a;
                this._b_Da = (double)mb.Da;
                this._b_Ds = (double)mb.Ds;
                this._b_m  = (int)mb.m;
                this._b_n  = (double)mb.n;
                this._b_R  = (double)mb.R;

                this.b_stuffCardNo.Text   = mb.stuffCardNo;
                this.b_stuffSpec.Text     = mb.stuffSpec;
                this.b_stuffType.Text     = mb.stuffType;
                this._testStandard_B.Text = mb.testStandard;
                this.b_sign.Text          = mb.sign;
                this.b_getSample.Text     = mb.getSample;
                this.b_mathineType.Text   = mb.mathineType;
                this.b_tester.Text        = mb.tester;
                this.b_testMethod.Text    = mb.testMethod;
                this.cmbBendType.Text     = mb.testType;
                this.b_Ls.Text            = mb.Ls.ToString();
                this.b_ll.Text            = mb.l_l.ToString();
                this.b_Le.Text            = mb.Le.ToString();
                this.b_εpb.Text           = mb.εpb.ToString();
                this.b_εrb.Text           = mb.εrb.ToString();
            }
        }
示例#2
0
        //async Task tskReadMethod()
        //{
        //    var t = Task<List<TreeNode>>.Run(() =>
        //    {
        //        return TestStandard.MethodControl.ReadMethodList();
        //    });
        //    await t;
        //    this.tvTestMethod.Nodes.Clear();
        //    this.tvTestMethod.Nodes.Add("试验方法");
        //    if (t.Result != null)
        //    {
        //        List<TreeNode> lsttn = (List<TreeNode>)t.Result;
        //        foreach (TreeNode tn in lsttn)
        //            this.tvTestMethod.Nodes[0].Nodes.Add(tn);
        //    }
        //    this.tvTestMethod.ExpandAll();
        //}

        private void gBtnAddToMethod3_Click(object sender, EventArgs e)
        {
            string strErr = "";


            if (this._sendCompany.Trim().Length == 0)
            {
                strErr += "送检单位不能为空!\r\n\r\n";
            }
            if (this.b_stuffCardNo.Text.Trim().Length == 0)
            {
                strErr += "材料牌号不能为空!\r\n\r\n";
            }
            if (this.b_stuffSpec.Text.Trim().Length == 0)
            {
                strErr += "材料规格不能为空!\r\n\r\n";
            }
            if (this.b_stuffType.Text.Trim().Length == 0)
            {
                strErr += "材料类型不能为空!\r\n\r\n";
            }

            if (this._temperature.Trim().Length == 0)
            {
                strErr += "试验温度不能为空!\r\n\r\n";
            }

            if (this.b_testMethod.Text.Trim().Length == 0)
            {
                strErr += "试验方法不能为空!\r\n\r\n";
            }

            if (this._sampleCharacter.Trim().Length == 0)
            {
                strErr += "试样标识不能为空!\r\n\r\n";
            }

            if (this._condition.Trim().Length == 0)
            {
                strErr += "试验条件不能为空!\r\n\r\n";
            }

            if (this._controlMode.Trim().Length == 0)
            {
                strErr += "控制方式不能为空!\r\n\r\n";
            }

            if (this.b_getSample.Text.Trim().Length == 0)
            {
                strErr += "试样取样不能为空!\r\n\r\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            BLL.ControlMethod_B           bllcm_B = new HR_Test.BLL.ControlMethod_B();
            HR_Test.Model.ControlMethod_B model   = bllcm_B.GetModel(this.b_testMethod.Text);

            model.sendCompany     = this._sendCompany;
            model.stuffCardNo     = this.b_stuffCardNo.Text;
            model.stuffSpec       = b_stuffSpec.Text;
            model.stuffType       = b_stuffType.Text;
            model.hotStatus       = this._hotStatus;
            model.temperature     = double.Parse(this._temperature);
            model.humidity        = double.Parse(this._humidity);
            model.testStandard    = this._testStandard_B.Text;
            model.testMethod      = b_testMethod.Text;
            model.mathineType     = b_mathineType.Text;
            model.testCondition   = "";
            model.sampleCharacter = this._sampleCharacter;
            model.getSample       = b_getSample.Text;
            model.tester          = b_tester.Text;
            model.condition       = this._condition;
            model.controlmode     = this._controlMode;
            model.assessor        = "";
            model.sign            = this.b_sign.Text;

            model.testType = this.cmbBendType.Text;
            model.Ds       = this._b_Ds;
            model.Da       = this._b_Da;
            model.R        = this._b_R;
            model.Ls       = Convert.ToDouble(this.b_Ls.Text.Trim());
            model.Le       = Convert.ToDouble(this.b_Le.Text.Trim());
            model.l_l      = Convert.ToDouble(this.b_ll.Text.Trim());
            model.m        = this._b_m;
            model.n        = Convert.ToDouble(this.b_n.Text.Trim());
            model.a        = this._b_a;
            model.εpb      = Convert.ToDouble(this.b_εpb.Text.Trim());
            model.εrb      = Convert.ToDouble(this.b_εrb.Text.Trim());


            if (bllcm_B.Update(model))
            {
                MessageBox.Show(this, "更新试验方法基本参数成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#3
0
        public static List <TreeNode> ReadMethodList()
        {
            //tv.Nodes.Clear();
            //tv.Nodes.Add("试验方法");
            List <TreeNode> lstTn = new List <TreeNode>();

            BLL.GBT236152009_Method bll23615 = new HR_Test.BLL.GBT236152009_Method();
            DataSet ds23615 = bll23615.GetAllList();

            for (int k = 0; k < ds23615.Tables[0].Rows.Count; k++)
            {
                TreeNode tn = new TreeNode();
                tn.Tag  = "GB/T 23615.1-2009";
                tn.Text = ds23615.Tables[0].Rows[k]["methodName"].ToString();
                tn.Name = ds23615.Tables[0].Rows[k]["xmlPath"].ToString();
                lstTn.Add(tn);
            }

            BLL.GBT282892012_Method bll28289 = new HR_Test.BLL.GBT282892012_Method();
            DataSet ds28289 = bll28289.GetAllList();

            for (int k = 0; k < ds28289.Tables[0].Rows.Count; k++)
            {
                TreeNode tn = new TreeNode();
                tn.Tag  = "GB/T 28289-2012";// ds28289.Tables[0].Rows[k]["testStandard"].ToString();
                tn.Text = ds28289.Tables[0].Rows[k]["methodName"].ToString();
                tn.Name = ds28289.Tables[0].Rows[k]["xmlPath"].ToString();
                lstTn.Add(tn);
            }

            BLL.ControlMethod bllCm = new HR_Test.BLL.ControlMethod();
            DataSet           ds    = bllCm.GetAllList();

            for (int k = 0; k < ds.Tables[0].Rows.Count; k++)
            {
                TreeNode tn = new TreeNode();
                tn.Tag  = "GB/T 228-2010";// ds.Tables[0].Rows[k]["testStandard"].ToString();
                tn.Text = ds.Tables[0].Rows[k]["methodName"].ToString();
                tn.Name = ds.Tables[0].Rows[k]["xmlPath"].ToString();
                lstTn.Add(tn);
            }

            BLL.ControlMethod_C bllCm_C = new HR_Test.BLL.ControlMethod_C();
            DataSet             ds_C    = bllCm_C.GetAllList();

            for (int k = 0; k < ds_C.Tables[0].Rows.Count; k++)
            {
                TreeNode tn = new TreeNode();
                tn.Tag  = "GB/T 7314-2005";//ds_C.Tables[0].Rows[k]["testStandard"].ToString();
                tn.Text = ds_C.Tables[0].Rows[k]["methodName"].ToString();
                tn.Name = ds_C.Tables[0].Rows[k]["xmlPath"].ToString();
                lstTn.Add(tn);
            }
            BLL.ControlMethod_B bllCm_B = new HR_Test.BLL.ControlMethod_B();
            DataSet             ds_B    = bllCm_B.GetAllList();

            for (int k = 0; k < ds_B.Tables[0].Rows.Count; k++)
            {
                TreeNode tn = new TreeNode();
                tn.Tag  = "YB/T 5349-2006";// ds_B.Tables[0].Rows[k]["testStandard"].ToString();
                tn.Text = ds_B.Tables[0].Rows[k]["methodName"].ToString();
                tn.Name = ds_B.Tables[0].Rows[k]["xmlPath"].ToString();
                lstTn.Add(tn);
            }
            BLL.GBT3354_Method bll3354 = new HR_Test.BLL.GBT3354_Method();
            DataSet            ds3354  = bll3354.GetAllList();

            for (int k = 0; k < ds3354.Tables[0].Rows.Count; k++)
            {
                TreeNode tn = new TreeNode();
                tn.Tag  = "GB/T 3354-2014";
                tn.Text = ds3354.Tables[0].Rows[k]["methodName"].ToString();
                tn.Name = ds3354.Tables[0].Rows[k]["xmlPath"].ToString();
                lstTn.Add(tn);
            }
            return(lstTn);
            //tv.ExpandAll();
        }