Exemplo n.º 1
0
        /// <summary>
        /// Returns a list of objects which match the values for the fields specified.
        /// </summary>
        /// <param name="MailMessageStatus">A field value to be matched.</param>
        /// <returns>The list of MailMessageDAO objects found.</returns>
        public MailMessageList FindByStatus(MailMessageStatusEnum mailMessageStatus)
        {
            OrderByClause sort   = new OrderByClause("MailMessageStatus");
            SqlFilter     filter = new SqlFilter();

            filter.And(new SqlEqualityPredicate("MailMessageStatus", EqualityOperatorEnum.Equal, mailMessageStatus.DBValue));
            IDataReader dataReader = GetListReader(CONNECTION_STRING_KEY, VIEW, filter, null);

            return(GetList(dataReader));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Builds a data object from the current row in a data reader..
 /// </summary>
 /// <param name="dataReader">Container for database row.</param>
 /// <returns>Data object built from current row.</returns>
 internal static MailMessage GetDataObjectFromReader(MailMessage data, IDataReader dataReader, String prefix, ColumnOrdinals ordinals)
 {
     if (dataReader.IsDBNull(ordinals.MailMessageId))
     {
         data.MailMessageId = IdType.UNSET;
     }
     else
     {
         data.MailMessageId = new IdType(dataReader.GetInt32(ordinals.MailMessageId));
     }
     if (dataReader.IsDBNull(ordinals.ScheduleTime))
     {
         data.ScheduleTime = DateTimeType.UNSET;
     }
     else
     {
         data.ScheduleTime = new DateTimeType(dataReader.GetDateTime(ordinals.ScheduleTime));
     }
     if (dataReader.IsDBNull(ordinals.ProcessedTime))
     {
         data.ProcessedTime = DateTimeType.UNSET;
     }
     else
     {
         data.ProcessedTime = new DateTimeType(dataReader.GetDateTime(ordinals.ProcessedTime));
     }
     if (dataReader.IsDBNull(ordinals.Priority))
     {
         data.Priority = MailPriorityEnum.UNSET;
     }
     else
     {
         data.Priority = MailPriorityEnum.GetInstance(dataReader.GetString(ordinals.Priority));
     }
     if (dataReader.IsDBNull(ordinals.From))
     {
         data.From = StringType.UNSET;
     }
     else
     {
         data.From = StringType.Parse(dataReader.GetString(ordinals.From));
     }
     if (dataReader.IsDBNull(ordinals.To))
     {
         data.To = StringType.UNSET;
     }
     else
     {
         data.To = StringType.Parse(dataReader.GetString(ordinals.To));
     }
     if (dataReader.IsDBNull(ordinals.Cc))
     {
         data.Cc = StringType.UNSET;
     }
     else
     {
         data.Cc = StringType.Parse(dataReader.GetString(ordinals.Cc));
     }
     if (dataReader.IsDBNull(ordinals.Bcc))
     {
         data.Bcc = StringType.UNSET;
     }
     else
     {
         data.Bcc = StringType.Parse(dataReader.GetString(ordinals.Bcc));
     }
     if (dataReader.IsDBNull(ordinals.Subject))
     {
         data.Subject = StringType.UNSET;
     }
     else
     {
         data.Subject = StringType.Parse(dataReader.GetString(ordinals.Subject));
     }
     if (dataReader.IsDBNull(ordinals.BodyFormat))
     {
         data.BodyFormat = MailBodyFormatEnum.UNSET;
     }
     else
     {
         data.BodyFormat = MailBodyFormatEnum.GetInstance(dataReader.GetString(ordinals.BodyFormat));
     }
     if (dataReader.IsDBNull(ordinals.Body))
     {
         data.Body = StringType.UNSET;
     }
     else
     {
         data.Body = StringType.Parse(dataReader.GetString(ordinals.Body));
     }
     if (dataReader.IsDBNull(ordinals.MailMessageStatus))
     {
         data.MailMessageStatus = MailMessageStatusEnum.UNSET;
     }
     else
     {
         data.MailMessageStatus = MailMessageStatusEnum.GetInstance(dataReader.GetString(ordinals.MailMessageStatus));
     }
     if (dataReader.IsDBNull(ordinals.ReleasedByUserId))
     {
         data.ReleasedByUserId = IdType.UNSET;
     }
     else
     {
         data.ReleasedByUserId = new IdType(dataReader.GetInt32(ordinals.ReleasedByUserId));
     }
     if (dataReader.IsDBNull(ordinals.MailMessageType))
     {
         data.MailMessageType = StringType.UNSET;
     }
     else
     {
         data.MailMessageType = StringType.Parse(dataReader.GetString(ordinals.MailMessageType));
     }
     if (dataReader.IsDBNull(ordinals.NumberOfAttempts))
     {
         data.NumberOfAttempts = IntegerType.UNSET;
     }
     else
     {
         data.NumberOfAttempts = new IntegerType(dataReader.GetInt32(ordinals.NumberOfAttempts));
     }
     if (dataReader.IsDBNull(ordinals.MessageQueueDate))
     {
         data.MessageQueueDate = DateTimeType.UNSET;
     }
     else
     {
         data.MessageQueueDate = new DateTimeType(dataReader.GetDateTime(ordinals.MessageQueueDate));
     }
     return(data);
 }