/// <summary> /// 批量查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barBtnSearch_ItemClick(object sender, ItemClickEventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { ImportCsv importCsv = new ImportCsv(); DataSet ds = importCsv.ReadSharchExcel(openFileDialog1.FileName, "", ((int)Status.待上报).ToString()); DataTable dt = ds.Tables[0]; dt.Columns.Add("check", System.Type.GetType("System.Boolean")); gcCljbxx.DataSource = dt; this.lblSum.Text = String.Format("共{0}条", dt.Rows.Count); Utils.SelectItem(this.gvCljbxx, false); } }
/// <summary> /// 批量查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barBtnSearch_ItemClick(object sender, ItemClickEventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { ImportCsv importCsv = new ImportCsv(); DataSet ds = importCsv.ReadSharchExcel(openFileDialog1.FileName, ((int)Status.待上报).ToString()); DataTable dt = ds.Tables[0]; dt.Columns.Add("check", System.Type.GetType("System.Boolean")); dgvCljbxx.DataSource = dt; this.lblSum.Text = String.Format("共{0}条", dt.Rows.Count); Utils.SelectItem(this.gridView1, false); } catch (Exception ex) { MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }