private void UpdateCountSent(EmailList model) { model.countsent += 1; using (EmailDBContext context = new EmailDBContext()) { context.EmailList.Update(model); context.SaveChanges(); } }
private void SetVerifyEmail(Guid id) { using (EmailDBContext context = new EmailDBContext()) { var eList = new EmailSend().GetAllEmails() .Where(x => x.Id == id && x.emailverified == false).FirstOrDefault(); if (eList != null) { eList.emailverified = true; MailMessage message = new MailMessage("*****@*****.**", eList.email); string mailbody = "Thank you for verifying the email"; message.Subject = "Thank you Email"; message.Body = mailbody; message.BodyEncoding = Encoding.UTF8; message.IsBodyHtml = true; EmailHelper eh = new EmailHelper(); eh.SendEmail(message); eList.replysent = true; context.Update(eList); context.SaveChanges(); } } }