Beispiel #1
0
        ///// <summary>
        ///// Gets an instance of EmailSendQueue.
        ///// </summary>
        ///// <param name="guid"> guid </param>
        //private void GetEmailSendQueue(
        //    Guid guid)
        //{
        //    using (IDataReader reader = DBEmailSendQueue.GetOne(
        //        guid))
        //    {
        //        PopulateFromReader(reader);
        //    }

        //}


        //private void PopulateFromReader(IDataReader reader)
        //{
        //    if (reader.Read())
        //    {
        //        this.guid = new Guid(reader["Guid"].ToString());
        //        this.siteGuid = new Guid(reader["SiteGuid"].ToString());
        //        this.moduleGuid = new Guid(reader["ModuleGuid"].ToString());
        //        this.userGuid = new Guid(reader["UserGuid"].ToString());
        //        this.specialGuid1 = new Guid(reader["SpecialGuid1"].ToString());
        //        this.specialGuid2 = new Guid(reader["SpecialGuid2"].ToString());
        //        this.fromAddress = reader["FromAddress"].ToString();
        //        this.replyTo = reader["ReplyTo"].ToString();
        //        this.toAddress = reader["ToAddress"].ToString();
        //        this.ccAddress = reader["CcAddress"].ToString();
        //        this.bccAddress = reader["BccAddress"].ToString();
        //        this.subject = reader["Subject"].ToString();
        //        this.textBody = reader["TextBody"].ToString();
        //        this.htmlBody = reader["HtmlBody"].ToString();
        //        this.type = reader["Type"].ToString();
        //        this.dateToSend = Convert.ToDateTime(reader["DateToSend"]);
        //        this.createdUtc = Convert.ToDateTime(reader["CreatedUtc"]);

        //    }

        //}

        /// <summary>
        /// Persists a new instance of EmailSendQueue. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            this.guid = Guid.NewGuid();

            int rowsAffected = DBEmailSendQueue.Create(
                this.guid,
                this.siteGuid,
                this.moduleGuid,
                this.userGuid,
                this.specialGuid1,
                this.specialGuid2,
                this.fromAddress,
                this.replyTo,
                this.toAddress,
                this.ccAddress,
                this.bccAddress,
                this.subject,
                this.textBody,
                this.htmlBody,
                this.type,
                this.dateToSend,
                this.createdUtc);

            return(rowsAffected > 0);
        }
Beispiel #2
0
 /// <summary>
 /// Gets an IDataReader with rows from the mp_EmailSendQueue table where DateToSend >= CurrentTime.
 /// </summary>
 /// <param name="currentTime"> currentTime </param>
 public static IDataReader GetEmailToSend(DateTime currentTime)
 {
     return(DBEmailSendQueue.GetEmailToSend(currentTime));
 }
Beispiel #3
0
 public static IDataReader GetEmailToSend()
 {
     return(DBEmailSendQueue.GetEmailToSend(DateTime.UtcNow));
 }
Beispiel #4
0
 /// <summary>
 /// Deletes an instance of EmailSendQueue. Returns true on success.
 /// </summary>
 /// <param name="guid"> guid </param>
 /// <returns>bool</returns>
 public static bool Delete(Guid guid)
 {
     return(DBEmailSendQueue.Delete(guid));
 }