private void timer1_Tick(object sender, EventArgs e) { if (Program.HqDataTable.ContainsKey(this.comboBox证券代码.Text)) { if (this.NeedPrice) { DataTable DataTable1 = Program.HqDataTable[this.comboBox证券代码.Text]; DataRow DataRow1 = DataTable1.Rows[0]; this.numericUpDown提示价格.Value = decimal.Parse((DataRow1["现价"] as string)); this.NeedPrice = false; } } this.label证券名称.Text = L2Api.Get名称(this.comboBox证券代码.Text); }
private void button1_Click(object sender, EventArgs e) { if (this.comboBox证券代码.Text.Length == 6 && char.IsNumber(this.comboBox证券代码.Text[0]) && char.IsNumber(this.comboBox证券代码.Text[1]) && char.IsNumber(this.comboBox证券代码.Text[2]) && char.IsNumber(this.comboBox证券代码.Text[3]) && char.IsNumber(this.comboBox证券代码.Text[4]) && char.IsNumber(this.comboBox证券代码.Text[5])) { string 证券名称 = L2Api.Get名称(this.comboBox证券代码.Text); if (TDFData.DataSourceConfig.IsUseTDFData && TDFData.DataCache.GetInstance().MarketNewDict.ContainsKey(this.comboBox证券代码.Text)) { 证券名称 = Manager.StockCodeManager.GetNameByCode(this.comboBox证券代码.Text); } if (证券名称 == string.Empty) { MessageBox.Show("未取到证券名称"); return; } AASClient.AccountDataSet.价格提示Row 价格提示Row1 = Program.accountDataSet.价格提示.New价格提示Row(); 价格提示Row1.证券代码 = this.comboBox证券代码.Text; 价格提示Row1.证券名称 = 证券名称; 价格提示Row1.提示类型 = this.comboBox提示类型.SelectedIndex; 价格提示Row1.提示价格 = Math.Round(this.numericUpDown提示价格.Value, L2Api.Get精度(this.comboBox证券代码.Text), MidpointRounding.AwayFromZero); 价格提示Row1.提示等级 = this.comboBox提示等级.SelectedIndex; 价格提示Row1.启用 = this.checkBox启用.Checked; Program.accountDataSet.价格提示.Add价格提示Row(价格提示Row1); } else { MessageBox.Show("证券代码错误"); } }