private void Child_Fetch(IOrderDto data)
 {
     RaiseListChangedEvents = false;
     foreach (var dto in data.LineItems)
     {
         var child = DataPortal.FetchChild <LineItem>(dto);
         Add(child);
     }
     RaiseListChangedEvents = true;
 }
        void IOrderContext.UpdateOrder(IOrderDto existingOrder)
        {
            //call sproc to update order
            Binary newTimestamp = null;

            _db.update_order(
                existingOrder.Id,
                existingOrder.Customer,
                existingOrder.Date,
                existingOrder.ShippingCost,
                existingOrder.Timestamp,
                ref newTimestamp);
            //populate DTO with new timestamp returned from sproc
            existingOrder.Timestamp = newTimestamp.ToArray();
        }
        void IOrderContext.InsertOrder(IOrderDto newOrder)
        {
            //call sproc to insert order
            int?   id        = null;
            Binary timestamp = null;

            _db.insert_order(
                ref id,
                newOrder.Customer,
                newOrder.Date,
                newOrder.ShippingCost,
                ref timestamp);
            //populate DTO with ID and timestamp returned from sproc
            newOrder.Id        = id.Value;
            newOrder.Timestamp = timestamp.ToArray();
        }
示例#4
0
 public OrderResponse(IOrderDto orderDto)
 {
     OrderUid  = orderDto.OrderUid;
     Customer  = new CustomerResponse(orderDto.Customer);
     Positions = orderDto.Positions.Select(_ => new OrderPositionResponse(_)).ToList();
 }
 void IOrderContext.UpdateOrder(IOrderDto existingOrder)
 {
     //call sproc to update order
     Binary newTimestamp = null;
     _db.update_order(
         existingOrder.Id,
         existingOrder.Customer,
         existingOrder.Date,
         existingOrder.ShippingCost,
         existingOrder.Timestamp,
         ref newTimestamp);
     //populate DTO with new timestamp returned from sproc
     existingOrder.Timestamp = newTimestamp.ToArray();
 }
 void IOrderContext.InsertOrder(IOrderDto newOrder)
 {
     //call sproc to insert order
     int? id = null;
     Binary timestamp = null;
     _db.insert_order(
         ref id,
         newOrder.Customer,
         newOrder.Date,
         newOrder.ShippingCost,
         ref timestamp);
     //populate DTO with ID and timestamp returned from sproc
     newOrder.Id = id.Value;
     newOrder.Timestamp = timestamp.ToArray();
 }