public void ReadMethodInfo(string methodName)
        {
            BLL.ControlMethod bllts = new HR_Test.BLL.ControlMethod();
            DataSet           ds    = bllts.GetList("MethodName ='" + methodName + "'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                _sendCompany       = ds.Tables[0].Rows[0]["sendCompany"].ToString();
                _stuffCardNo.Text  = ds.Tables[0].Rows[0]["stuffCardNo"].ToString();
                _stuffSpec.Text    = ds.Tables[0].Rows[0]["stuffSpec"].ToString();
                _stuffType.Text    = ds.Tables[0].Rows[0]["stuffType"].ToString();
                _hotStatus         = ds.Tables[0].Rows[0]["hotStatus"].ToString();
                _temperature       = ds.Tables[0].Rows[0]["temperature"].ToString();
                _humidity          = ds.Tables[0].Rows[0]["humidity"].ToString();
                _sampleCharacter   = ds.Tables[0].Rows[0]["sampleCharacter"].ToString();
                _testStandard.Text = ds.Tables[0].Rows[0]["testStandard"].ToString();
                _sign.Text         = ds.Tables[0].Rows[0]["sign"].ToString();
                _L0.Text           = ds.Tables[0].Rows[0]["L0"].ToString();
                _L01     = double.Parse(ds.Tables[0].Rows[0]["L01"].ToString());
                _Lc.Text = ds.Tables[0].Rows[0]["Lc"].ToString();
                _Le.Text = ds.Tables[0].Rows[0]["Le"].ToString();
                _Lt      = double.Parse(ds.Tables[0].Rows[0]["Lt"].ToString());

                _getSample.Text = ds.Tables[0].Rows[0]["getSample"].ToString();
                _a0.Text        = "";
                _b0.Text        = "";
                _d0.Text        = "";
                _Do.Text        = "";
                _S0.Text        = "";

                _εp.Text = ds.Tables[0].Rows[0]["au"].ToString(); //对应 au
                _εt.Text = ds.Tables[0].Rows[0]["bu"].ToString(); //bu
                _εr.Text = ds.Tables[0].Rows[0]["du"].ToString(); //du

                _mathineType.Text = ds.Tables[0].Rows[0]["mathineType"].ToString();
                _tester.Text      = ds.Tables[0].Rows[0]["tester"].ToString();
                _testMethod.Text  = ds.Tables[0].Rows[0]["testMethod"].ToString();

                _condition   = ds.Tables[0].Rows[0]["condition"].ToString();
                _controlMode = ds.Tables[0].Rows[0]["controlmode"].ToString();
            }
            ds.Dispose();
        }
        private void gBtnAddToMethod1_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (string.IsNullOrEmpty(this._sendCompany))
            {
                strErr += "送检单位不能为空!\r\n\r\n";
            }
            if (this._stuffCardNo.Text.Trim().Length == 0)
            {
                strErr += "材料牌号不能为空!\r\n\r\n";
            }
            if (this._stuffSpec.Text.Trim().Length == 0)
            {
                strErr += "材料规格不能为空!\r\n\r\n";
            }
            if (this._stuffType.Text.Trim().Length == 0)
            {
                strErr += "试样类型不能为空!\r\n\r\n";
            }

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

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

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

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

            if (string.IsNullOrEmpty(this._sampleCharacter))
            {
                strErr += "试样标识不能为空!\r\n\r\n";
            }
            if (this._getSample.Text.Trim().Length == 0)
            {
                strErr += "试样取样不能为空!\r\n\r\n";
            }
            if (this._tester.Text.Trim().Length == 0)
            {
                strErr += "试验员不能为空!\r\n\r\n";
            }

            if (this._Lc.Text.Trim().Length == 0)
            {
                strErr += "'Lc'不能为空!\r\n\r\n";
            }
            else
            {
                if (double.Parse(this._Lc.Text.Trim()) == 0d)
                {
                    strErr += "'Lc'不能为0!\r\n\r\n";
                }
            }

            if (this._Le.Text.Trim().Length == 0)
            {
                strErr += "'Le'不能为空!\r\n\r\n";
            }
            else
            {
                if (double.Parse(this._Le.Text.Trim()) == 0d)
                {
                    strErr += "'Le'不能为0!\r\n\r\n";
                }
            }

            if (this._L0.Text.Trim().Length == 0)
            {
                strErr += "'L0'不能为空!\r\n\r\n";
            }
            else
            {
                if (double.Parse(this._L0.Text.Trim()) == 0d)
                {
                    strErr += "'L0'不能为0!\r\n\r\n";
                }
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }

            string testNo       = this._testNo.Text;
            string testSampleNo = this._testSampleNo.Text;
            //string reportNo = this._reportNo.Text;
            string sendCompany  = this._sendCompany;
            string stuffCardNo  = this._stuffCardNo.Text;
            string stuffSpec    = this._stuffSpec.Text;
            string stuffType    = this._stuffType.Text;
            string hotStatus    = this._hotStatus;
            string temperature  = this._temperature;
            string humidity     = this._humidity;
            string testStandard = this._testStandard.Text;
            string testMethod   = this._testMethod.Text;
            string mathineType  = this._mathineType.Text;
            //string testCondition = this._testCondition.Text;
            string sampleCharacter = this._sampleCharacter;
            string getSample       = this._getSample.Text;
            string tester          = this._tester.Text;
            string a0  = (this._a0.Text.Trim().Length > 0 ? this._a0.Text : "0");
            string b0  = (this._b0.Text.Trim().Length > 0 ? this._b0.Text : "0");
            string d0  = (this._d0.Text.Trim().Length > 0 ? this._d0.Text : "0");
            string Do  = (this._Do.Text.Trim().Length > 0 ? this._Do.Text : "0");
            string L0  = (this._L0.Text.Trim().Length > 0 ? this._L0.Text : "0");
            double L01 = this._L01;
            string Lc  = (this._Lc.Text.Trim().Length > 0 ? this._Lc.Text : "0");
            string Le  = (this._Le.Text.Trim().Length > 0 ? this._Le.Text : "0");
            double Lt  = this._Lt;

            string S0 = this._S0.Text;

            string εp = (this._εp.Text.Trim().Length > 0 ? this._εp.Text : "0");
            string εt = (this._εt.Text.Trim().Length > 0 ? this._εt.Text : "0");
            string εr = (this._εr.Text.Trim().Length > 0 ? this._εr.Text : "0");

            BLL.ControlMethod   bllcm = new HR_Test.BLL.ControlMethod();
            Model.ControlMethod model = bllcm.GetModel(this._testMethod.Text);
            //model.testMethodID = testMethodID;

            model.sendCompany     = sendCompany;
            model.stuffCardNo     = stuffCardNo;
            model.stuffSpec       = stuffSpec;
            model.stuffType       = stuffType;
            model.hotStatus       = hotStatus;
            model.temperature     = double.Parse(this._temperature);
            model.humidity        = double.Parse(this._humidity);
            model.testStandard    = testStandard;
            model.testMethod      = testMethod;
            model.mathineType     = mathineType;
            model.testCondition   = "-";
            model.sampleCharacter = sampleCharacter;
            model.getSample       = getSample;
            model.tester          = tester;
            model.condition       = this._condition;
            model.controlmode     = this._controlMode;
            model.assessor        = "-";
            model.sign            = this._sign.Text;
            model.au = double.Parse(εp);
            model.bu = double.Parse(εt);
            model.du = double.Parse(εr);

            //"L0 double," + //原始标距
            model.L0 = double.Parse(L0);
            //"L01 double" + //测定Awn的原始标距
            model.L01 = L01;
            //"Lc double," + //平行长度
            model.Lc = double.Parse(Lc);
            //"Le double," + //引伸计标距
            model.Le = double.Parse(Le);
            //"Lt double," + //试样总长度
            model.Lt = Lt;
            //"Lu double," + //断后标距
            model.Lu = 0;
            //"Lu1 double," + //测量Awn的断后标距
            model.Lu1 = 0;
            //"S0 double," + //原始横截面面积
            model.S0 = 0;
            //"Su double," + //断后最小横截面面积
            model.Su = 0;
            //"k double," +//比例系数
            model.k = 0;
            if (bllcm.Update(model))
            {
                MessageBox.Show(this, "更新成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #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();
        }