public void CreateUserNotification(Mail mail) { new UserNotification(mail.AppUserReceiver, mail.DateSent, "New mail from " + mail.AppUserReceiver.UserName); }
public Mail CreateMail(AppUser sender, string heading, string body) { Mail mail = new Mail(this, sender, heading, body, DateTime.Now); CreateUserNotification(mail); return mail; }
public void InsertMail(Mail mail) { context.Mail.Add(mail); }
public void UpdateMail(Mail mail) { Mail targetMail = context.Mail.Find(mail.MailID); if (targetMail != null) { targetMail.DateSent = mail.DateSent; targetMail.Message = mail.Message; targetMail.ReceiverUserID = mail.ReceiverUserID; targetMail.SenderUserID = mail.SenderUserID; targetMail.Heading = mail.Heading; } }