public static void UpdateForNewSymbol(string Code, CommonDataProvider cdp, bool Save) { Utils.UpdateRealtime(Code, cdp); if (Save) { Impersonate.ChangeToAdmin(); cdp.SaveBinary(GetHisDataFile(Code)); } RefreshSymbolList(); string[] ss = YahooDataManager.GetStockName(Code); if (ss.Length == 3) { try { DB.DoCommand("insert into StockData (QuoteCode,QuoteName,Exchange) values (?,?,?)", new DbParam[] { new DbParam("@Code", DbType.String, Code), new DbParam("@Name", DbType.String, ss[1]), new DbParam("@Exchange", DbType.String, ss[2]), }); } catch { } } cdp.SetStringData("Code", ss[0]); cdp.SetStringData("Name", ss[1]); cdp.SetStringData("Exchange", ss[2]); }
private void miQuickAdd_Click(object sender, EventArgs e) { string text1 = InputBox.ShowInputBox("Symbol", ""); if (text1 != "") { if (StockDB.GetSymbol(text1) == null) { string[] textArray1 = YahooDataManager.GetStockName(text1); if (textArray1.Length == 3) { StockDB.LoadSymbolRow(text1, textArray1[1], textArray1[2]); StockDB.RecreateFolders(); ListForm.Current.SymbolChanged = true; ListForm.Current.RefreshList(); } } } ListForm.Current.GotoSymbol(text1); }