public void Show() { OrderItem = new OrderItemsCreate(); ModalDisplay = "block;"; ModalClass = "Show"; ShowBackdrop = true; StateHasChanged(); }
public void ShowDialog(StockItemDisplay stockItem) { OrderItemsCreate = new OrderItemsCreate() { Name = stockItem.Name, CostInPounds = stockItem.CostInPounds, Quantity = 1 }; ShowingDialog = true; }
public IHttpActionResult Create(OrderItemsCreate orderItems) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var service = CreateOrderItemsService(); if (!service.CreateOrderItems(orderItems)) { return(InternalServerError()); } return(Ok()); }
public bool CreateOrderItems(OrderItemsCreate model) { var entity = new OrderItems() { OrderItemId = model.OrderItemId, OrderId = model.OrderId, GameId = model.GameId, Quantity = model.Quantity, ShipDate = model.ShipDate }; using (var ctx = new ApplicationDbContext()) { ctx.OrderItems.Add(entity); return(ctx.SaveChanges() == 1); } }
public async Task OnRemovedClick(OrderItemsCreate orderItemsCreate) { await OnRemoved.InvokeAsync(orderItemsCreate); }
public void OnRemoved(OrderItemsCreate orderItemsCreate) { StockOrder.OrderItems.Remove(orderItemsCreate); StockOrderCreateCalculateTotalCostInPounds.Resolve(StockOrder); }
public static void Resolve(OrderItemsCreate orderItemsCreate) { orderItemsCreate.TotalCostInPounds = (orderItemsCreate.CostInPounds * orderItemsCreate.Quantity).Value; }
public void RemovedOrderItem(OrderItemsCreate orderItemsCreate) { OrderNewState.OnRemoved(orderItemsCreate); }