private static void SaveMessenger(string toAddress, string messageBody, string messageSubject, bool isBodyHtml, int MessengerTriggerId) { try { var a = db.SystemSettingsDatas.FirstOrDefault(x => x.SettingName == "GmailAddress").SettingValueA ?? "*****@*****.**"; JazMax.DataAccess.MessengerCoreLog log = new JazMax.DataAccess.MessengerCoreLog() { DateCreated = DateTime.Now, IsHtml = isBodyHtml, MessageBody = messageBody, MessageFrom = a, MessageTo = toAddress, IsSent = false, MessenegerTypeId = -1, MessageSubject = messageSubject, MessengerTriggerId = MessengerTriggerId }; db.MessengerCoreLogs.Add(log); db.SaveChanges(); } catch (Exception e) { ErrorLog.LogError(e, 0); } }
public static void UpdateMessengerToSent(int Id) { JazMax.DataAccess.MessengerCoreLog a = db.MessengerCoreLogs.FirstOrDefault(x => x.MessengerCoreLogId == Id); try { a.IsSent = true; a.DateSent = DateTime.Now; a.MessengerResponse = "Sent"; } catch (Exception e) { a.MessengerResponse = e.Message; ErrorLog.LogError(db, e, 0); } db.SaveChanges(); }