internal int AddNewIAgentSecurityByListIAgentSecurity(List<Business.IAgentSecurity> ListIAgentSecurity)
        {
            int Result = -1;
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.IAgentSecurityTableAdapter adap = new DSTableAdapters.IAgentSecurityTableAdapter();

            try
            {
                conn.Open();
                adap.Connection = conn;
                int count = ListIAgentSecurity.Count;
                for (int i = 0; i < count; i++)
                {
                    Result = int.Parse(adap.AddIAgentSecurity(ListIAgentSecurity[i].AgentID, ListIAgentSecurity[i].SecurityID, ListIAgentSecurity[i].Use, ListIAgentSecurity[i].MinLots.ToString(), ListIAgentSecurity[i].MaxLots.ToString()).ToString());
                }

            }
            catch (Exception ex)
            {
                return -1;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }

            return Result;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="AgentID"></param>
        /// <param name="SecurityID"></param>
        /// <returns></returns>
        internal int AddNewIAgentSecurity(int AgentID, int SecurityID,bool IsUse,string MinLots,string MaxLots)
        {
            int Result = -1;
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.IAgentSecurityTableAdapter adap = new DSTableAdapters.IAgentSecurityTableAdapter();

            try
            {
                conn.Open();
                adap.Connection = conn;
                Result = int.Parse(adap.AddIAgentSecurity(AgentID, SecurityID,IsUse,MinLots,MaxLots).ToString());
            }
            catch (Exception ex)
            {
                return -1;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }

            return Result;
        }