Exemplo n.º 1
0
 private void LoadSectorInfomation(DataSet dsInvestor)
 {
     try
     {
         if (dsInvestor.Tables.Contains("SectorInformation") && dsInvestor.Tables["SectorInformation"].Rows.Count > 0)
         {
             foreach (DataRow dataRow in dsInvestor.Tables["SectorInformation"].Rows)
             {
                 IndexStat.IndexItem indexItem = new IndexStat.IndexItem();
                 indexItem.Symbol = dataRow["sector_symbol"].ToString().Trim();
                 indexItem.Fullname = dataRow["sector_name"].ToString().Trim();
                 int number;
                 int.TryParse(dataRow["sector_number"].ToString(), out number);
                 indexItem.Number = number;
                 decimal num;
                 decimal.TryParse(dataRow["index_prior"].ToString(), out num);
                 indexItem.Prior = num;
                 decimal.TryParse(dataRow["index_value"].ToString(), out num);
                 indexItem.LastIndex = num;
                 decimal.TryParse(dataRow["accvalue"].ToString(), out num);
                 indexItem.AccValue = num;
                 decimal.TryParse(dataRow["index_high"].ToString(), out num);
                 indexItem.IndexHigh = num;
                 decimal.TryParse(dataRow["index_low"].ToString(), out num);
                 indexItem.IndexLow = num;
                 string symbol = indexItem.Symbol;
                 if (symbol == null)
                 {
                     goto IL_1F8;
                 }
                 if (!(symbol == ".SET") && !(symbol == ".SET50") && !(symbol == ".SET100") && !(symbol == ".SETHD") && !(symbol == ".MAI"))
                 {
                     goto IL_1F8;
                 }
                 indexItem.Type = "E";
                 IL_209:
                 indexItem.IsMainMarket = (indexItem.Symbol.IndexOf("-ms") == -1);
                 ApplicationInfo.IndexStatInfo.Items.Add(indexItem);
                 continue;
                 IL_1F8:
                 indexItem.Type = "S";
                 goto IL_209;
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
 private void LoadIndustrialInfomation(DataSet dsInvestor)
 {
     try
     {
         if (dsInvestor.Tables.Contains("IndustryInformation") && dsInvestor.Tables["IndustryInformation"].Rows.Count > 0)
         {
             foreach (DataRow dataRow in dsInvestor.Tables["IndustryInformation"].Rows)
             {
                 IndexStat.IndexItem indexItem = new IndexStat.IndexItem();
                 int number;
                 int.TryParse(dataRow["industry_number"].ToString(), out number);
                 indexItem.Number = number;
                 indexItem.Symbol = dataRow["industry_symbol"].ToString().Trim();
                 indexItem.Fullname = dataRow["industry_name"].ToString().Trim();
                 decimal prior;
                 decimal.TryParse(dataRow["index_prior"].ToString(), out prior);
                 indexItem.Prior = prior;
                 indexItem.Type = "I";
                 ApplicationInfo.IndexStatInfo.Items.Add(indexItem);
             }
         }
     }
     catch (Exception ex)
     {
         this.ShowError("LoadIndustrialInfomation", ex);
     }
 }