private void UpdateEmailSend(int EmailsSendLineId, int EmailsQueueLineId) { try { EmailsSend row = _context.EmailsSends.Where(x => x.LineId == EmailsSendLineId).FirstOrDefault(); row.SendDt = DateTime.Now; EmailsQueue item = _context.EmailsQueues.Where(x => x.LineId == EmailsQueueLineId).FirstOrDefault(); item.Done = true; _context.SaveChanges(); } catch (Exception ex) { WriteToFile("EX-UpdateEmailSend: " + ex.Message); } }
private int InsertNewEmail(int ActivityId, int ActivityJBI) { EmailsSend newObj; try { EmailsSend row = new EmailsSend(); row.ActivityId = ActivityId; row.ActivityJBI = ActivityJBI; row.ClickedAnswer = 0; row.IsOpen = false; row.SendDt = new DateTime(2000, 1, 1, 0, 0, 0); newObj = _context.EmailsSends.Add(row); _context.SaveChanges(); } catch (Exception ex) { WriteToFile("EX-InsertNewEmail: " + ex.Message + ex.InnerException.Message); throw; } return(newObj.LineId); }