private void NewMethod1() { try { m_checkStatus = false; DataRow dr = this.gv_SJXX.GetDataRow(this.gv_SJXX.FocusedRowHandle); if (dr == null) { return; //判断是否选中线材实绩信息 } if (string.IsNullOrEmpty(dr["C_STL_GRD"].ToString()) || string.IsNullOrEmpty(dr["C_STD_CODE"].ToString())) { return; } DataTable dt = bll_hook.GetList(dr["C_BATCH_NO"].ToString(), dr["C_STA_ID"].ToString()).Tables[0]; dt.Columns.Add("chk", System.Type.GetType("System.Boolean")); dt.Columns.Add("strSG", System.Type.GetType("System.Boolean")); //首钩 dt.Columns.Add("strCG", System.Type.GetType("System.Boolean")); //次钩 dt.Columns.Add("strT", System.Type.GetType("System.Boolean")); //头 dt.Columns.Add("strW", System.Type.GetType("System.Boolean")); //尾 dt.Columns["chk"].DefaultValue = Boolean.FalseString; dt.Columns["strSG"].DefaultValue = Boolean.FalseString; dt.Columns["strCG"].DefaultValue = Boolean.FalseString; dt.Columns["strT"].DefaultValue = Boolean.FalseString; dt.Columns["strW"].DefaultValue = Boolean.FalseString; gc_right.DataSource = dt; gv_right.BestFitColumns(); for (int i = 0; i < dt.Rows.Count; i++) { gv_right.SetRowCellValue(i, "strSG", false); gv_right.SetRowCellValue(i, "strCG", false); gv_right.SetRowCellValue(i, "chk", false); gv_right.SetRowCellValue(i, "strT", false); gv_right.SetRowCellValue(i, "strW", false); } SetGridViewRowNum.SetRowNum(gv_right); DataTable dt_sampling = bll_std_sampling.GetList_Query(dr["C_STL_GRD"].ToString(), dr["C_STD_CODE"].ToString()).Tables[0]; gc_XNLB.DataSource = dt_sampling; gv_XNLB.BestFitColumns(); SetGridViewRowNum.SetRowNum(gv_XNLB); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 性能类别 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gv_SYXX_Click(object sender, EventArgs e) { try { if (ClickGridCheckBox(gv_SYXX, "chk", m_checkStatus)) { m_checkStatus = !m_checkStatus; } DataRow dr = this.gv_SYXX.GetDataRow(this.gv_SYXX.FocusedRowHandle); if (dr == null) { return; //判断是否选中线材实绩信息 } DataTable dt = bll_trc_roll_main.GetList_Batch(dr["批号"].ToString()).Tables[0]; if (dt.Rows.Count > 0) { DataTable dt_sampling = bll_std_sampling.GetList_Query(dt.Rows[0]["C_STL_GRD"].ToString(), dt.Rows[0]["C_STD_CODE"].ToString()).Tables[0]; gc_XNLB.DataSource = dt_sampling; gv_XNLB.BestFitColumns(); SetGridViewRowNum.SetRowNum(gv_XNLB); } else { gc_XNLB.DataSource = null; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }