public async Task <ActionResult> Post([FromBody] OrderDataDto orders) { orders.order.reg_date = DateTime.Now; orders.order.upd_date = DateTime.Now; await _order.Add(orders.order); await _orderItem.AddList(orders.orderItem); return(Ok()); }
public Order Post(OrderDTO orderDto) { if (orderDto == null) { return(null); throw new HttpResponseException(HttpStatusCode.NotAcceptable); } Order newOrder = convertDTO(orderDto); orderRepo.Add(newOrder); return(newOrder); }
public void placeOrder(int issueID, Int16 quantity, int supplierID) { Issue issue = new Issue(); issue = issueRepo.GetById(issueID); var someissueID = issue.IssueID; //Check for supplier quote SupplierQuote theQuote = supplierQuoteRepo.getSupplierQuote(issueID, supplierID); Supplier theSupplier = supplierRepo.GetById(theQuote.SupplierID); Order newOrder = new Order(); newOrder.IssueID = issue.IssueID; newOrder.OrderDate = DateTime.Now; newOrder.QtyOrdered = quantity; newOrder.Total = quantity * theQuote.Price; newOrder.SupplierID = theSupplier.SupplierID; //These next few fields and their info must come from the supplier API newOrder.ShipmentRef = null; newOrder.ShipmentDate = null; newOrder.DeliveryStatus = "Pending Payment"; orderRepo.Add(newOrder); }