Exemple #1
0
 private static void WriteInsertAttachmentCollection(TextWriter writer, EmailAttachmentCollection attachments, string messageID)
 {
     for (int i = 0; i < attachments.Count; i++)
     {
         WriteInsertAttachmentSql(writer, attachments[i], messageID, i);
     }
 }
Exemple #2
0
        internal EmailAttachmentCollection LoadAttachments(string messageID)
        {
            WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder();

            builder.AppendItem("MESSAGE_ID", messageID);
            builder.AppendTenantCode();

            string sql = string.Format("SELECT * FROM MSG.EMAIL_ATTACHMENTS WHERE {0} ORDER BY SORT_ID",
                                       builder.ToSqlString(TSqlBuilder.Instance));

            EmailAttachmentCollection result = new EmailAttachmentCollection();

            ORMapping.DataViewToCollection(result,
                                           DbHelper.RunSqlReturnDS(sql, GetConnectionName()).Tables[0].DefaultView);

            return(result);
        }