Esempio n. 1
0
 internal Line(SalesOrderId salesOrder, ProductId product, Quantity quantity, UnitPrice price, SalesTax tax)
 {
     Id         = new LineId(Guid.NewGuid());
     SalesOrder = salesOrder;
     Quantity   = quantity;
     Product    = product;
     Price      = price;
     Tax        = tax;
 }
Esempio n. 2
0
        public SalesOrder(IDomainEventRaiser observer, CustomerId customer, RefWarehouseId warehouse)
        {
            _observer = observer;

            if (customer == null)
            {
                throw new Exception("Customer id cannot be null");
            }
            if (warehouse == null)
            {
                throw new Exception("Warehouse id cannot be null");
            }

            Id         = new SalesOrderId(Guid.NewGuid());
            Customer   = customer;
            _warehouse = warehouse;

            Status = Status.CreateOpened();
            Lines  = new Lines(Id, ref _status);
        }
Esempio n. 3
0
 internal Lines(SalesOrderId salesOrder, ref Status orderStatus)
 {
     SalesOrder  = salesOrder;
     OrderStatus = orderStatus;
 }