Esempio n. 1
0
        ///// <summary>
        ///// Gets an IList with all instances of LetterSendLog.
        ///// </summary>
        //public static List<LetterSendLog> GetByLetter(Guid letterGuid)
        //{
        //    List<LetterSendLog> letterSendLogList
        //        = new List<LetterSendLog>();

        //    IDataReader reader
        //        = DBLetterSendLog.GetByLetter(letterGuid);

        //    while (reader.Read())
        //    {
        //        LetterSendLog letterSendLog = new LetterSendLog();
        //        letterSendLog.rowID = Convert.ToInt32(reader["RowID"]);
        //        letterSendLog.letterGuid = new Guid(reader["LetterGuid"].ToString());
        //        letterSendLog.userGuid = new Guid(reader["UserGuid"].ToString());
        //        letterSendLog.emailAddress = reader["EmailAddress"].ToString();
        //        letterSendLog.uTC = Convert.ToDateTime(reader["UTC"]);
        //        letterSendLog.errorOccurred = Convert.ToBoolean(reader["ErrorOccurred"]);
        //        letterSendLog.errorMessage = reader["ErrorMessage"].ToString();
        //        letterSendLogList.Add(letterSendLog);
        //    }
        //    reader.Close();

        //    return letterSendLogList;

        //}

        /// <summary>
        /// Gets an IList with page of instances of LetterSendLog.
        /// </summary>
        public static List <LetterSendLog> GetPage(
            Guid letterGuid,
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            totalPages = 1;

            List <LetterSendLog> letterSendLogList = new List <LetterSendLog>();

            using (IDataReader reader
                       = DBLetterSendLog.GetPage(
                             letterGuid,
                             pageNumber,
                             pageSize,
                             out totalPages))
            {
                while (reader.Read())
                {
                    LetterSendLog letterSendLog = new LetterSendLog();
                    letterSendLog.rowID         = Convert.ToInt32(reader["RowID"]);
                    letterSendLog.letterGuid    = new Guid(reader["LetterGuid"].ToString());
                    letterSendLog.userGuid      = new Guid(reader["UserGuid"].ToString());
                    letterSendLog.emailAddress  = reader["EmailAddress"].ToString();
                    letterSendLog.uTC           = Convert.ToDateTime(reader["UTC"]);
                    letterSendLog.errorOccurred = Convert.ToBoolean(reader["ErrorOccurred"]);
                    letterSendLog.errorMessage  = reader["ErrorMessage"].ToString();
                    letterSendLogList.Add(letterSendLog);
                }
            }

            return(letterSendLogList);
        }
Esempio n. 2
0
 /// <summary>
 /// Updates this instance of LetterSendLog. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private bool Update()
 {
     return(DBLetterSendLog.Update(
                this.rowID,
                this.letterGuid,
                this.userGuid,
                this.emailAddress,
                this.uTC,
                this.errorOccurred,
                this.errorMessage));
 }
Esempio n. 3
0
        /// <summary>
        /// Persists a new instance of LetterSendLog. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            int newID = 0;

            newID = DBLetterSendLog.Create(
                this.letterGuid,
                this.userGuid,
                this.subscribeGuid,
                this.emailAddress,
                this.uTC,
                this.errorOccurred,
                this.errorMessage);

            this.rowID = newID;

            return(newID > 0);
        }
Esempio n. 4
0
 /// <summary>
 /// Gets an instance of LetterSendLog.
 /// </summary>
 /// <param name="rowId"> rowId </param>
 private void GetLetterSendLog(int rowId)
 {
     using (IDataReader reader = DBLetterSendLog.GetOne(rowId))
     {
         if (reader.Read())
         {
             this.rowID         = Convert.ToInt32(reader["RowID"]);
             this.letterGuid    = new Guid(reader["LetterGuid"].ToString());
             this.userGuid      = new Guid(reader["UserGuid"].ToString());
             this.subscribeGuid = new Guid(reader["SubscribeGuid"].ToString());
             this.emailAddress  = reader["EmailAddress"].ToString();
             this.uTC           = Convert.ToDateTime(reader["UTC"]);
             this.errorOccurred = Convert.ToBoolean(reader["ErrorOccurred"]);
             this.errorMessage  = reader["ErrorMessage"].ToString();
         }
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Gets a count of subscribers a letter was sent to.
 /// </summary>
 public static int GetCount(Guid letterGuid)
 {
     return(DBLetterSendLog.GetCount(letterGuid));
 }
Esempio n. 6
0
 public static bool DeleteBySite(Guid siteGuid)
 {
     return(DBLetterSendLog.DeleteBySite(siteGuid));
 }
Esempio n. 7
0
 public static bool DeleteByLetterInfo(Guid letterInfoGuid)
 {
     return(DBLetterSendLog.DeleteByLetterInfo(letterInfoGuid));
 }
Esempio n. 8
0
 /// <summary>
 /// Deletes an instance of LetterSendLog. Returns true on success.
 /// </summary>
 /// <param name="rowId"> rowId </param>
 /// <returns>bool</returns>
 public static bool Delete(int rowId)
 {
     return(DBLetterSendLog.Delete(rowId));
 }