private void btnSingleReturn_Click(object sender, EventArgs e) { if (this._ListQueryStuInfo == null) { ShowWarningMessage("查询结果已超时,请重新查询后再进行退卡操作。"); return; } if (lvStudentList.SelectedItems.Count > 0) { try { string strRecordID = lvStudentList.SelectedItems[0].SubItems[0].Text; Guid guidRecordID = new Guid(strRecordID); CardUserMaster_cus_Info userInfo = this._ListQueryStuInfo.Find(x => x.cus_cRecordID == guidRecordID); if (userInfo != null) { dlgCardReturnCheck dlg = new dlgCardReturnCheck(userInfo); dlg.UserInformation = base.UserInformation; dlg.ShowDialog(); } else { ShowErrorMessage("没有找到可用记录。"); return; } } catch (Exception ex) { ShowErrorMessage("本地记录异常,请重新查询后再试。" + Environment.NewLine + ex.Message); return; } } else { ShowWarningMessage("请先选中一条记录。"); return; } }
private void btnBatchReturn_Click(object sender, EventArgs e) { if (!this._IsBatchModify) { if (lvStudentList.Items.Count > 0) { btnBatchReturn.Text = "确定选择"; this._IsBatchModify = true; lvStudentList.CheckBoxes = true; lvStudentList.Columns[0].Width = 22; ckbSelectAll.Enabled = true; ckbSelectAll.Visible = true; pnlQueryArea.Enabled = false; btnQuery.Enabled = false; btnSingleReturn.Enabled = false; btnCancel.Enabled = true; } else { ShowWarningMessage("没有可选的项。"); } } else { //显示确认窗口 if (lvStudentList.CheckedItems.Count > 0) { List<CardUserMaster_cus_Info> listUserList = new List<CardUserMaster_cus_Info>(); foreach (ListViewItem item in lvStudentList.CheckedItems) { string strRecordID = item.SubItems[0].Text; Guid guidRecordID = new Guid(strRecordID); CardUserMaster_cus_Info userInfo = this._ListQueryStuInfo.Find(x => x.cus_cRecordID == guidRecordID); if (userInfo != null) { listUserList.Add(userInfo); } } dlgCardReturnCheck dlg = new dlgCardReturnCheck(listUserList); dlg.UserInformation = base.UserInformation; dlg.ShowDialog(); } else { ShowWarningMessage("没有选中的项。"); } } }