private void 修改交易额度ToolStripMenuItem_Click(object sender, EventArgs e) { AASClient.AASServiceReference.DbDataSet.额度分配Row DataRow1 = (this.bindingSource交易额度.Current as DataRowView).Row as AASClient.AASServiceReference.DbDataSet.额度分配Row; ModifyTradeLimitForm ModifyTradeLimitForm1 = new ModifyTradeLimitForm(DataRow1); DialogResult DialogResult1 = ModifyTradeLimitForm1.ShowDialog(); if (DialogResult1 != System.Windows.Forms.DialogResult.OK) { return; } this.bindingSource交易额度.DataSource = Program.AASServiceClient.QueryTradeLimit(); }
private void btnSendOrder_Click(object sender, EventArgs e) { decimal qtyMin, priceMin, notionMin; MarketAdapter.BinanceAdapter.Instance.GetFilter(Zqdm, out priceMin, out qtyMin, out notionMin); if (numericUpDown数量.Value % qtyMin > 0) { Program.logger.LogInfo(string.Format("下单数量{0}与数量最小单位{1}余数为{2},请修正后再下单!", numericUpDown数量.Value, qtyMin, numericUpDown数量.Value % qtyMin)); } if (numericUpDown价格.Value % priceMin > 0) { Program.logger.LogInfo(string.Format("下单价格{0}与价格最小单位{1}余数为{2},请修正后再下单!", numericUpDown价格.Value, priceMin, numericUpDown价格.Value % priceMin)); } if ((numericUpDown数量.Value * numericUpDown价格.Value) < notionMin) { Program.logger.LogInfo(string.Format("价格与数量乘积小于金额最小值,价格{0} * 数量{1} = {2},金额最小值{3}", numericUpDown价格.Value, numericUpDown数量.Value, numericUpDown价格.Value * numericUpDown数量.Value, notionMin)); } if (this.btnSendOrder.Enabled) { lock (sync) { if (this.btnSendOrder.Enabled) { this.btnSendOrder.Enabled = false; this.btnSendOrder.Text = "下单中……"; AASClient.AASServiceReference.DbDataSet.额度分配Row 交易额度Row1 = Program.serverDb.额度分配.FirstOrDefault(r => r.证券代码 == this.Zqdm); decimal 委托价格 = Math.Round(this.numericUpDown价格.Value, 8, MidpointRounding.AwayFromZero); decimal 委托数量 = Math.Round(this.numericUpDown数量.Value, 4, MidpointRounding.AwayFromZero); SendOrder(交易额度Row1 == null ? "" : 交易额度Row1.证券名称, 委托价格, 委托数量); } } } }
private void dataGridView交易额度_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) { return; } AASClient.AASServiceReference.DbDataSet.额度分配Row DataRow1 = (this.bindingSource交易额度.Current as DataRowView).Row as AASClient.AASServiceReference.DbDataSet.额度分配Row; ModifyTradeLimitForm ModifyTradeLimitForm1 = new ModifyTradeLimitForm(DataRow1); DialogResult DialogResult1 = ModifyTradeLimitForm1.ShowDialog(); if (DialogResult1 != System.Windows.Forms.DialogResult.OK) { return; } this.bindingSource交易额度.DataSource = Program.AASServiceClient.QueryTradeLimit(); }
public ModifyTradeLimitForm(AASClient.AASServiceReference.DbDataSet.额度分配Row TradeLimit1) { InitializeComponent(); this.额度分配 = TradeLimit1; }