public bool Remove(FileAssociation fileAssocation, int activityID)
        {
            DataAccess objADO = Domain.GetADOInstance(Domain.eConnectionName.Metadata);
            ArrayList colParameters = new ArrayList();
            string strStoredProcedure = "delActivityFileAssociation";
            int intRowsAffected = 0;

            // Assemble Parameters
            colParameters.Add(new SqlParameter("@ActivityID", activityID));
            colParameters.Add(new SqlParameter("@FilePath", fileAssocation.Path));
            intRowsAffected = objADO.ExecuteSQL(strStoredProcedure, (SqlParameter[])colParameters.ToArray(typeof(SqlParameter)));
            objADO = null;

            return (intRowsAffected > 0);
        }
        /// <summary>
        /// 1. Used to work out what DB File records need to be removed post ATM changes
        /// 2. Used to get list of Files to associate with Job by WIS (JobRequestProcessor)
        /// </summary>
        /// <returns></returns>
        public FileAssociationCollection GetFileAssociations()
        {
            FileAssociationCollection fileAssociations = null;
            DataTable dtResults = null;
            FinalBuild.DataAccess objADO = Domain.GetADOInstance(Domain.eConnectionName.Metadata);
            System.Collections.ArrayList colParameters = new System.Collections.ArrayList();
            string strStoredProcedure = "selActivityFileAssociations";

            // Assemble Parameters
            colParameters.Add(new SqlParameter("@ActivityID", mintID));
            dtResults = objADO.GetDataTable(strStoredProcedure, "FileAssociations", (SqlParameter[])colParameters.ToArray(typeof(SqlParameter)));
            if (dtResults != null && dtResults.Rows.Count > 0)
            {
                FileAssociation fileMetadata = null;
                fileAssociations = new FileAssociationCollection();
                foreach (DataRow drFile in dtResults.Rows)
                {
                    fileMetadata = new FileAssociation();
                    fileMetadata.Populate(drFile);
                    fileAssociations.Add(fileMetadata);
                }
            }

            return fileAssociations;
        }
        public void LoadFileAssociations()
        {
            DataTable dtData = null;
            DataAccess objADO = new DataAccess();
            ArrayList colParameters = new ArrayList();
            string strStoredProcedure = "selJobAssociatedFiles";

            colParameters.Add(new SqlParameter("@WMSourceID", mintID));
            colParameters.Add(new SqlParameter("@WMSourceSystem", mobjSourceSystem.ToString()));
            dtData = objADO.GetDataTable(strStoredProcedure, "FileAssociations", (SqlParameter[])colParameters.ToArray(typeof(SqlParameter)));
            objADO = null;

            if (dtData != null && dtData.Rows.Count > 0)
            {
                mColFileAssociations = new FileAssociationCollection();
                FileAssociation fileMetadata = null;

                foreach (DataRow drMember in dtData.Rows)
                {
                    fileMetadata = new FileAssociation();
                    fileMetadata.Populate(drMember);
                    mColFileAssociations.Add(fileMetadata);
                }
            }
        }
        public static FileAssociationCollection LoadByUser(string userID)
        {
            FileAssociationCollection collection = null;
            DataTable dtData = null;
            DataAccess objADO = new DataAccess();
            ArrayList colParameters = new ArrayList();
            string strStoredProcedure = "selUserAssociatedFiles";

            colParameters.Add(new SqlParameter("@UserID", userID));
            dtData = objADO.GetDataTable(strStoredProcedure, "FileAssociations", (SqlParameter[])colParameters.ToArray(typeof(SqlParameter)));
            objADO = null;

            if (dtData != null && dtData.Rows.Count > 0)
            {
                collection = new FileAssociationCollection();
                FileAssociation fileMetadata = null;

                foreach (DataRow drMember in dtData.Rows)
                {
                    fileMetadata = new FileAssociation();
                    fileMetadata.Populate(drMember);
                    collection.Add(fileMetadata);
                }
            }
            return collection;
        }