/// <summary> /// 修改柜台信息 /// </summary> /// <param name="handle">当前行</param> private void CounterUpdate(int handle) { try { if (handle < 0) { return; } CounterEdit counterEdit = new CounterEdit(); counterEdit.EditType = 2; DataRow dw = ViewCounter.GetDataRow(handle); int CouterID = int.Parse(dw["CouterID"].ToString()); CT_Counter Counter = CounterBLL.GetModel(CouterID); counterEdit.Counter = Counter; if (counterEdit.ShowDialog(this) == DialogResult.OK) { InitCounterList(); this.ViewCounter.FocusedRowHandle = handle; } } catch (Exception ex) { ShowMessageBox.ShowInformation("修改柜台信息失败!"); string errCode = "GL-3005"; string errMsg = "修改柜台信息失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); } }
private void Btn_Del_Click(object sender, EventArgs e) { try { if (ShowMessageBox.ShowQuestion("确认删除吗?") == DialogResult.No) { return; } if (this.ViewCounter != null && this.ViewCounter.FocusedRowHandle >= 0) { m_cutRow = this.ViewCounter.FocusedRowHandle; DataRow dw = ViewCounter.GetDataRow(m_cutRow); int CouterID = int.Parse(dw["CouterID"].ToString()); { //检测该柜台下是否存在用户 UM_UserInfoBLL UserInfoBLL = new UM_UserInfoBLL(); List <UM_UserInfo> l = UserInfoBLL.GetListArray(string.Format("CouterID={0}", CouterID)); if (l != null && l.Count > 0) { ShowMessageBox.ShowInformation("该柜台下存在交易员,不允许删除此柜台!"); return; } } CounterBLL.Delete(CouterID); ShowMessageBox.ShowInformation("删除成功!"); InitCounterList(); } else { ShowMessageBox.ShowInformation("请选中记录行!"); } } catch (Exception ex) { ShowMessageBox.ShowInformation("删除失败!"); string errCode = "GL-3004"; string errMsg = "删除失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); } }