Ejemplo n.º 1
0
        /// <summary>
        /// Gets a list of AttachmentInfo related to a Post
        /// </summary>
        /// <param name="PostID"></param>
        /// <returns></returns>
        /// <remarks></remarks>
        public List <AttachmentInfo> GetAllByPostID(int PostID)
        {
            List <AttachmentInfo> objAttachments = new List <AttachmentInfo>();
            IDataReader           dr             = null;

            try {
                DataProvider pro = new DotNetNuke.Modules.uDebate_Discussion.Data.DataProvider();
                dr = pro.Attachment_GetAllByPostID(PostID);
                while (dr.Read())
                {
                    AttachmentInfo objAttachment = FillAttachmentInfo(dr);
                    objAttachments.Add(objAttachment);
                }
                dr.NextResult();
            } catch (Exception ex) {
                //LogException(ex);
            } finally {
                if ((dr != null))
                {
                    dr.Close();
                }
            }

            return(objAttachments);
        }
        /// <summary>
        /// Gets a list of AttachmentInfo related to a Post
        /// </summary>
        /// <param name="PostID"></param>
        /// <returns></returns>
        /// <remarks></remarks>
        public List<AttachmentInfo> GetAllByPostID(int PostID)
        {
            List<AttachmentInfo> objAttachments = new List<AttachmentInfo>();
            IDataReader dr = null;
            try {
                DataProvider pro = new DotNetNuke.Modules.uDebate_Discussion.Data.DataProvider();
                dr = pro.Attachment_GetAllByPostID(PostID);
                while (dr.Read()) {
                    AttachmentInfo objAttachment = FillAttachmentInfo(dr);
                    objAttachments.Add(objAttachment);
                }
                dr.NextResult();

            } catch (Exception ex) {
                //LogException(ex);
            } finally {
                if ((dr != null)) {
                    dr.Close();
                }
            }

            return objAttachments;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds an AttachmentInfo object
        /// </summary>
        /// <param name="objAttachment"></param>
        /// <remarks></remarks>
        public void Update(AttachmentInfo objAttachment)
        {
            DataProvider pro = new DotNetNuke.Modules.uDebate_Discussion.Data.DataProvider();

            pro.Attachment_Update(objAttachment);
        }
 /// <summary>
 /// Adds an AttachmentInfo object
 /// </summary>
 /// <param name="objAttachment"></param>
 /// <remarks></remarks>
 public void Update(AttachmentInfo objAttachment)
 {
     DataProvider pro = new DotNetNuke.Modules.uDebate_Discussion.Data.DataProvider();
     pro.Attachment_Update(objAttachment);
 }