示例#1
0
 public void Update(Mail mail)
 {
     using (IMailDao dao = this.getDaoContext().DaoImpl.MailDao)
     {
         dao.Update(mail);
     }
 }
示例#2
0
 public ICollection <Mail> GetUnsentMails()
 {
     using (IMailDao dao = this.getDaoContext().DaoImpl.MailDao)
     {
         return(dao.GetUnsentMails());
     }
 }
示例#3
0
 public ICollection <Mail> GetMailsWithoutAttachment()
 {
     using (IMailDao dao = this.getDaoContext().DaoImpl.MailDao)
     {
         return(dao.GetMailsWithoutAttachment());
     }
 }
示例#4
0
        //public RawMessage LoadRawMessage(string appCode, string uid)
        //{
        //    HTF.CR.Mail.MailServiceMapper service = new HTF.CR.Mail.MailServiceMapper();
        //    RawMessage msg = service.GetStampe(appCode, uid);
        //    return msg;
        //}

        //public Comunicazioni LoadComunicazione(string appCode, string uid)
        //{
        //    HTF.CR.Mail.MailServiceMapper service = new HTF.CR.Mail.MailServiceMapper();
        //    Comunicazioni msg = service.GetStampeComunicazioni(appCode, uid);
        //    return msg;
        //}

        public Mail GetMail(long idMail)
        {
            using (IMailDao dao = this.getDaoContext().DaoImpl.MailDao)
            {
                return(dao.GetById(idMail));
            }
        }
 public CourierController(
     ICurrentUserService currentUserService,
     IMailDao mailDao
     )
 {
     _currentUserService = currentUserService;
     _mailDao            = mailDao;
 }
示例#6
0
 public int Save(Mail mail)
 {
     using (IMailDao dao = this.getDaoContext().DaoImpl.MailDao)
     {
         dao.Insert(mail);
         return((int)mail.IdMail);
     }
 }
示例#7
0
 public StockmanController(
     ICurrentUserService currentUserService,
     IBranchesDao branchesDao,
     IMailDao mailDao)
 {
     _currentUserService = currentUserService;
     _branchesDao        = branchesDao;
     _mailDao            = mailDao;
 }
示例#8
0
文件: QMail.cs 项目: greenwall/QMail
        public QMail()
        {
            QMailConfigurationSection config = (QMailConfigurationSection)ConfigurationManager.GetSection("qmailConfiguration");

            //            maxMailsToSend = ConfigHelper.DefaultInt("qmail.max-mails-to-send", 0);
            //            log.Debug("qmail.max-mails-to-send=" + maxMailsToSend);

            //            maxMinutesToRun = ConfigHelper.DefaultInt("qmail.max-minutes-to-run", 0);
            //            log.Debug("qmail.max-minutes-to-run=" + maxMinutesToRun);

            maxMailsPerHour = config.MaxMailsPerHour; // ConfigHelper.DefaultInt("qmail.max-mails-per-hour", 0);
            log.Info("qmail.max-mails-per-hour=" + maxMailsPerHour);

            maxMailsPerDay = config.MaxMailsPerDay; // ConfigHelper.DefaultInt("qmail.max-mails-per-day", 0);
            log.Info("qmail.max-mails-per-day=" + maxMailsPerDay);

            //            isExitOnEmptyQueue = ConfigHelper.DefaultBool("qmail.exit-on-empty-queue", true);
            //            log.Debug("qmail.exit-on-empty-queue=" + isExitOnEmptyQueue);

            //            checkIntervalMinutes = ConfigHelper.DefaultInt("qmail.check-interval-minutes", 1);
            //            checkIntervalMinutes = Math.Max(1, checkIntervalMinutes);
            checkIntervalMinutes = config.CheckIntervalMinutes;
            log.Info("qmail.check-interval-minutes=" + checkIntervalMinutes);

            //archiveSentMailsAfterHours = ConfigHelper.DefaultInt("qmail.archive-sent-mails-after-hours", 24);
            archiveSentMailsAfterHours = config.ArchiveSentMailsAfterHours;
            log.Info("qmail.archive-sent-mails-after-hours=" + archiveSentMailsAfterHours);

            deleteArchivedMailsAfterHours = config.DeleteArchivesMailsAfterHours;
            log.Info("qmail.delete-archived-mails-after-hours=" + deleteArchivedMailsAfterHours);

            if (config.Folders != null && config.Folders.PickupFolder != null && config.Folders.SentFolder != null)
            {
                dao = new FileMailDao();
            }
            else
            {
                if (config.MailTable != null && config.ArchiveMailTable != null)
                {
                    dao = new MailDao();
                }
            }

            ISmtpClient basic = new BasicSmtpClient();
            //ISmtpClient basic = new TestSmtpClient();
            ISmtpClient filter = new FilteringSmtpClient(basic);
            smtpClient = filter;
        }
示例#9
0
 public HomeController(IMailDao mailDao)
 {
     _mailDao = mailDao;
 }