コード例 #1
0
ファイル: FrmPB_WL.cs プロジェクト: rcw0125/PCI20200819
        private void btn_Query_Click(object sender, EventArgs e)
        {
            try
            {
                WaitingFrom.ShowWait("");
                if (string.IsNullOrEmpty(txt_mat_code.Text.Trim()) &&
                    string.IsNullOrEmpty(txt_Name.Text.Trim()) &&
                    string.IsNullOrEmpty(txt_GZ.Text.Trim()) &&
                    string.IsNullOrEmpty(txt_Spec.Text.Trim()) &&
                    string.IsNullOrEmpty(txt_Len.Text.Trim()))
                {
                    MessageBox.Show("请输入查询条件进行查询!");
                    return;
                }

                int C_MAT_TYPE = 0;
                if (this.rbtn_zl.SelectedIndex == 0)
                {
                    C_MAT_TYPE = 8;
                }
                else
                {
                    C_MAT_TYPE = 6;
                }
                DataTable dt = bllWL.GetListByWhere(txt_mat_code.Text.Trim(), txt_Name.Text.Trim(), txt_GZ.Text.Trim(), txt_Spec.Text.Trim(), txt_Len.Text.Trim(), C_MAT_TYPE).Tables[0];
                this.gc_wl.DataSource = dt;
                this.gv_wl.BestFitColumns();
                SetGridViewRowNum.SetRowNum(gv_wl);
                WaitingFrom.CloseWait();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }