示例#1
0
        private static List <LetterInfo> LoadFromReader(IDataReader reader)
        {
            List <LetterInfo> letterInfoList = new List <LetterInfo>();

            try
            {
                while (reader.Read())
                {
                    LetterInfo letterInfo = new LetterInfo();
                    letterInfo.letterInfoGuid      = new Guid(reader["LetterInfoGuid"].ToString());
                    letterInfo.siteGuid            = new Guid(reader["SiteGuid"].ToString());
                    letterInfo.title               = reader["Title"].ToString();
                    letterInfo.description         = reader["Description"].ToString();
                    letterInfo.availableToRoles    = reader["AvailableToRoles"].ToString();
                    letterInfo.enabled             = Convert.ToBoolean(reader["Enabled"]);
                    letterInfo.allowUserFeedback   = Convert.ToBoolean(reader["AllowUserFeedback"]);
                    letterInfo.allowAnonFeedback   = Convert.ToBoolean(reader["AllowAnonFeedback"]);
                    letterInfo.fromAddress         = reader["FromAddress"].ToString();
                    letterInfo.fromName            = reader["FromName"].ToString();
                    letterInfo.replyToAddress      = reader["ReplyToAddress"].ToString();
                    letterInfo.sendMode            = Convert.ToInt32(reader["SendMode"]);
                    letterInfo.enableViewAsWebPage = Convert.ToBoolean(reader["EnableViewAsWebPage"]);
                    letterInfo.enableSendLog       = Convert.ToBoolean(reader["EnableSendLog"]);
                    letterInfo.rolesThatCanEdit    = reader["RolesThatCanEdit"].ToString();
                    letterInfo.rolesThatCanApprove = reader["RolesThatCanApprove"].ToString();
                    letterInfo.rolesThatCanSend    = reader["RolesThatCanSend"].ToString();
                    letterInfo.createdUTC          = Convert.ToDateTime(reader["CreatedUTC"]);
                    letterInfo.createdBy           = new Guid(reader["CreatedBy"].ToString());
                    letterInfo.lastModUTC          = Convert.ToDateTime(reader["LastModUTC"]);
                    letterInfo.lastModBy           = new Guid(reader["LastModBy"].ToString());
                    letterInfo.subscriberCount     = Convert.ToInt32(reader["SubscriberCount"]);
                    letterInfo.unVerifiedCount     = Convert.ToInt32(reader["UnVerifiedCount"]);
                    letterInfo.AllowArchiveView    = Convert.ToBoolean(reader["AllowArchiveView"]);
                    letterInfo.ProfileOptIn        = Convert.ToBoolean(reader["ProfileOptIn"]);
                    letterInfo.SortRank            = Convert.ToInt32(reader["SortRank"]);

                    letterInfoList.Add(letterInfo);
                }
            }
            finally
            {
                reader.Close();
            }

            return(letterInfoList);
        }
示例#2
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByLastModUtc(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.LastModUtc.CompareTo(letterInfo2.LastModUtc));
 }
示例#3
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByCreatedUtc(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.CreatedUtc.CompareTo(letterInfo2.CreatedUtc));
 }
示例#4
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByRolesThatCanSend(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.RolesThatCanSend.CompareTo(letterInfo2.RolesThatCanSend));
 }
示例#5
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByRolesThatCanApprove(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.RolesThatCanApprove.CompareTo(letterInfo2.RolesThatCanApprove));
 }
示例#6
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByRolesThatCanEdit(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.RolesThatCanEdit.CompareTo(letterInfo2.RolesThatCanEdit));
 }
示例#7
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareBySendMode(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.SendMode.CompareTo(letterInfo2.SendMode));
 }
示例#8
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByReplyToAddress(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.ReplyToAddress.CompareTo(letterInfo2.ReplyToAddress));
 }
示例#9
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByFromName(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.FromName.CompareTo(letterInfo2.FromName));
 }
示例#10
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByFromAddress(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.FromAddress.CompareTo(letterInfo2.FromAddress));
 }
示例#11
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByAvailableToRoles(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.AvailableToRoles.CompareTo(letterInfo2.AvailableToRoles));
 }
示例#12
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByDescription(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.Description.CompareTo(letterInfo2.Description));
 }
示例#13
0
 /// <summary>
 /// Compares 2 instances of LetterInfo.
 /// </summary>
 public static int CompareByTitle(LetterInfo letterInfo1, LetterInfo letterInfo2)
 {
     return(letterInfo1.Title.CompareTo(letterInfo2.Title));
 }