// 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); }
//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); }