public IActionResult CreateNewSubOrder([FromBody] NewSubOrderModel newSubOrderModel) { try { var orderClass = new OrderClass(); var createSubOrderModel = orderClass.CreateNewSubOrder(newSubOrderModel.OrderId, newSubOrderModel.ProductSubModelId, newSubOrderModel.CustomerModelId, newSubOrderModel.SpecialNotes); var json = JsonSerializer.Serialize(createSubOrderModel, new JsonSerializerOptions() { IgnoreNullValues = true }); return(Ok(json)); } catch (Exception exception) { return(StatusCode(500, exception.Message)); } }
public IActionResult RemoveOrder([FromBody] NewSubOrderModel orderModel) { try { var orderClass = new OrderClass(); var removeOrder = orderClass.RemoveOrder(orderModel.OrderId); var json = JsonSerializer.Serialize(removeOrder, new JsonSerializerOptions() { IgnoreNullValues = true }); return(Ok(json)); } catch (Exception exception) { return(StatusCode(500, exception.Message)); } }