Beispiel #1
0
        public ActionResult ProcessNotClosedOrders()
        {
            OrdersContext      context    = new OrdersContext();
            IQueryable <Order> orders     = context.OrdersNotClosed;
            IQueryable         users      = OrdersUser.getAllUsers();
            List <string>      mailToList = new List <string>();

            foreach (OrdersUser user in users)
            {
                if (user.SendAllMail || user.SendAllCreateMail || user.Name.Contains("SVOD"))
                {
                    if (user.Mails.Count > 0)
                    {
                        foreach (string mail in user.Mails)
                        {
                            if (!String.IsNullOrEmpty(mail))
                            {
                                mailToList.Add(mail);
                            }
                        }
                    }
                }
            }
            //mailToList.Add("*****@*****.**");
            MailContext.sendOrdersListTable("Местные заявки", orders.ToList(), mailToList);
            return(View());
        }