Exemple #1
0
 private Order NottifyOnProcassOrder(Order order, User user)
 {
     order.ProcessDateTime = DateTime.Now.ToString();
     order.OrderStatus = new OrderStatus() { IsInProgress = true };
     order = OrdersRepository.SaveOrUpdate(order);
     NotificateEmployee(order);
     user.Orders.Remove(order);
     user.OrdersHistory.Add(order);
     UserRepository.SaveOrUpdate(user);
     return order;
 }
Exemple #2
0
 private Order UpdateOrder(OrderMakerModel model, Order order)
 {
     if (string.IsNullOrEmpty(model.Comments))
     {
         order.Comments = model.Comments;
     }
     if (string.IsNullOrEmpty(model.Email))
     {
         order.Email = model.Comments;
     }
     order = OrdersRepository.SaveOrUpdate(order);
     return order;
 }
Exemple #3
0
        private Order AddOrderToBascet(User user, Product product)
        {
            Order order = new Order()
            {
                Email = !string.IsNullOrEmpty(user.Email) ? user.Email : "*****@*****.**",
                User = user,
                Product = product,
                Comments = DefaultComments
            };

            order = OrdersRepository.SaveOrUpdate(order);

            user.AddOrder(order);
            UserRepository.SaveOrUpdate(user);

            return order;
        }
Exemple #4
0
        private static void NotificateEmployee(Order order)
        {
            MailMessage mail = new MailMessage();
            SmtpClient SmtpServer = new SmtpClient("mail.infobox.ru");
            SmtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "atlzatlz1");
            SmtpServer.Port = 25;
            //SmtpServer.EnableSsl = true;

            mail.From = new MailAddress("*****@*****.**");
            mail.To.Add(order.Product.Employee.Email);
            mail.Subject = "Замовлення від" + order.Email;
            mail.Body = @"Ваш товаор " + order.Product.Name + " замовили."
                + "Пошта замовника: " + order.Email + "Замовлення здійснена" + order.ProcessDateTime;
            if (order.Comments != DefaultComments)
            {
                mail.Body = mail.Body + "Замрвник додав коментар." + order.Comments;
            }
            SmtpServer.Send(mail);
        }
Exemple #5
0
 public virtual Order DeleteOrder(Order order)
 {
     order.User = null;
     Orders.Remove(order);
     return order;
 }
Exemple #6
0
 public virtual Order AddOrdersHistory(Order order)
 {
     OrdersHistory.Add(order);
     return order;
 }
Exemple #7
0
 public virtual Order AddOrder(Order order)
 {
     Orders.Add(order);
       order.User = this;
     return order;
 }