public void Save(LetterSubscriber subsciption) { if (subsciption == null) { return; } if (subsciption.SubscribeGuid == Guid.Empty) { subsciption.SubscribeGuid = Guid.NewGuid(); DBLetterSubscription.Create( subsciption.SubscribeGuid, subsciption.SiteGuid, subsciption.LetterInfoGuid, subsciption.UserGuid, subsciption.EmailAddress.ToLower(), subsciption.IsVerified, subsciption.VerifyGuid, DateTime.UtcNow, subsciption.UseHtml, subsciption.IpAddress); } else { DBLetterSubscription.Update( subsciption.SubscribeGuid, subsciption.UserGuid, subsciption.UseHtml); } }
public bool Delete(LetterSubscriber subscription, bool createHistory) { if (subscription == null) { return(false); } if (createHistory) { DBLetterSubscription.CreateHistory( Guid.NewGuid(), subscription.SiteGuid, subscription.SubscribeGuid, subscription.LetterInfoGuid, subscription.UserGuid, subscription.EmailAddress, subscription.IsVerified, subscription.UseHtml, subscription.BeginUtc, DateTime.UtcNow, subscription.IpAddress); } return(DBLetterSubscription.Delete(subscription.SubscribeGuid)); }
public LetterSubscriber Fetch(Guid siteGuid, Guid letterInfoGuid, string email) { using (IDataReader reader = DBLetterSubscription.GetByEmail(siteGuid, letterInfoGuid, email.ToLower())) { if (reader.Read()) { LetterSubscriber letterSubscriber = new LetterSubscriber(); letterSubscriber.SubscribeGuid = new Guid(reader["Guid"].ToString()); letterSubscriber.SiteGuid = new Guid(reader["SiteGuid"].ToString()); letterSubscriber.LetterInfoGuid = new Guid(reader["LetterInfoGuid"].ToString()); letterSubscriber.VerifyGuid = new Guid(reader["VerifyGuid"].ToString()); letterSubscriber.UserGuid = new Guid(reader["UserGuid"].ToString()); letterSubscriber.UseHtml = Convert.ToBoolean(reader["UseHtml"]); letterSubscriber.BeginUtc = Convert.ToDateTime(reader["BeginUtc"]); letterSubscriber.EmailAddress = reader["Email"].ToString(); letterSubscriber.Name = reader["Name"].ToString(); letterSubscriber.IsVerified = Convert.ToBoolean(reader["IsVerified"]); letterSubscriber.IpAddress = reader["IpAddress"].ToString(); letterSubscriber.FirstName = reader["FirstName"].ToString(); letterSubscriber.LastName = reader["LastName"].ToString(); return(letterSubscriber); } } return(null); }
public List <LetterSubscriber> GetSubscribersNotSentYet( Guid letterGuid, Guid letterInfoGuid) { IDataReader reader = DBLetterSubscription.GetSubscribersNotSentYet(letterGuid, letterInfoGuid); return(LoadFromReader(reader)); }
public bool Verify( Guid guid, bool isVerified, Guid verifyGuid) { return(DBLetterSubscription.Verify( guid, isVerified, verifyGuid)); }
public IDataReader GetPage( Guid letterInfoGuid, int pageNumber, int pageSize, out int totalPages) { return(DBLetterSubscription.GetPage( letterInfoGuid, pageNumber, pageSize, out totalPages)); }
public static DataTable GetTop1000UsersNotSubscribed(Guid siteGuid, Guid letterInfoGuid, bool excludeIfAnyUnsubscribeHx) { DataTable dataTable = new DataTable(); dataTable.Columns.Add("UserID", typeof(int)); dataTable.Columns.Add("UserGuid", typeof(string)); dataTable.Columns.Add("Email", typeof(string)); using (IDataReader reader = DBLetterSubscription.GetTop1000UsersNotSubscribed(siteGuid, letterInfoGuid, excludeIfAnyUnsubscribeHx)) { while (reader.Read()) { DataRow row = dataTable.NewRow(); row["UserID"] = Convert.ToInt32(reader["UserID"]); row["UserGuid"] = reader["UserGuid"].ToString(); row["Email"] = reader["Email"].ToString(); dataTable.Rows.Add(row); } } return(dataTable); }
public IDataReader GetByLetter(Guid letterInfoGuid) { return(DBLetterSubscription.GetByLetter(letterInfoGuid)); }
public List <LetterSubscriber> GetListByUser(Guid siteGuid, Guid userGuid) { IDataReader reader = DBLetterSubscription.GetByUser(siteGuid, userGuid); return(LoadFromReader(reader)); }
public List <LetterSubscriber> GetListByEmail(Guid siteGuid, string email) { IDataReader reader = DBLetterSubscription.GetByEmail(siteGuid, email.ToLower()); return(LoadFromReader(reader)); }
public bool DeleteByLetter(Guid letterInfoGuid) { return(DBLetterSubscription.DeleteByLetter(letterInfoGuid)); }
public static int CountUsersNotSubscribedByLetter(Guid siteGuid, Guid letterInfoGuid, bool excludeIfAnyUnsubscribeHx) { return(DBLetterSubscription.CountUsersNotSubscribedByLetter(siteGuid, letterInfoGuid, excludeIfAnyUnsubscribeHx)); }
public IDataReader Search( Guid letterInfoGuid, string emailOrIpAddress) { return(DBLetterSubscription.Search(letterInfoGuid, emailOrIpAddress)); }
public IDataReader GetOne(Guid guid) { return(DBLetterSubscription.GetOne(guid)); }
public bool DeleteHistoryByLetterInfo(Guid letterInfoGuid) { return(DBLetterSubscription.DeleteHistoryByLetterInfo(letterInfoGuid)); }
public bool DeleteHistoryBySite(Guid siteGuid) { return(DBLetterSubscription.DeleteHistoryBySite(siteGuid)); }
public bool DeleteByUser(Guid userGuid) { return(DBLetterSubscription.DeleteByUser(userGuid)); }
public bool DeleteUnverified(Guid letterInfoGuid, DateTime olderThanUtc) { return(DBLetterSubscription.DeleteUnverified(letterInfoGuid, olderThanUtc)); }
public int GetCountByLetter(Guid letterInfoGuid) { return(DBLetterSubscription.GetCountByLetter(letterInfoGuid)); }
public IDataReader GetByUser(Guid siteGuid, Guid userGuid) { return(DBLetterSubscription.GetByUser(siteGuid, userGuid)); }
public IDataReader GetByEmail(Guid siteGuid, string email) { return(DBLetterSubscription.GetByEmail(siteGuid, email.ToLower())); }
public bool Exists(Guid letterInfoGuid, string email) { return(DBLetterSubscription.Exists(letterInfoGuid, email.ToLower())); }