Esempio n. 1
0
        private void OnTimerElapsed()
        {
            MailClientTimerEventArgs args = new MailClientTimerEventArgs();

            args.alarmMail = alarmMail;
            if (TimerElapsed != null)
            {
                TimerElapsed(this, args);
            }
        }
Esempio n. 2
0
        private void MailClientTimer_TimerElapsed(object source, MailClientTimerEventArgs args)
        {
            MailClientTimer mailClientTimer = (MailClientTimer)source;

            mailClientTimer.Stop();
            try
            {
                string logicTextWithVariables = ReplaceVariableNamesWithVariableValues(args.alarmMail.LogicText);
                int    result = CalculateLogic(logicTextWithVariables);
                // Logic hala true donuyorsa e-mail gonderilir.
                if (result > 0)
                {
                    SendMailAsync(args.alarmMail);
                }
                mailClientTimers.Remove(mailClientTimer);
            }
            catch (Exception ex)
            {
                Log.Instance.Error("{0} isimli alarm için mail gonderilemedi => {1}", args.alarmMail.Name, ex.Message);
                throw;
            }
        }