public void ReadMethodInfo(string methodName) { BLL.GBT282892012_Method bllts = new HR_Test.BLL.GBT282892012_Method(); 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(); _getSample.Text = ds.Tables[0].Rows[0]["getSample"].ToString(); _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 (strErr != "") { MessageBox.Show(this, strErr); return; } string testNo = this._testNo.Text; string testSampleNo = this._testSampleNo.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 sampleCharacter = this._sampleCharacter; string getSample = this._getSample.Text; string tester = this._tester.Text; BLL.GBT282892012_Method bllcm = new HR_Test.BLL.GBT282892012_Method(); Model.GBT282892012_Method model = bllcm.GetModel(this._testMethod.Text); 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; if (bllcm.Update(model)) { MessageBox.Show(this, "更新成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
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(); }