/// <summary> /// 绑定现货交易费用初始化数据 /// </summary> private void InitBindData() { try { //绑定现货交易费用表中的品种ID对应的品种名称 this.cmbBreedClassID.Properties.Items.Clear(); this.GetBindBreedClassName(); //获取现货交易费用表中的品种ID对应的品种名称 this.cmbBreedClassID.SelectedIndex = 0; //绑定币种类型 this.cmbCurrencyType.Properties.Items.Clear(); this.cmbCurrencyType.Properties.Items.AddRange(BindData.GetBindListCurrencyType()); this.cmbCurrencyType.SelectedIndex = 0; //绑定印花税收取方式 this.cmbStampDutyType.Properties.Items.Clear(); this.cmbStampDutyType.Properties.Items.AddRange(BindData.GetBindListStampDutyType()); this.cmbStampDutyType.SelectedIndex = 0; //绑定过户费取值类型 this.cmbTransferTollType.Properties.Items.Clear(); this.cmbTransferTollType.Properties.Items.AddRange(BindData.GetBindListXHTransferTollType()); this.cmbTransferTollType.SelectedIndex = 0; } catch (Exception ex) { string errCode = "GL-5401"; string errMsg = "绑定现货交易费用初始化数据失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); return; } }
/// <summary> /// 根据查询条件,获取品种_期货_交易费用 /// </summary> /// <returns></returns> private bool QueryQHFutureCosts() { try { string breedClassName = this.txtBreedClassID.Text; DataSet _dsQHFutureCosts = FuturesManageCommon.GetAllQHFutureCosts(breedClassName, m_pageNo, m_pageSize, out m_rowCount); DataTable _dtQHFutureCosts; if (_dsQHFutureCosts == null || _dsQHFutureCosts.Tables[0].Rows.Count == 0) { _dtQHFutureCosts = new DataTable(); } else { _dtQHFutureCosts = _dsQHFutureCosts.Tables[0]; } //绑定绑定品种类型是商品期货或股指期货的品种名称 this.ddlBreedClassID.DataSource = CommonParameterSetCommon.GetQHFutureCostsBreedClassName().Tables[0]; this.ddlBreedClassID.ValueMember = CommonParameterSetCommon.GetQHFutureCostsBreedClassName().Tables[0].Columns["BreedClassID"]. ToString(); this.ddlBreedClassID.DisplayMember = CommonParameterSetCommon.GetQHFutureCostsBreedClassName().Tables[0].Columns["BreedClassName"]. ToString(); //绑定货币类型 this.ddlCurrencyTypeID.DataSource = BindData.GetBindListCurrencyType(); this.ddlCurrencyTypeID.ValueMember = "ValueIndex"; this.ddlCurrencyTypeID.DisplayMember = "TextTitleValue"; //绑定手续费类型 this.ddlCostType.DataSource = BindData.GetBindListFutrueCostType(); this.ddlCostType.ValueMember = "ValueIndex"; this.ddlCostType.DisplayMember = "TextTitleValue"; this.gdFutureCostsResult.DataSource = _dtQHFutureCosts; } catch (Exception ex) { string errCode = "GL-6204"; string errMsg = "根据查询条件,获取品种_期货_交易费用失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); return(false); } return(true); }
/// <summary> /// 根据查询条件,获取港股交易费用 /// </summary> /// <returns></returns> private bool QueryHKCosts() { try { string breedClassName = this.txtBreedClassName.Text; DataSet _dsHKCosts = HKManageCommon.GetAllHKSpotCosts(breedClassName, m_pageNo, m_pageSize, out m_rowCount); DataTable _dtHKCosts; if (_dsHKCosts == null || _dsHKCosts.Tables[0].Rows.Count == 0) { _dtHKCosts = new DataTable(); } else { _dtHKCosts = _dsHKCosts.Tables[0]; } //绑定品种名称 this.ddlBreedClassID.DataSource = HKManageCommon.GetHKSpotCostsBreedClassName().Tables[0]; this.ddlBreedClassID.ValueMember = HKManageCommon.GetHKSpotCostsBreedClassName().Tables[0].Columns["BreedClassID"].ToString(); this.ddlBreedClassID.DisplayMember = HKManageCommon.GetHKSpotCostsBreedClassName().Tables[0].Columns["BreedClassName"].ToString(); //绑定币种类型 this.ddlCurrencyTypeID.DataSource = BindData.GetBindListCurrencyType(); this.ddlCurrencyTypeID.ValueMember = "ValueIndex"; this.ddlCurrencyTypeID.DisplayMember = "TextTitleValue"; //绑定印花税收取方式 this.ddlStampDutyTypeID.DataSource = BindData.GetBindListStampDutyType(); this.ddlStampDutyTypeID.ValueMember = "ValueIndex"; this.ddlStampDutyTypeID.DisplayMember = "TextTitleValue"; this.gdHKCostsResult.DataSource = _dtHKCosts; } catch (Exception ex) { string errCode = "GL-7801"; string errMsg = "根据查询条件,获取港股交易费用失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); throw exception; } return(true); }
//================================ 事件 ================================ #region 港股交易费UI HKCostsManageUI_Load /// <summary> /// 港股交易费UI HKCostsManageUI_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HKCostsManageUI_Load(object sender, EventArgs e) { try { //绑定港股交易费用表中的品种ID对应的品种名称 this.cmbBreedClassID.Properties.Items.Clear(); this.GetBindHKBreedClassName(); //获取港股交易费用表中的品种ID对应的品种名称 this.cmbBreedClassID.SelectedIndex = 0; //绑定币种类型 this.cmbCurrencyType.Properties.Items.Clear(); this.cmbCurrencyType.Properties.Items.AddRange(BindData.GetBindListCurrencyType()); this.cmbCurrencyType.SelectedIndex = 1; //0; //绑定印花税收取方式 this.cmbStampDutyType.Properties.Items.Clear(); this.cmbStampDutyType.Properties.Items.AddRange(BindData.GetBindListStampDutyType()); this.cmbStampDutyType.SelectedIndex = 2; //0; //绑定查询结果 this.m_pageNo = 1; this.gdHKCostsResult.DataSource = this.QueryHKCosts(); this.ShowDataPage(); //窗体加载文本框和确定按钮禁用 this.cmbBreedClassID.Enabled = false; this.cmbCurrencyType.Enabled = false; this.cmbStampDutyType.Enabled = false; this.txtStampDuty.Enabled = false; this.txtStampDutyStartpoint.Enabled = false; this.txtCommision.Enabled = false; this.txtCommisionStartpoint.Enabled = false; this.txtPoundageValue.Enabled = false; this.txtMonitoringFee.Enabled = false; this.txtSystemToll.Enabled = false; this.txtTransferToll.Enabled = false; this.btnOK.Enabled = false; } catch (Exception ex) { string errCode = "GL-7800"; string errMsg = "港股交易费用UI加载失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); } }
//================================ 事件 ================================ #region 期货交易费用管理窗体 FutureCostsManageUI_Load /// <summary> /// 期货交易费用管理窗体 FutureCostsManageUI_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FutureCostsManageUI_Load(object sender, EventArgs e) { try { //绑定品种类型是商品期货或股指期货的品种名称 this.cmbBreedClassID.Properties.Items.Clear(); this.GetBindQHFutureCostsBreedClassName(); //从交易商品品种表中获取 this.cmbBreedClassID.SelectedIndex = 0; //绑定货币类型 this.cmbCurrencyTypeID.Properties.Items.Clear(); this.cmbCurrencyTypeID.Properties.Items.AddRange(BindData.GetBindListCurrencyType()); this.cmbCurrencyTypeID.SelectedIndex = 0; //初次加载时,更新按钮禁用 //btnModify.Enabled = false; //绑定期货手续费类型 this.cmbCostType.Properties.Items.Clear(); this.cmbCostType.Properties.Items.AddRange(BindData.GetBindListFutrueCostType()); this.cmbCostType.SelectedIndex = 0; //绑定查询结果 this.m_pageNo = 1; this.gdFutureCostsResult.DataSource = this.QueryQHFutureCosts(); this.ShowDataPage(); //窗体加载时禁用文本框和确定按钮 this.cmbBreedClassID.Enabled = false; this.cmbCurrencyTypeID.Enabled = false; this.cmbCostType.Enabled = false; this.txtCost.Enabled = false; this.btnOK.Enabled = false; } catch (Exception ex) { string errCode = "GL-6200"; string errMsg = "期货交易费用管理窗体加载失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); return; } }
//================================ 事件 ================================ #region 现货交易费UI SpotCostsManageUI_Load /// <summary> /// 现货交易费UI SpotCostsManageUI_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SpotCostsManageUI_Load(object sender, EventArgs e) { try { //绑定币种类型 this.ddlCurrencyTypeID.DataSource = BindData.GetBindListCurrencyType(); this.ddlCurrencyTypeID.ValueMember = "ValueIndex"; this.ddlCurrencyTypeID.DisplayMember = "TextTitleValue"; //绑定印花税收取方式 this.ddlStampDutyTypeID.DataSource = BindData.GetBindListStampDutyType(); this.ddlStampDutyTypeID.ValueMember = "ValueIndex"; this.ddlStampDutyTypeID.DisplayMember = "TextTitleValue"; //绑定过户费取值类型 this.ddlTransferTollTypeID.DataSource = BindData.GetBindListXHTransferTollType(); this.ddlTransferTollTypeID.ValueMember = "ValueIndex"; this.ddlTransferTollTypeID.DisplayMember = "TextTitleValue"; //绑定品种名称 this.ddlBreedClassID.DataSource = SpotManageCommon.GetSpotCostsBreedClassName().Tables[0]; this.ddlBreedClassID.ValueMember = SpotManageCommon.GetSpotCostsBreedClassName().Tables[0].Columns["BreedClassID"].ToString(); this.ddlBreedClassID.DisplayMember = SpotManageCommon.GetSpotCostsBreedClassName().Tables[0].Columns["BreedClassName"].ToString(); //绑定查询结果 this.m_pageNo = 1; this.gdSpotCostsResult.DataSource = this.QuerySpotCosts(); this.ShowDataPage(); } catch (Exception ex) { string errCode = "GL-5420"; string errMsg = "现货交易费UI加载失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); } }