Exemple #1
0
        // GET api/orders/id
        public OrderDTO Get(int id)
        {
            Order someOrder = orderRepo.GetById(id);

            if (someOrder == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }
            OrderDTO someOrderDTO = new OrderDTO(someOrder);

            return(someOrderDTO);
        }
Exemple #2
0
        //Make a payment to supplier
        public void makePayment(int orderID)
        {
            Order           order      = orderRepo.GetById(orderID);
            SupplierPayment newPayment = new SupplierPayment();

            newPayment.OrderID = order.OrderID;
            //might have to pass in partial payment
            newPayment.Total         = order.Total;
            newPayment.ProcessedDate = DateTime.Now;
            //might need to change the order status if paid.
            supplierPaymentRepo.Add(newPayment);
        }