コード例 #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.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;
        }
コード例 #2
0
 /// <summary>
 /// Adds an AttachmentInfo object
 /// </summary>
 /// <param name="objAttachment"></param>
 /// <remarks></remarks>
 public void Update(AttachmentInfo objAttachment)
 {
     DataProvider pro = new DotNetNuke.Modules.uDebate.Data.DataProvider();
     pro.Attachment_Update(objAttachment);
 }