/// <summary> /// /// </summary> /// <param name="IGroupSymbolID"></param> /// <returns></returns> internal Business.IGroupSymbol GetIGroupSymbolByIGroupSymbolID(int IGroupSymbolID) { Business.IGroupSymbol Result = new Business.IGroupSymbol(); System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection); DSTableAdapters.IGroupSymbolTableAdapter adap = new DSTableAdapters.IGroupSymbolTableAdapter(); DS.IGroupSymbolDataTable tbIGroupSymbol = new DS.IGroupSymbolDataTable(); try { conn.Open(); adap.Connection = conn; tbIGroupSymbol = adap.GetIGroupSymbolByIGroupSymbolID(IGroupSymbolID); if (tbIGroupSymbol != null) { Result.IGroupSymbolID = tbIGroupSymbol[0].IGroupSymbolID; Result.InvestorGroupID = tbIGroupSymbol[0].InvestorGroupID; Result.SymbolID = tbIGroupSymbol[0].SymbolID; } } catch (Exception ex) { return null; } finally { adap.Connection.Close(); conn.Close(); } return Result; }
/// <summary> /// /// </summary> /// <param name="SymbolID"></param> /// <returns></returns> internal List<Business.IGroupSymbol> GetIGroupSymbolBySymbolID(int SymbolID) { List<Business.IGroupSymbol> Result = new List<Business.IGroupSymbol>(); System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection); DSTableAdapters.IGroupSymbolTableAdapter adap = new DSTableAdapters.IGroupSymbolTableAdapter(); DS.IGroupSymbolDataTable tbIGroupSymbol = new DS.IGroupSymbolDataTable(); try { conn.Open(); adap.Connection = conn; tbIGroupSymbol = adap.GetIGroupSymbolByIGroupSymbolID(SymbolID); if (tbIGroupSymbol != null) { int count = tbIGroupSymbol.Count; for (int i = 0; i < count; i++) { Business.IGroupSymbol newIGroupSymbol = new Business.IGroupSymbol(); newIGroupSymbol.IGroupSymbolID = tbIGroupSymbol[i].IGroupSymbolID; newIGroupSymbol.InvestorGroupID = tbIGroupSymbol[i].InvestorGroupID; newIGroupSymbol.SymbolID = tbIGroupSymbol[i].SymbolID; Result.Add(newIGroupSymbol); } } } catch (Exception ex) { return null; } finally { adap.Connection.Close(); conn.Close(); } return Result; }
/// <summary> /// /// </summary> /// <returns></returns> internal List<Business.IGroupSymbol> GetAllIGroupSymbol() { List<Business.IGroupSymbol> Result = new List<Business.IGroupSymbol>(); System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection); DSTableAdapters.IGroupSymbolTableAdapter adap = new DSTableAdapters.IGroupSymbolTableAdapter(); DSTableAdapters.IGroupSymbolConfigTableAdapter adapIGroupSymbolConfig = new DSTableAdapters.IGroupSymbolConfigTableAdapter(); DS.IGroupSymbolDataTable tbIGroupSymbol = new DS.IGroupSymbolDataTable(); DS.IGroupSymbolConfigDataTable tbIGroupSymbolConfig = new DS.IGroupSymbolConfigDataTable(); try { conn.Open(); adap.Connection = conn; adapIGroupSymbolConfig.Connection = conn; tbIGroupSymbol = adap.GetData(); if (tbIGroupSymbol != null) { int count = tbIGroupSymbol.Count; for (int i = 0; i < count; i++) { Business.IGroupSymbol newIGroupSymbol = new Business.IGroupSymbol(); newIGroupSymbol.IGroupSymbolID = tbIGroupSymbol[i].IGroupSymbolID; newIGroupSymbol.SymbolID = tbIGroupSymbol[i].SymbolID; newIGroupSymbol.InvestorGroupID = tbIGroupSymbol[i].InvestorGroupID; tbIGroupSymbolConfig = adapIGroupSymbolConfig.GetIGroupSymbolConfigByIGroupSymbolID(tbIGroupSymbol[i].IGroupSymbolID); if (tbIGroupSymbolConfig != null) { int countIGroupSymbolConfig = tbIGroupSymbolConfig.Count; for (int j = 0; j < countIGroupSymbolConfig; j++) { Business.ParameterItem newParameterItem = new Business.ParameterItem(); newParameterItem.ParameterItemID = tbIGroupSymbolConfig[j].IGroupSymbolConfigID; newParameterItem.SecondParameterID = tbIGroupSymbolConfig[j].IGroupSymbolID; newParameterItem.CollectionValue = new List<Business.ParameterItem>(); newParameterItem.Name = tbIGroupSymbolConfig[j].Name; newParameterItem.Code = tbIGroupSymbolConfig[j].Code; newParameterItem.BoolValue = tbIGroupSymbolConfig[j].BoolValue; newParameterItem.StringValue = tbIGroupSymbolConfig[j].StringValue; newParameterItem.NumValue = tbIGroupSymbolConfig[j].NumValue; newParameterItem.DateValue = tbIGroupSymbolConfig[j].DateValue; if (newIGroupSymbol.IGroupSymbolConfig == null) newIGroupSymbol.IGroupSymbolConfig = new List<Business.ParameterItem>(); newIGroupSymbol.IGroupSymbolConfig.Add(newParameterItem); } } //newIGroupSymbol.IGroupSymbolConfig = TradingServer.Facade.FacadeGetIGroupSymbolConfigByIGroupSymbolID(tbIGroupSymbol[i].IGroupSymbolID); Result.Add(newIGroupSymbol); } } } catch (Exception ex) { return null; } finally { adap.Connection.Close(); conn.Close(); } return Result; }