/// <summary> /// 根据查询条件,获取港股交易商品 /// </summary> /// <returns></returns> private DataTable QueryHKCommodity(string adminId, string adminPassword, string traderId, int counterID) { try { string strMess = string.Empty; TransactionManageBLL = new ManagementCenter.BLL.UserManage.TransactionManage(); DataTable _dtTransferResult = TransactionManageBLL.AdminFindTraderCapitalAccountInfoByID( adminId, adminPassword, traderId, counterID, out strMess); if (_dtTransferResult == null || _dtTransferResult.Rows.Count == 0) { _dtTransferResult = new DataTable(); } //账号类型 ddlAccountType.DataSource = ComboBoxDataSource.GetAccountTypeList(); ddlAccountType.ValueMember = "ValueIndex"; ddlAccountType.DisplayMember = "TextTitleValue"; //币种类型 ddlCurrencyType.DataSource = ComboBoxDataSource.GetCurrencyTypeList(); ddlCurrencyType.ValueMember = "ValueIndex"; ddlCurrencyType.DisplayMember = "TextTitleValue"; return(_dtTransferResult); } catch (Exception ex) { string errCode = "GL-0376"; string errMsg = "根据查询条件,获取港股交易商品失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); return(null); } }
/// <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_UnFreeze_Click(object sender, EventArgs e) { string mess; try { string AccountID = this.txt_Account.Text.Trim(); if (!string.IsNullOrEmpty(AccountID)) { UM_DealerAccount DealerAccount = DealerAccountBLL.GetModel(string.Format(AccountID)); if (DealerAccount.UserID == int.Parse(this.txt_TranscationID.Text.Trim()) && DealerAccount.IsDo == false) { DealerAccount.IsDo = true; UM_ThawReason ThawReason = new UM_ThawReason(); ThawReason.DealerAccoutID = DealerAccount.DealerAccoutID; ThawReason.ThawReason = this.txt_Reason.Text.Trim(); ThawReason.ThawReasonTime = System.DateTime.Now; ManagementCenter.BLL.UserManage.TransactionManage tm = new ManagementCenter.BLL.UserManage.TransactionManage(); if (!tm.ThawAccount(DealerAccount, ThawReason, out mess)) { ShowMessageBox.ShowInformation(mess); return; } InitAccountListByUserID(DealerAccount.UserID, ViewAccount.FocusedRowHandle); } } } catch (Exception ex) { string errCode = "GL-0356"; string errMsg = "解冻失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), ex); ShowMessageBox.ShowInformation(exception.ToString()); return; } }
/// <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 btn_Freeze_Click(object sender, EventArgs e) { string mess; try { string AccountID = this.txt_Account.Text.Trim(); UM_DealerAccount DealerAccount = DealerAccountBLL.GetModel(AccountID); if (DealerAccount == null) { return; } UM_DealerAccount Account = DealerAccountBLL.GetModelByUserIDAndType(int.Parse(this.txt_TranscationID.Text.Trim()), (int)GTA.VTS.Common.CommonObject.Types.AccountAttributionType.BankAccount); if (DealerAccount.DealerAccoutID == Account.DealerAccoutID) { ShowMessageBox.ShowInformation("银行帐号不允许冻结!"); return; } if (DealerAccount.UserID == int.Parse(this.txt_TranscationID.Text.Trim()) && DealerAccount.IsDo == true) { DealerAccount.IsDo = false; UM_FreezeReason FreezeReason = new UM_FreezeReason(); FreezeReason.DealerAccoutID = DealerAccount.DealerAccoutID; FreezeReason.FreezeReason = this.txt_Reason.Text.Trim(); FreezeReason.FreezeReasonTime = System.DateTime.Now; if (chk_IsAutoRelieve.Enabled == true && this.chk_IsAutoRelieve.Checked == true) { if (this.dateEdit1.DateTime > System.DateTime.Now) { FreezeReason.IsAuto = (int)Types.IsAutoUnFreezeEnum.Auto; FreezeReason.ThawReasonTime = this.dateEdit1.DateTime; } else { ShowMessageBox.ShowInformation("时间设置有误,必须大于当前时间!"); return; } } ManagementCenter.BLL.UserManage.TransactionManage tm = new ManagementCenter.BLL.UserManage.TransactionManage(); if (!tm.FreezeAccount(DealerAccount, FreezeReason, out mess)) { ShowMessageBox.ShowInformation(mess); return; } InitAccountListByUserID(DealerAccount.UserID, ViewAccount.FocusedRowHandle); } } catch (Exception ex) { string errCode = "GL-0355"; string errMsg = "冻结失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), ex); ShowMessageBox.ShowInformation(exception.ToString()); return; } }
/// <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; } }
/// <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); } }