private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (dataGridView1.Columns[e.ColumnIndex].Name == "方向") { int int1 = (int)e.Value; 交易方向 交易方向1 = (交易方向)int1; e.Value = 交易方向1.ToString(); } else if (dataGridView1.Columns[e.ColumnIndex].Name == "价格模式") { int int1 = (int)e.Value; 价格模式 价格模式1 = (价格模式)int1; e.Value = 价格模式1.ToString(); } else if (dataGridView1.Columns[e.ColumnIndex].Name == "价差模式") { int int1 = (int)e.Value; 价差模式 价差模式1 = (价差模式)int1; e.Value = 价差模式1.ToString(); } else if (dataGridView1.Columns[e.ColumnIndex].Name == "股数模式") { int int1 = (int)e.Value; 股数模式 股数模式1 = (股数模式)int1; e.Value = 股数模式1.ToString(); } }
private void SetInfo(AASClient.AccountDataSet.快捷键Row 快捷键Row1) { decimal BasePrice = 0; 价格模式 价格模式1 = (价格模式)快捷键Row1.价格模式; BasePrice = GetPrice(价格模式1, listView买盘, listView卖盘); if (价格模式1 == 价格模式.处理) { this.numericUpDown价格.Value = 0; } else { 价差模式 价差模式1 = (价差模式)快捷键Row1.价差模式; switch (价差模式1) { case 价差模式.百分之: this.numericUpDown价格.Value = Math.Round(BasePrice * (1 + 快捷键Row1.价差数值 / 100), 8, MidpointRounding.AwayFromZero); break; case 价差模式.数值: this.numericUpDown价格.Value = Math.Round(BasePrice + 快捷键Row1.价差数值, 8, MidpointRounding.AwayFromZero); break; } } }