private void gBtnDelete_Click(object sender, EventArgs e) { if (_methodName != null) { if (DialogResult.OK == MessageBox.Show("是否删除该试验组?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) { BLL.GBT282892012_Tensile bllts = new HR_Test.BLL.GBT282892012_Tensile(); bllts.Delete(_methodName); } } }
private static List <TreeNode> ReadGBT28289TensileSamples(DateTime dtp) { BLL.GBT282892012_Tensile bllb = new HR_Test.BLL.GBT282892012_Tensile(); DataSet dsb = bllb.GetNotOverlapList("testDate=#" + dtp.Date + "#"); int count = dsb.Tables[0].Rows.Count; List <TreeNode> ltn = new List <TreeNode>(); for (int j = 0; j < count; j++) { DataSet _dsb = bllb.GetList(" testNo='" + dsb.Tables[0].Rows[j]["testNo"].ToString() + "' and testDate=#" + dtp.Date + "# "); TreeNode tn = new TreeNode(); tn.Text = dsb.Tables[0].Rows[j]["testNo"].ToString(); tn.Name = "GBT28289-2012Tensile"; tn.ImageIndex = 0; foreach (DataRow dr in _dsb.Tables[0].Rows) { if (Convert.ToBoolean(dr["isFinish"].ToString()) == true) { //左侧node完成试验的图标 TreeNode ftn = new TreeNode(); ftn.ImageIndex = 1; ftn.Text = dr["testSampleNo"].ToString(); ftn.Name = "GBT28289-2012Tensile_c"; ftn.Tag = dr; tn.Nodes.Add(ftn); } else { //左侧node未完成试验的图标 TreeNode ftn = new TreeNode(); ftn.ImageIndex = 2; ftn.Text = dr["testSampleNo"].ToString(); ftn.Name = "GBT28289-2012Tensile_c"; ftn.Tag = dr; tn.Nodes.Add(ftn); } } _dsb.Dispose(); ltn.Add(tn); } dsb.Dispose(); return(ltn); }