public override int Query() { if (name != "" && name != null) { DataTable table = _bll.getTable(" 1=1 "); if (table != null && table.Rows.Count > 0) { dataGridView1.Rows.Clear(); for (int i = 0; i < table.Rows.Count; i++) { int idx = dataGridView1.Rows.Add(); DataGridViewRow row = dataGridView1.Rows[idx]; row.Cells["id"].Value = table.Rows[i]["id"].ToString(); row.Cells["CODE"].Value = table.Rows[i]["CODE"].ToString(); row.Cells["fishId"].Value = table.Rows[i]["fishId"].ToString(); row.Cells["priceMY"].Value = table.Rows[i]["priceMY"].ToString(); row.Cells["price"].Value = table.Rows[i]["price"].ToString(); row.Cells["country"].Value = table.Rows[i]["country"].ToString(); row.Cells["brand"].Value = table.Rows[i]["brand"].ToString(); row.Cells["qualitySpe"].Value = table.Rows[i]["qualitySpe"].ToString(); row.Cells["weight"].Value = table.Rows[i]["weight"].ToString(); row.Cells["tvn"].Value = table.Rows[i]["tvn"].ToString(); row.Cells["acid"].Value = table.Rows[i]["acid"].ToString(); row.Cells["protein"].Value = table.Rows[i]["protein"].ToString(); row.Cells["ash"].Value = table.Rows[i]["ash"].ToString(); row.Cells["histamine"].Value = table.Rows[i]["histamine"].ToString(); row.Cells["las"].Value = table.Rows[i]["las"].ToString(); row.Cells["das"].Value = table.Rows[i]["das"].ToString(); row.Cells["salt"].Value = table.Rows[i]["salt"].ToString(); row.Cells["XNfishId"].Value = table.Rows[i]["XNfishId"].ToString(); row.Cells["ffa"].Value = table.Rows[i]["ffa"].ToString(); } } else { MessageBox.Show("查无数据!"); } } else { MessageBox.Show("鱼粉id没有带入"); } return(base.Query()); }
public override int Query() { _bll = new FishBll.Bll.QuotationPriceListBll(); strWhere = " 1=1 "; DataTable table = _bll.getTable(strWhere); strWhere = string.Empty; if (table != null && table.Rows.Count > 0) { dataGridView1.Rows.Clear(); for (int i = 0; i < table.Rows.Count; i++) { int idx = dataGridView1.Rows.Add(); DataGridViewRow row = dataGridView1.Rows[idx]; row.Cells["id"].Value = table.Rows[i]["id"].ToString(); row.Cells["CODE"].Value = table.Rows[i]["CODE"].ToString(); row.Cells["fishId"].Value = table.Rows[i]["fishId"].ToString(); row.Cells["priceMY"].Value = table.Rows[i]["priceMY"].ToString(); row.Cells["price"].Value = table.Rows[i]["price"].ToString(); row.Cells["country"].Value = table.Rows[i]["country"].ToString(); row.Cells["brand"].Value = table.Rows[i]["brand"].ToString(); row.Cells["qualitySpe"].Value = table.Rows[i]["qualitySpe"].ToString(); row.Cells["weight"].Value = table.Rows[i]["weight"].ToString(); row.Cells["tvn"].Value = table.Rows[i]["tvn"].ToString(); row.Cells["acid"].Value = table.Rows[i]["acid"].ToString(); row.Cells["protein"].Value = table.Rows[i]["protein"].ToString(); row.Cells["ash"].Value = table.Rows[i]["ash"].ToString(); row.Cells["histamine"].Value = table.Rows[i]["histamine"].ToString(); row.Cells["las"].Value = table.Rows[i]["las"].ToString(); row.Cells["das"].Value = table.Rows[i]["das"].ToString(); row.Cells["salt"].Value = table.Rows[i]["salt"].ToString(); row.Cells["ffa"].Value = table.Rows[i]["ffa"].ToString(); row.Cells["XNfishId"].Value = table.Rows[i]["XNfishId"].ToString(); } } else { MessageBox.Show("查无数据!"); } return(base.Query()); }