Ejemplo n.º 1
0
 public void ReadMethodInfo(string _methodName)
 {
     BLL.ControlMethod_C   bllts_C = new HR_Test.BLL.ControlMethod_C();
     Model.ControlMethod_C modelc  = bllts_C.GetModel(_methodName);
     if (modelc != null)
     {
         c_testNo.Text        = "";
         c_testNum.Text       = "";
         _sendCompany         = modelc.sendCompany;
         _condition           = modelc.condition;
         _controlMode         = modelc.controlmode;
         c_stuffCardNo.Text   = modelc.stuffCardNo;
         c_stuffSpec.Text     = modelc.stuffSpec;
         c_stuffType.Text     = modelc.stuffType;
         _hotStatus           = modelc.hotStatus;
         _temperature         = modelc.temperature.ToString();
         _humidity            = modelc.humidity.ToString();
         _sampleCharacter     = modelc.sampleCharacter;
         _testStandard_C.Text = modelc.testStandard;
         c_sign.Text          = modelc.sign;
         c_L.Text             = modelc.L.ToString();
         c_L0.Text            = modelc.L0.ToString();
         c_HH.Text            = modelc.H.ToString();
         c_h.Text             = modelc.hh.ToString();
         c_getSample.Text     = modelc.getSample;
         txtn.Text            = modelc.a.ToString();
         Epc.Text             = modelc.b.ToString();
         Etc.Text             = modelc.d.ToString();
         c_S0.Text            = "";
         c_Ff.Text            = modelc.Ff.ToString();
         c_mathineType.Text   = modelc.mathineType;
         c_tester.Text        = modelc.tester;
         c_testMethod.Text    = modelc.testMethod;
     }
 }
Ejemplo n.º 2
0
        private void gBtnAddToMethod2_Click(object sender, EventArgs e)
        {
            string strErr = "";

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

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

            if (this.c_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.c_getSample.Text.Trim().Length == 0)
            {
                strErr += "试样取样不能为空!\r\n\r\n";
            }

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


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

            BLL.ControlMethod_C           bllcm_C = new HR_Test.BLL.ControlMethod_C();
            HR_Test.Model.ControlMethod_C model   = bllcm_C.GetModel(this.c_testMethod.Text);

            model.sendCompany     = this._sendCompany;
            model.stuffCardNo     = this.c_stuffCardNo.Text;
            model.stuffSpec       = c_stuffSpec.Text;
            model.stuffType       = c_stuffType.Text;
            model.hotStatus       = this._hotStatus;
            model.temperature     = double.Parse(this._temperature);
            model.humidity        = double.Parse(this._humidity);
            model.testStandard    = this._testStandard_C.Text;
            model.testMethod      = c_testMethod.Text;
            model.mathineType     = c_mathineType.Text;
            model.testCondition   = "-";
            model.sampleCharacter = this._sampleCharacter;
            model.getSample       = c_getSample.Text;
            model.tester          = c_tester.Text;
            model.condition       = this._condition;
            model.controlmode     = this._controlMode;
            model.assessor        = "-";
            model.sign            = this.c_sign.Text;

            //model.a = (this.c_a.Text.Trim().Length > 0 ? double.Parse(c_a.Text) : 0);
            //model.b = (this.c_b.Text.Trim().Length > 0 ? double.Parse(c_b.Text) : 0);
            //model.d = (this.c_d.Text.Trim().Length > 0 ? double.Parse(c_d.Text) : 0);

            //修改为放大倍数
            model.a = (this.txtn.Text.Trim().Length > 0 ? double.Parse(txtn.Text) : 0);
            //修改为 Epc
            model.b = (this.Epc.Text.Trim().Length > 0 ? double.Parse(Epc.Text) : 0);
            //修改为 Etc
            model.d = (this.Etc.Text.Trim().Length > 0 ? double.Parse(Etc.Text) : 0);

            model.L  = (this.c_L.Text.Trim().Length > 0 ? double.Parse(c_L.Text) : 0);
            model.L0 = (this.c_L0.Text.Trim().Length > 0 ? double.Parse(c_L0.Text) : 0);
            model.H  = (this.c_HH.Text.Trim().Length > 0 ? double.Parse(c_HH.Text) : 0);
            model.hh = (this.c_h.Text.Trim().Length > 0 ? double.Parse(c_h.Text) : 0);
            //model.S0 = double.Parse(c_S0.Text);
            model.Ff = (this.c_Ff.Text.Trim().Length > 0 ? double.Parse(c_Ff.Text) : 0);

            if (bllcm_C.Update(model))
            {
                MessageBox.Show(this, "更新成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 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();
        }