Пример #1
0
        private void SendEmail()
        {
            var email        = _users.Where(x => x.UserId == _orderViemModel.SelectedItem.UserId).Select(p => p.Email).First();
            var orderDetails = _orderDetails.Where(x => x.OrderId == _orderViemModel.SelectedItem.Id);

            _orderProcessor.ProcessOrder(email, orderDetails);
            var order = _orders.Where(x => x.Id == _orderViemModel.SelectedItem.Id).First();

            order.Status = "Sent";
            _reposiroty.Orders.Edit(order);
            _reposiroty.Orders.Save();
            var observableOrder = OrdersObservableCollection.GetInstance().Orders.Where(x => x.Id == _orderViemModel.SelectedItem.Id).First();

            observableOrder.Status = "Sent";
        }
Пример #2
0
 public OrdersViewModel(IOrderUnitOfWork repository, int row)
 {
     _orders       = OrdersObservableCollection.GetInstance(repository);
     Row           = row;
     _orderDetails = repository.OrderDetails.GetAll().ToList();
 }