/// <summary> /// 根据查询条件,获取现货交易规则 /// </summary> /// <returns></returns> private bool QuerySpotTradeRules() { try { string breedClassName = this.txtBreeClassName.Text; DataSet _dsSpotTradeRules = SpotManageCommon.GetAllSpotTradeRules(breedClassName, m_pageNo, m_pageSize, out m_rowCount); DataTable _dtSpotTradeRule; if (_dsSpotTradeRules == null || _dsSpotTradeRules.Tables[0].Rows.Count == 0) { _dtSpotTradeRule = new DataTable(); } else { _dtSpotTradeRule = _dsSpotTradeRules.Tables[0]; } //绑定品种名称 this.ddlBreedClassID.DataSource = SpotManageCommon.GetBreedClassNameByBreedClassID().Tables[0]; this.ddlBreedClassID.ValueMember = SpotManageCommon.GetBreedClassNameByBreedClassID().Tables[0].Columns["BreedClassID"].ToString(); this.ddlBreedClassID.DisplayMember = SpotManageCommon.GetBreedClassNameByBreedClassID().Tables[0].Columns["BreedClassName"].ToString(); this.gdSpotTradeRulesQResult.DataSource = _dtSpotTradeRule; //设置GridView显示效果 foreach (DevExpress.XtraGrid.Columns.GridColumn _gridColumn in this.gdvSpotTradeRulesSelect.Columns) { //switch (_gridColumn.FieldName.ToUpper()) //{ // case "VALUETYPEMINCHANGEPRICE": // _gridColumn.Width = 90; // break; //} _gridColumn.Width = this.gdSpotTradeRulesQResult.Size.Width / this.gdvSpotTradeRulesSelect.Columns.Count + 6; } } catch (Exception ex) { string errCode = "GL-5025"; string errMsg = "根据查询条件,获取现货交易规则失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); throw exception; } return(true); }
//================================ 事件 ================================ #region 现货交易规则管理UI SpotTradeRulesManageUI_Load /// <summary> /// 现货交易规则管理UI SpotTradeRulesManageUI_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SpotTradeRulesManageUI_Load(object sender, EventArgs e) { try { //绑定最小变动价位 this.ddlValueTypeMinChangePrice.DataSource = BindData.GetBindListValueType(); this.ddlValueTypeMinChangePrice.ValueMember = "ValueIndex"; this.ddlValueTypeMinChangePrice.DisplayMember = "TextTitleValue"; //绑定每笔最大委托量单位 this.ddlMaxLeaveQuantityUnit.DataSource = BindData.GetBindListXHAboutUnit(); this.ddlMaxLeaveQuantityUnit.ValueMember = "ValueIndex"; this.ddlMaxLeaveQuantityUnit.DisplayMember = "TextTitleValue"; //绑定是否允许回转 this.ddlIsSlew.DataSource = BindData.GetBindListYesOrNo(); this.ddlIsSlew.ValueMember = "ValueIndex"; this.ddlIsSlew.DisplayMember = "TextTitleValue"; //绑定行情成交量单位 this.ddlMarketUnitID.DataSource = BindData.GetBindListXHAboutUnit(); this.ddlMarketUnitID.ValueMember = "ValueIndex"; this.ddlMarketUnitID.DisplayMember = "TextTitleValue"; //绑定计价单位 this.ddlPriceUnit.DataSource = BindData.GetBindListXHAboutUnit(); this.ddlPriceUnit.ValueMember = "ValueIndex"; this.ddlPriceUnit.DisplayMember = "TextTitleValue"; //绑定品种名称 this.ddlBreedClassID.DataSource = SpotManageCommon.GetBreedClassNameByBreedClassID().Tables[0]; this.ddlBreedClassID.ValueMember = SpotManageCommon.GetBreedClassNameByBreedClassID().Tables[0].Columns["BreedClassID"].ToString(); this.ddlBreedClassID.DisplayMember = SpotManageCommon.GetBreedClassNameByBreedClassID().Tables[0].Columns["BreedClassName"].ToString(); //绑定查询结果 this.m_pageNo = 1; this.gdSpotTradeRulesQResult.DataSource = this.QuerySpotTradeRules(); this.ShowDataPage(); } catch (Exception ex) { string errCode = "GL-5020"; string errMsg = " 现货交易规则管理UI加载失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); } }