public bool SaveChanges(InviteMe item) { this.dbContext.Entry(item).State = System.Data.Entity.EntityState.Modified; int result = this.dbContext.SaveChanges(); return(result > 0); }
public int Create(InviteMe item) { item.CreatedOn = DateTime.Now; this.dbContext.InviteMes.Add(item); this.dbContext.SaveChanges(); return(item.Id); }
public int InviteMe(string email, string ip) { try { var addr = new System.Net.Mail.MailAddress(email); } catch { return(-1); } InviteMe test = this.repo.GetByEmail(email); if (test != null) { return(test.Id); } InviteMe item = new InviteMe() { Email = email, Processed = false, Source = ip, CreatedOn = DateTime.Now }; int createdId = this.repo.Create(item); this.serviceMail.SendAdminMail("New subscription : ", "whooot someone drop his/her email : " + email); return(createdId); }
public bool Delete(InviteMe item) { if (item != null) { this.dbContext.InviteMes.Remove(item); this.dbContext.SaveChanges(); return(true); } return(false); }
public bool Delete(int id) { InviteMe item = this.GetById(id); return(this.repo.Delete(item));; }
private bool SaveChanges(InviteMe item) { return(this.repo.SaveChanges(item)); }