/// <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> /// <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; }