/// <summary>
 /// delete IAgentSecurity by securityID
 /// </summary>
 /// <param name="securityID"></param>
 /// <param name="connection"></param>
 /// <returns></returns>
 internal bool DFDeleteBySecurityID(int securityID,SqlConnection connection,SqlTransaction trans)
 {
     DSTableAdapters.IAgentSecurityTableAdapter adap = new DSTableAdapters.IAgentSecurityTableAdapter();
     adap.Connection = connection;
     adap.Transaction = trans;
     int affectRow= adap.DeleteIAgentSecurityBySecurityID(securityID);
     if (affectRow == 0)
         return false;
     else
         return true;
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="SecurityID"></param>
        /// <returns></returns>
        internal bool DeleteIAgentSecurityBySecurityID(int SecurityID)
        {
            bool Result = false;
            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;
                adap.DeleteIAgentSecurityBySecurityID(SecurityID);
                Result = true;
            }
            catch (Exception ex)
            {
                Result = false;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }

            return Result;
        }