예제 #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);
        }
예제 #2
0
 /// <summary>
 /// Deletes an instance of Letter. Returns true on success.
 /// </summary>
 /// <param name="letterGuid"> letterGuid </param>
 /// <returns>bool</returns>
 public static bool Delete(Guid letterGuid)
 {
     LetterSendLog.DeleteByLetter(letterGuid);
     return(DBLetter.Delete(letterGuid));
 }
예제 #3
0
 /// <summary>
 /// Compares 2 instances of LetterSendLog.
 /// </summary>
 public static int CompareByErrorMessage(LetterSendLog letterSendLog1, LetterSendLog letterSendLog2)
 {
     return(letterSendLog1.ErrorMessage.CompareTo(letterSendLog2.ErrorMessage));
 }
예제 #4
0
 /// <summary>
 /// Compares 2 instances of LetterSendLog.
 /// </summary>
 public static int CompareByUtc(LetterSendLog letterSendLog1, LetterSendLog letterSendLog2)
 {
     return(letterSendLog1.UTC.CompareTo(letterSendLog2.UTC));
 }
예제 #5
0
 /// <summary>
 /// Compares 2 instances of LetterSendLog.
 /// </summary>
 public static int CompareByEmailAddress(LetterSendLog letterSendLog1, LetterSendLog letterSendLog2)
 {
     return(letterSendLog1.EmailAddress.CompareTo(letterSendLog2.EmailAddress));
 }
예제 #6
0
 /// <summary>
 /// Compares 2 instances of LetterSendLog.
 /// </summary>
 public static int CompareByRowId(LetterSendLog letterSendLog1, LetterSendLog letterSendLog2)
 {
     return(letterSendLog1.RowId.CompareTo(letterSendLog2.RowId));
 }