/// <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()); } }
/// <summary> /// 确定事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Btn_OK_Click(object sender, EventArgs e) { string mess; try { CT_CounterBLL CounterBLL = new CT_CounterBLL(); if (!CounterBLL.TestCenterConnection()) { MessageBox.Show("柜台服务连接失败,请检查柜台服务是否开启!", "系统提示"); return; } if (this.m_EditType == 1) { if (CheckUserInfo()) { DataTable table = GetModifyNodes(this.m_EditType); ManagementCenter.BLL.UserManage.TransactionManage transactionManage = new ManagementCenter.BLL.UserManage.TransactionManage(); if (transactionManage.AddTransaction(table, CurrentUser, InitFund, out mess)) { ShowMessageBox.ShowInformation("添加成功!"); this.DialogResult = DialogResult.OK; this.Close(); } else { ShowMessageBox.ShowInformation(mess); } } } else { if (this.m_currentUser.AddType == (int)ManagementCenter.Model.CommonClass.Types.AddTpyeEnum.FrontTaransaction) { ShowMessageBox.ShowInformation("此交易员为虚拟前台所开设用户,不允许修改!"); return; } if (CheckUserInfo()) { DataTable addtable = GetModifyNodes(1); DataTable deltable = GetModifyNodes(2); ManagementCenter.BLL.UserManage.TransactionManage transactionManage = new ManagementCenter.BLL.UserManage.TransactionManage(); if (transactionManage.UpdateTransaction(addtable, deltable, CurrentUser, this.che_UpdatePass.Checked, out mess)) { ShowMessageBox.ShowInformation("修改成功!"); this.DialogResult = DialogResult.OK; this.Close(); } else { ShowMessageBox.ShowInformation(mess); } } } } catch (Exception ex) { string errCode = "GL-0301"; string errMsg = "保存失败!"; VTException vte = new VTException(errCode, errMsg, ex); LogHelper.WriteError(vte.ToString(), vte.InnerException); ShowMessageBox.ShowInformation(vte.ToString()); } }
/// <summary> /// 自由转帐(同币种) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOK_Click(object sender, EventArgs e) { try { CT_CounterBLL CounterBLL = new CT_CounterBLL(); if (!CounterBLL.TestCenterConnection()) { MessageBox.Show("柜台服务连接失败,请检查柜台服务是否开启!", "系统提示"); return; } if (this.ViewUserInfo != null && this.ViewUserInfo.FocusedRowHandle >= 0 && ViewUserInfo.RowCount > 0) { m_cutRow = this.ViewUserInfo.FocusedRowHandle; if (m_cutRow < 0) { return; } DataRow dw = ViewUserInfo.GetDataRow(m_cutRow); int userID = Convert.ToInt32(dw["UserID"].ToString()); //用户ID int counterID = int.Parse(dw["CouterID"].ToString()); //柜台ID int FromCapitalAccountType = ((UComboItem)cmbTransOut.SelectedItem).ValueIndex; int ToCapitalAccountType = ((UComboItem)cmbTransIn.SelectedItem).ValueIndex; decimal TransferAmount = AppGlobalVariable.INIT_DECIMAL; string _Money = string.Empty;//输入的金额 if (!string.IsNullOrEmpty(txtTransferMoney.Text)) { if (InputTest.DecimalTest(this.txtTransferMoney.Text)) { if (Convert.ToDecimal(txtTransferMoney.Text) <= 0) { ShowMessageBox.ShowInformation("转出金额需大于0!"); return; } _Money = this.txtTransferMoney.Text; string[] _lengthRMB = _Money.Split('.'); if (_lengthRMB[0].Length > 12) { ShowMessageBox.ShowInformation("超出存储的范围(整数部分不能大于12位)!"); return; } if (_lengthRMB.Length > 1) { if (_lengthRMB[1].Length > 3) { ShowMessageBox.ShowInformation("小数部分不能大于3位!"); return; } } if (this.txtTransferMoney.Text.Length > 16) { ShowMessageBox.ShowInformation("超出存储的范围(不能大于16位)!"); return; } TransferAmount = Convert.ToDecimal(txtTransferMoney.Text); } else { ShowMessageBox.ShowInformation("格式不正确(只能包含数字和小数点)!"); return; } } else { ShowMessageBox.ShowInformation("转出资金不能为空!"); return; } TransactionManageBLL = new ManagementCenter.BLL.UserManage.TransactionManage(); int currencyType = ((UComboItem)cmbCurrencyType.SelectedItem).ValueIndex; string outMessage = string.Empty; bool result = TransactionManageBLL.ConvertFreeTransferEntity(userID, FromCapitalAccountType, ToCapitalAccountType, TransferAmount, currencyType, counterID, out outMessage); if (result) { ShowMessageBox.ShowInformation("成功转出资金:" + TransferAmount + "元"); InitAccountListByUserID(userID.ToString(), counterID, m_cutRow); } else { if (!string.IsNullOrEmpty(outMessage)) { ShowMessageBox.ShowInformation(outMessage + "!");//在柜台返回的异常信息后加! } } } } catch (Exception ex) { string errCode = "GL-0374"; string errMsg = " 自由转帐(同币种)失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), ex); return; } }