Exemple #1
0
        public static void sendOrdersList(string header, List <Order> orders)
        {
            try {
                IQueryable    users      = OrdersUser.getAllUsers();
                List <string> mailToList = new List <string>();

                OrdersUser CurrentUser = OrdersUser.getCurrentUser();
                foreach (string mail in CurrentUser.Mails)
                {
                    if (!String.IsNullOrEmpty(mail))
                    {
                        mailToList.Add(mail);
                    }
                }

                bool isFirst = true;
                if (mailToList.Count > 0)
                {
                    string message = "";
                    foreach (Order order in orders)
                    {
                        message += OrderView.getOrderHTML(order, isFirst) + "<hr/>";
                        isFirst  = false;
                    }
                    //SendMailLocal("mx-votges-021.corp.gidroogk.com", 25, "", "", "", "*****@*****.**", mailToList, header, message,true);
                    SendMailLocal(smtpServer, smtpPort, smtpUser, smtpPassword, smtpDomain, smtpFrom, mailToList, header, message, true);
                }
            }
            catch (Exception e) {
                Logger.error(String.Format("Ошибка при отправке почты: {0}", e.ToString()), Logger.LoggerSource.server);
            }
        }
Exemple #2
0
 public Order()
 {
     OrderNumber       = -1;
     OrderDateCreate   = DateTime.Now;
     UserCreateOrderID = OrdersUser.getCurrentUser().UserID;
     ParentOrderNumber = 0;
     ChildOrderNumber  = 0;
     OrderState        = OrderStateEnum.created;
     OrderCreated      = true;
 }
 public OrderObjectContext()
 {
     CurrentUser = OrdersUser.getCurrentUser();
 }