コード例 #1
0
 private void UpdateOrCreateMailboxAutoreply(int mailBoxId, int tenantId, MailAutoreply autoreply)
 {
     using (var db = GetDb())
     {
         var autoreplyDal = new AutoreplyDal(db);
         autoreplyDal.UpdateOrCreateAutoreply(mailBoxId, tenantId, autoreply);
     }
 }
コード例 #2
0
 public void SaveAutoreplyHistory(MailBox account, MailMessage messageItem)
 {
     using (var db = GetDb())
     {
         var autoreplyDal = new AutoreplyDal(db);
         autoreplyDal.UpdateOrCreateAutoreplyHistory(account.MailBoxId, account.TenantId,
                                                     new MailAddress(messageItem.To).Address);
     }
 }
コード例 #3
0
        public MailAutoreply UpdateOrCreateMailboxAutoreply(int mailboxId, string user, int tenant,
                                                            bool turnOn, bool onlyContacts, bool turnOnToDate, DateTime fromDate, DateTime toDate, string subject,
                                                            string html)
        {
            using (var db = GetDb())
            {
                CheckMailboxOwnage(mailboxId, user, tenant, db);

                var autoreply = new MailAutoreply(mailboxId, tenant, turnOn, onlyContacts, turnOnToDate, fromDate,
                                                  toDate, subject, html);
                var autoreplyDal = new AutoreplyDal(db);
                autoreplyDal.UpdateOrCreateAutoreply(mailboxId, tenant, autoreply);
                return(autoreply);
            }
        }
コード例 #4
0
        private bool HasMailboxAutoreplyHistory(MailBox account, string email)
        {
            if (account.MailAutoreplyHistory != null)
            {
                return(account.MailAutoreplyHistory.Contains(email));
            }

            using (var db = GetDb())
            {
                var autoreplyDal = new AutoreplyDal(db);
                account.MailAutoreplyHistory = autoreplyDal.GetAutoreplyHistory(account.MailBoxId, email,
                                                                                AutoreplyDaysInterval);
            }
            return(account.MailAutoreplyHistory.Contains(email));
        }