private static List <ContactFormMessage> LoadListFromReader(IDataReader reader) { List <ContactFormMessage> contactFormMessageList = new List <ContactFormMessage>(); try { while (reader.Read()) { ContactFormMessage contactFormMessage = new ContactFormMessage(); contactFormMessage.rowGuid = new Guid(reader["RowGuid"].ToString()); contactFormMessage.siteGuid = new Guid(reader["SiteGuid"].ToString()); contactFormMessage.moduleGuid = new Guid(reader["ModuleGuid"].ToString()); contactFormMessage.email = reader["Email"].ToString(); contactFormMessage.userName = reader["Url"].ToString(); contactFormMessage.subject = reader["Subject"].ToString(); contactFormMessage.message = reader["Message"].ToString(); contactFormMessage.createdUtc = Convert.ToDateTime(reader["CreatedUtc"]); contactFormMessage.createdFromIpAddress = reader["CreatedFromIpAddress"].ToString(); contactFormMessage.userGuid = new Guid(reader["UserGuid"].ToString()); contactFormMessageList.Add(contactFormMessage); } } finally { reader.Close(); } return(contactFormMessageList); }
/// <summary> /// Compares 2 instances of ContactFormMessage. /// </summary> public static int CompareByCreatedFromIpAddress(ContactFormMessage contactFormMessage1, ContactFormMessage contactFormMessage2) { return(contactFormMessage1.CreatedFromIpAddress.CompareTo(contactFormMessage2.CreatedFromIpAddress)); }
/// <summary> /// Compares 2 instances of ContactFormMessage. /// </summary> public static int CompareByCreatedUtc(ContactFormMessage contactFormMessage1, ContactFormMessage contactFormMessage2) { return(contactFormMessage1.CreatedUtc.CompareTo(contactFormMessage2.CreatedUtc)); }
/// <summary> /// Compares 2 instances of ContactFormMessage. /// </summary> public static int CompareByMessage(ContactFormMessage contactFormMessage1, ContactFormMessage contactFormMessage2) { return(contactFormMessage1.Message.CompareTo(contactFormMessage2.Message)); }
/// <summary> /// Compares 2 instances of ContactFormMessage. /// </summary> public static int CompareBySubject(ContactFormMessage contactFormMessage1, ContactFormMessage contactFormMessage2) { return(contactFormMessage1.Subject.CompareTo(contactFormMessage2.Subject)); }
/// <summary> /// Compares 2 instances of ContactFormMessage. /// </summary> public static int CompareByUserName(ContactFormMessage contactFormMessage1, ContactFormMessage contactFormMessage2) { return(contactFormMessage1.UserName.CompareTo(contactFormMessage2.UserName)); }
/// <summary> /// Compares 2 instances of ContactFormMessage. /// </summary> public static int CompareByEmail(ContactFormMessage contactFormMessage1, ContactFormMessage contactFormMessage2) { return(contactFormMessage1.Email.CompareTo(contactFormMessage2.Email)); }