/// <summary> /// 查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Query_Click(object sender, EventArgs e) { try { if (txt_Mat.Text.Trim() == "" && txt_GZ.Text.Trim() == "" && txt_STD.Text.Trim() == "") { MessageBox.Show("请输入查询条件再进行查询!"); return; } WaitingFrom.ShowWait(""); DataTable dt = bll_Matrl.GetGP_StlGrd(txt_Mat.Text.Trim(), txt_GZ.Text.Trim(), txt_STD.Text.Trim()).Tables[0]; gc_Main.DataSource = dt; gv_Main.BestFitColumns(); SetGridViewRowNum.SetRowNum(gv_Main); WaitingFrom.CloseWait(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void GetStlGrd() { DataTable dt = new DataTable(); if (dropType.SelectedItem.Value == "0") { dt = tb_matrl_main.GetStlGrd(txtmatcode.Text, txtstlgrd.Text, tstspec.Text).Tables[0]; } else { dt = tb_matrl_main.GetGP_StlGrd(txtmatcode.Text, txtstlgrd.Text, tstspec.Text).Tables[0]; } if (dt.Rows.Count > 0) { rptList.DataSource = dt; rptList.DataBind(); } else { rptList.DataSource = null; rptList.DataBind(); } }