Example #1
0
 public static List <FileAttachment> GetListByItem(Guid itemGuid)
 {
     using (IDataReader reader = DBFileAttachment.SelectByItem(itemGuid))
     {
         return(LoadListFromReader(reader));
     }
 }
Example #2
0
 public static List <FileAttachment> GetListByModule(Guid moduleGuid)
 {
     using (IDataReader reader = DBFileAttachment.SelectByModule(moduleGuid))
     {
         return(LoadListFromReader(reader));
     }
 }
Example #3
0
        /// <summary>
        /// Persists a new instance of FileAttachment. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            this.rowGuid = Guid.NewGuid();
            if (this.serverFileName.Length == 0)
            {
                this.serverFileName = rowGuid.ToString() + ".config";
            }

            int rowsAffected = DBFileAttachment.Create(
                this.rowGuid,
                this.siteGuid,
                this.moduleGuid,
                this.itemGuid,
                this.specialGuid1,
                this.specialGuid2,
                this.serverFileName,
                this.fileName,
                this.contentTitle,
                this.contentLength,
                this.contentType,
                this.createdUtc,
                this.createdBy);

            return(rowsAffected > 0);
        }
Example #4
0
 /// <summary>
 /// Gets an instance of FileAttachment.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 private void GetFileAttachment(Guid rowGuid)
 {
     using (IDataReader reader = DBFileAttachment.GetOne(rowGuid))
     {
         PopulateFromReader(reader);
     }
 }
 /// <summary>
 /// Updates this instance of FileAttachment. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private bool Update()
 {
     return(DBFileAttachment.Update(
                this.rowGuid,
                this.serverFileName,
                this.fileName));
 }
Example #6
0
 /// <summary>
 /// Updates this instance of FileAttachment. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private bool Update()
 {
     return(DBFileAttachment.Update(
                this.rowGuid,
                this.serverFileName,
                this.fileName,
                this.contentTitle,
                this.contentLength,
                this.contentType));
 }
Example #7
0
 public static IDataReader SelectBySpecial2(Guid specialGuid2)
 {
     return(DBFileAttachment.SelectBySpecial2(specialGuid2));
 }
Example #8
0
 public static IDataReader SelectByItem(Guid itemGuid)
 {
     return(DBFileAttachment.SelectByItem(itemGuid));
 }
Example #9
0
 /// <summary>
 /// Gets an IDataReader with row sfrom the mp_FileAttachment table.
 /// </summary>
 /// <param name="moduleGuid"> moduleGuid </param>
 public static IDataReader SelectByModule(Guid moduleGuid)
 {
     return(DBFileAttachment.SelectByModule(moduleGuid));
 }
Example #10
0
 /// <summary>
 /// Deletes rows from the mp_FileAttachment table. Returns true if row deleted.
 /// </summary>
 public static bool DeleteByItem(Guid itemGuid)
 {
     return(DBFileAttachment.DeleteByItem(itemGuid));
 }
Example #11
0
 /// <summary>
 /// Deletes rows from the mp_FileAttachment table. Returns true if row deleted.
 /// </summary>
 public static bool DeleteByModule(Guid moduleGuid)
 {
     return(DBFileAttachment.DeleteByModule(moduleGuid));
 }
Example #12
0
 /// <summary>
 /// Deletes rows from the mp_FileAttachment table. Returns true if row deleted.
 /// </summary>
 public static bool DeleteBySite(Guid siteGuid)
 {
     return(DBFileAttachment.DeleteBySite(siteGuid));
 }
Example #13
0
 /// <summary>
 /// Deletes an instance of FileAttachment. Returns true on success.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 /// <returns>bool</returns>
 public static bool Delete(Guid rowGuid)
 {
     return(DBFileAttachment.Delete(rowGuid));
 }