/// <summary> /// 修改交易员 /// </summary> /// <param name="handle">当前行</param> private void UserUpdate(int handle) { try { if (handle < 0) { return; } UserInfoForm userInfoForm = new UserInfoForm(); userInfoForm.EditType = 2; DataRow dw = ViewUser.GetDataRow(handle); int UserID = int.Parse(dw["UserID"].ToString()); UM_UserInfo UserInfo = UserInfoBLL.GetModel(UserID); userInfoForm.CurrentUser = UserInfo; if (userInfoForm.ShowDialog(this) == DialogResult.OK) { LoadUser(); this.ViewUser.FocusedRowHandle = handle; } } catch (Exception ex) { string errCode = "GL-0324"; string errMsg = "修改交易员失败"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), ex); } }
/// <summary> /// 删除按纽事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Btn_Del_Click(object sender, EventArgs e) { try { string mess; if (this.ViewUser != null && this.ViewUser.FocusedRowHandle >= 0) { if (ShowMessageBox.ShowQuestion("确认删除吗?") == DialogResult.Yes) { CT_CounterBLL CounterBLL = new CT_CounterBLL(); if (!CounterBLL.TestCenterConnection()) { MessageBox.Show("柜台服务连接失败,请检查柜台服务是否开启!", "系统提示"); return; } m_cutRow = this.ViewUser.FocusedRowHandle; DataRow dw = ViewUser.GetDataRow(m_cutRow); int UserID = int.Parse(dw["UserID"].ToString()); ManagementCenter.BLL.UserManage.TransactionManage TransactionManage = new ManagementCenter.BLL.UserManage.TransactionManage(); if (TransactionManage.DelTransaction(UserID, out mess)) { ShowMessageBox.ShowInformation("删除成功!"); InitUserList(); } else { ShowMessageBox.ShowInformation(mess); } } } else { ShowMessageBox.ShowInformation("请选中记录行!"); } } catch (Exception ex) { string errCode = "GL-0325"; string errMsg = "删除交易员失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), ex); ShowMessageBox.ShowInformation(exception.ToString()); } }