Exemplo n.º 1
0
 public void Execute(OnCustomerDetailChanged ev)
 {
     using (IUnitOfWork uow = new UnitOfWork(RepositoryType.MongoDb))
     {
         IOrderQuery query = IoC.Container.Resolve <IOrderQuery>(uow);
         App.Order.Query.Entity.Order order = query.GetByOrderId(ev.OrderId);
         order.Name = ev.CustomerName;
         query.Update(order);
         uow.Commit();
     }
 }
Exemplo n.º 2
0
 public void Execute(OnOrderActivated ev)
 {
     using (IUnitOfWork uow = new UnitOfWork(RepositoryType.MongoDb))
     {
         IOrderQuery query = IoC.Container.Resolve <IOrderQuery>(uow);
         App.Order.Query.Entity.Order order = query.GetByOrderId(ev.OrderId);
         order.IsActivated = true;
         query.Update(order);
         uow.Commit();
     }
 }
Exemplo n.º 3
0
 public void Execute(OnOrderLineItemAdded ev)
 {
     using (IUnitOfWork uow = new UnitOfWork(RepositoryType.MongoDb))
     {
         IOrderQuery query = IoC.Container.Resolve <IOrderQuery>(uow);
         App.Order.Query.Entity.Order order = query.GetByOrderId(ev.OrderId);
         order.OrderLines.Add(new OrderLine(ev.ProductId, ev.ProductName, ev.Quantity, ev.Price));
         order.TotalItems += ev.Quantity;
         order.TotalPrice += ev.Price * (decimal)ev.Quantity;
         query.Update(order);
         uow.Commit();
     }
 }