/// <summary> /// 测试追加资金 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddFund_Click(object sender, EventArgs e) { TransactionManageClient transactionManageClient = new TransactionManageClient(); string mess = string.Empty; UM_FundAddInfo umFundAddInfo = new UM_FundAddInfo(); umFundAddInfo.UserID = 29; umFundAddInfo.HKNumber = 100; umFundAddInfo.USNumber = 100; umFundAddInfo.RMBNumber = 100; bool reust = transactionManageClient.AddFundFP(out mess, umFundAddInfo); if (reust) { MessageBox.Show("追加资金成功!"); } }
/// <summary> /// 管理员查询根据交易员查询交易员各银行资金账户相关信息 /// </summary> /// <param name="adminId">管理员ID(可传空值:因柜台没验证)</param> /// <param name="adminPassword">管理员密码(可传空值:因柜台没验证)</param> /// <param name="traderID">交易员ID</param> /// <param name="strErrorMessage">输出信息</param> /// <returns>返回交易员的资金明细</returns> public UM_FundAddInfo AdminFindTraderBankCapitalAccountInfoByID(string adminId, string adminPassword, string traderID, out string strErrorMessage) { //调用柜台管理员查询根据交易员查询交易员各资金账户相关信息方法 List <TradersAccountCapitalInfo> tradersAccountCList = new List <TradersAccountCapitalInfo>(); UM_FundAddInfo uM_FundAddInfo = new UM_FundAddInfo();//追加资金明细实体 try { int couterID; UM_UserInfo uM_UserInfo = new UM_UserInfo(); uM_UserInfo = GetUMUserInfoModel(Convert.ToInt32(traderID)); if (uM_UserInfo == null) { strErrorMessage = "用户ID不存在!"; LogHelper.WriteDebug(strErrorMessage); return(null); } couterID = Convert.ToInt32(uM_UserInfo.CouterID); if (string.IsNullOrEmpty(couterID.ToString())) { strErrorMessage = "交易员ID(用户ID)的柜台不存在!"; LogHelper.WriteDebug(strErrorMessage); return(null); } CT_Counter T = StaticDalClass.CounterDAL.GetModel(couterID); tradersAccountCList = ServiceIn.AccountManageServiceProxy.GetInstance().AdminFindTraderCapitalAccountInfoByID(T, adminId, adminPassword, traderID, out strErrorMessage); if (tradersAccountCList.Count == 0) { strErrorMessage = "GL-0052:调用柜台开户方法AdminFindTraderCapitalAccountInfoByID失败!";// +s; //写调试信息 LogHelper.WriteDebug(strErrorMessage); return(null); } //返回银行账户里的可用资金 foreach (TradersAccountCapitalInfo traderACInfo in tradersAccountCList) { if (traderACInfo.AccountType == (int)GTA.VTS.Common.CommonObject.Types.AccountType.BankAccount) { switch (traderACInfo.CurrencyType) { case (int)GTA.VTS.Common.CommonObject.Types.CurrencyType.RMB: uM_FundAddInfo.RMBNumber = traderACInfo.AvailableCapital; break; case (int)GTA.VTS.Common.CommonObject.Types.CurrencyType.HK: uM_FundAddInfo.HKNumber = traderACInfo.AvailableCapital; break; case (int)GTA.VTS.Common.CommonObject.Types.CurrencyType.US: uM_FundAddInfo.USNumber = traderACInfo.AvailableCapital; break; default: break; } } } } catch (VTException ex) { strErrorMessage = ex.ToString(); LogHelper.WriteError(ex.ToString(), ex.InnerException); return(null); } return(uM_FundAddInfo); }
/// <summary> /// 确定按纽事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_OK_Click(object sender, EventArgs e) { string mess; try { ManagementCenter.BLL.UserManage.TransactionManage tm = new ManagementCenter.BLL.UserManage.TransactionManage(); decimal rbm = decimal.MaxValue, hk = decimal.MaxValue, us = decimal.MaxValue; int userid = int.MaxValue; try { userid = int.Parse(this.txt_ID.Text); } catch (Exception) { ShowMessageBox.ShowInformation("请输入正确的交易员编号!"); return; } try { UM_FundAddInfo uM_FundAddInfo = tm.AdminFindTraderBankCapitalAccountInfoByID( CommonClass.ParameterSetting.Mananger.UserID.ToString(), CommonClass.ParameterSetting.Mananger.Password, userid.ToString(), out mess); string _Money = string.Empty; //输入的金额 decimal _BankAvailableCapital = 0; //银行账户可用资金 if (this.txt_rmb.Text != string.Empty) { _Money = this.txt_rmb.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.txt_rmb.Text.Length > 16) { ShowMessageBox.ShowInformation("超出存储的范围(不能大于16位)!"); return; } _BankAvailableCapital = 0; _BankAvailableCapital = uM_FundAddInfo.RMBNumber.Value + decimal.Parse(this.txt_rmb.Text); _lengthRMB = _BankAvailableCapital.ToString().Split('.'); if (_lengthRMB[0].Length > 12) { ShowMessageBox.ShowInformation("银行账户的人民币总资金整数部分不能大于12位!"); return; } rbm = decimal.Parse(this.txt_rmb.Text); } if (this.txt_hk.Text != string.Empty) { _Money = this.txt_hk.Text; string[] _lengthHk = _Money.Split('.'); if (_lengthHk[0].Length > 12) { ShowMessageBox.ShowInformation("超出存储的范围(整数部分不能大于12位)!"); return; } if (_lengthHk.Length > 1) { if (_lengthHk[1].Length > 3) { ShowMessageBox.ShowInformation("小数部分不能大于3位!"); return; } } if (this.txt_hk.Text.Length > 16) { ShowMessageBox.ShowInformation("超出存储的范围(不能大于16位)!"); return; } _BankAvailableCapital = 0; _BankAvailableCapital = uM_FundAddInfo.HKNumber.Value + decimal.Parse(this.txt_hk.Text); _lengthHk = _BankAvailableCapital.ToString().Split('.'); if (_lengthHk[0].Length > 12) { ShowMessageBox.ShowInformation("银行账户的港币总资金整数部分不能大于12位!"); return; } hk = decimal.Parse(this.txt_hk.Text); } if (this.txt_us.Text != string.Empty) { _Money = this.txt_us.Text; string[] _lengthUS = _Money.Split('.'); if (_lengthUS[0].Length > 12) { ShowMessageBox.ShowInformation("超出存储的范围(整数部分不能大于12位)!"); return; } if (_lengthUS.Length > 1) { if (_lengthUS[1].Length > 3) { ShowMessageBox.ShowInformation("小数部分不能大于3位!"); return; } } if (this.txt_us.Text.Length > 16) { ShowMessageBox.ShowInformation("超出存储的范围(不能大于16位)!"); return; } _BankAvailableCapital = 0; _BankAvailableCapital = uM_FundAddInfo.USNumber.Value + decimal.Parse(this.txt_us.Text); _lengthUS = _BankAvailableCapital.ToString().Split('.'); if (_lengthUS[0].Length > 12) { ShowMessageBox.ShowInformation("银行账户的美元总资金整数部分不能大于12位!"); return; } us = decimal.Parse(this.txt_us.Text); } if (string.IsNullOrEmpty(txt_rmb.Text) && string.IsNullOrEmpty(txt_hk.Text) && string.IsNullOrEmpty(txt_us.Text)) { ShowMessageBox.ShowInformation("金额不能为空!"); return; } } catch { ShowMessageBox.ShowInformation("请输入正确的金额!"); return; } //ManagementCenter.BLL.UserManage.TransactionManage tm=new ManagementCenter.BLL.UserManage.TransactionManage(); UM_FundAddInfo UM_FundAddInfo = new UM_FundAddInfo(); UM_FundAddInfo.AddTime = System.DateTime.Now; UM_FundAddInfo.UserID = userid; UM_FundAddInfo.ManagerID = ParameterSetting.Mananger.UserID; //调用柜台开户方法 UM_FundAddInfo.RMBNumber = (decimal)rbm; UM_FundAddInfo.HKNumber = (decimal)hk; UM_FundAddInfo.USNumber = (decimal)us; if (tm.AddFund(UM_FundAddInfo, out mess)) { ShowMessageBox.ShowInformation("追加资金成功!"); this.DialogResult = DialogResult.OK; } else { ShowMessageBox.ShowInformation(mess); } } catch (Exception ex) { ShowMessageBox.ShowInformation("追加资金失败!"); string errCode = "GL-0331"; string errMsg = "追加资金失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), ex); } }