Пример #1
0
        public void ProcessNotifications()
        {
            if (!AppVars.ReportNotificationsEnabled) return;

            if (SysVars.isConsole) Console.WriteLine("Processing Notifications");

            ReportNotificationsActive = true;

            List<ReportNotification> reportNotifications = this.GetReportNotifications();

            if (reportNotifications.Count > 0)
            {
                foreach (ReportNotification item in reportNotifications)
                {
                    ContactNotify notify = null;
                    using (ClientDAO cDao = new ClientDAO()) { notify = null; } //cDao.GetContact(item.NotificationId);}
                    item.NotifyContact = notify;

                    ReportRecord report = new ReportRecord();
                    using (SampleDAO oDao = new SampleDAO()) { report = oDao.GetOrdersReport(item.ReportId, null); }

                    // Email
                    if (notify.IsFax == false) {
                        this.SendReportEmail(notify, item, report);
                    }

                    //Fax
                    if (notify.IsFax == true) {
                        this.ReportSendFaxAsync(notify, item, report);
                    }

                }
            }

            ReportNotificationsActive = false;
        }