/// <summary>
        /// 
        /// </summary>
        /// <param name="IGroupSecurityID"></param>
        /// <returns></returns>
        internal Business.IGroupSecurity GetIGroupSecurityByID(int IGroupSecurityID)
        {
            Business.IGroupSecurity Result = new Business.IGroupSecurity();
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.IGroupSecurityTableAdapter adap = new DSTableAdapters.IGroupSecurityTableAdapter();
            DS.IGroupSecurityDataTable tbIGroupSecurity = new DS.IGroupSecurityDataTable();

            try
            {
                conn.Open();
                adap.Connection = conn;
                tbIGroupSecurity = adap.GetIGroupSecurityByIGroupSecurityID(IGroupSecurityID);

                if (tbIGroupSecurity != null)
                {
                    Result.IGroupSecurityID = tbIGroupSecurity[0].IGroupSecurityID;
                    Result.InvestorGroupID = tbIGroupSecurity[0].InvestorGroupID;
                    Result.SecurityID = tbIGroupSecurity[0].SecurityID;
                    Result.IGroupSecurityConfig = DBWIGroupSecurity.DBWIGroupSecurityConfigInstance.GetIGroupSecurityConfigByIGroupSecurity(tbIGroupSecurity[0].IGroupSecurityID);
                }
            }
            catch (Exception ex)
            {
                return null;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }

            return Result;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="SecurityID"></param>
        /// <returns></returns>
        internal List<Business.IGroupSecurity> GetIGroupSecurityBySecurityID(int SecurityID)
        {
            List<Business.IGroupSecurity> Result = new List<Business.IGroupSecurity>();
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.IGroupSecurityTableAdapter adap = new DSTableAdapters.IGroupSecurityTableAdapter();
            DS.IGroupSecurityDataTable tbIGroupSecurity = new DS.IGroupSecurityDataTable();
            try
            {
                conn.Open();
                adap.Connection = conn;
                tbIGroupSecurity = adap.GetIGroupSecurityByInvestorGroupID(SecurityID);
                if (tbIGroupSecurity != null)
                {
                    int count = tbIGroupSecurity.Count;
                    for (int i = 0; i < count; i++)
                    {
                        Business.IGroupSecurity newParameterItem = new Business.IGroupSecurity();
                        newParameterItem.IGroupSecurityID = tbIGroupSecurity[i].IGroupSecurityID;
                        newParameterItem.SecurityID = tbIGroupSecurity[i].SecurityID;
                        newParameterItem.InvestorGroupID = tbIGroupSecurity[i].InvestorGroupID;
                        newParameterItem.IGroupSecurityConfig = DBWIGroupSecurity.DBWIGroupSecurityConfigInstance.GetIGroupSecurityConfigByIGroupSecurity(tbIGroupSecurity[i].IGroupSecurityID);

                        Result.Add(newParameterItem);
                    }
                }
            }
            catch (Exception ex)
            {
                return null;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }
            return Result;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        internal List<Business.IGroupSecurity> GetAllIGroupSecurity()
        {
            List<Business.IGroupSecurity> Result = new List<Business.IGroupSecurity>();
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.IGroupSecurityTableAdapter adap = new DSTableAdapters.IGroupSecurityTableAdapter();
            DSTableAdapters.IGroupSecurityConfigTableAdapter adapIGroupSecurityConfig = new DSTableAdapters.IGroupSecurityConfigTableAdapter();
            DS.IGroupSecurityDataTable tbIGroupSecurity = new DS.IGroupSecurityDataTable();
            DS.IGroupSecurityConfigDataTable tbIGroupSecurityConfig = new DS.IGroupSecurityConfigDataTable();

            try
            {
                conn.Open();
                adap.Connection = conn;
                adapIGroupSecurityConfig.Connection = conn;
                tbIGroupSecurity= adap.GetData();

                if (tbIGroupSecurity != null)
                {
                    int count = tbIGroupSecurity.Count;
                    for (int i = 0; i < count; i++)
                    {
                        Business.IGroupSecurity newIGroupSymbol = new Business.IGroupSecurity();
                        newIGroupSymbol.IGroupSecurityID = tbIGroupSecurity[i].IGroupSecurityID;
                        newIGroupSymbol.InvestorGroupID = tbIGroupSecurity[i].InvestorGroupID;
                        newIGroupSymbol.SecurityID = tbIGroupSecurity[i].SecurityID;

                        tbIGroupSecurityConfig = adapIGroupSecurityConfig.GetIGroupSecurityConfigByIGroupSecurity(tbIGroupSecurity[i].IGroupSecurityID);
                        //newIGroupSymbol.IGroupSecurityConfig = DBWIGroupSecurity.DBWIGroupSecurityConfigInstance.GetIGroupSecurityConfigByIGroupSecurity(tbIGroupSecurity[i].IGroupSecurityID);

                        if (tbIGroupSecurityConfig != null)
                        {
                            int countIGroupSecurityConfig = tbIGroupSecurityConfig.Count;
                            for (int j = 0; j < countIGroupSecurityConfig; j++)
                            {
                                Business.ParameterItem newParameter = new Business.ParameterItem();
                                newParameter.BoolValue = tbIGroupSecurityConfig[j].BoolValue;
                                newParameter.Code = tbIGroupSecurityConfig[j].Code;
                                newParameter.DateValue = tbIGroupSecurityConfig[j].DateValue;
                                newParameter.NumValue = tbIGroupSecurityConfig[j].NumValue;
                                newParameter.ParameterItemID = tbIGroupSecurityConfig[j].IGroupSecurityConfigID;
                                newParameter.SecondParameterID = tbIGroupSecurityConfig[j].IGroupSecurityID;
                                newParameter.StringValue = tbIGroupSecurityConfig[j].StringValue;

                                if (newIGroupSymbol.IGroupSecurityConfig == null)
                                    newIGroupSymbol.IGroupSecurityConfig = new List<Business.ParameterItem>();

                                newIGroupSymbol.IGroupSecurityConfig.Add(newParameter);
                            }
                        }

                        Result.Add(newIGroupSymbol);
                    }
                }
            }
            catch (Exception ex)
            {
                return null;
            }
            finally
            {
                adap.Connection.Close();
                adapIGroupSecurityConfig.Connection.Close();
                conn.Close();
            }

            return Result;
        }