private void btnFind_Click(object sender, EventArgs e) { string strWhere = this.txtWhere.Text.Trim().ToUpper(); if (strWhere == "") { return; } this.Cursor = Cursors.WaitCursor; DataTable dtRecord = new DataTable(); long Ret = objSvc.m_mthFindOPSChargeByID(this.cboMode.Tag.ToString(), strWhere, this.Paytype, this.LoginInfo.m_strEmpID, out dtRecord); if (dtRecord.Rows.Count > 0) { int rowno = 0; this.lvResult.BeginUpdate(); this.lvResult.Items.Clear(); for (int i = 0; i < dtRecord.Rows.Count; i++) { rowno = i + 1; ListViewItem lv = new ListViewItem(rowno.ToString()); lv.SubItems.Add(dtRecord.Rows[i]["type"].ToString()); //查询码 lv.SubItems.Add(dtRecord.Rows[i]["itemname_vchr"].ToString()); //名称 lv.SubItems.Add(dtRecord.Rows[i]["itemid_chr"].ToString()); //代码 this.lvResult.Items.Add(lv); } this.lvResult.EndUpdate(); } else { this.Cursor = Cursors.Default; MessageBox.Show("没有找到满足条件的记录。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.Cursor = Cursors.Default; }