public void Show()
 {
     OrderItem    = new OrderItemsCreate();
     ModalDisplay = "block;";
     ModalClass   = "Show";
     ShowBackdrop = true;
     StateHasChanged();
 }
Example #2
0
 public void ShowDialog(StockItemDisplay stockItem)
 {
     OrderItemsCreate = new OrderItemsCreate()
     {
         Name         = stockItem.Name,
         CostInPounds = stockItem.CostInPounds,
         Quantity     = 1
     };
     ShowingDialog = true;
 }
Example #3
0
        public IHttpActionResult Create(OrderItemsCreate orderItems)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var service = CreateOrderItemsService();

            if (!service.CreateOrderItems(orderItems))
            {
                return(InternalServerError());
            }

            return(Ok());
        }
Example #4
0
        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);
            }
        }
Example #5
0
 public async Task OnRemovedClick(OrderItemsCreate orderItemsCreate)
 {
     await OnRemoved.InvokeAsync(orderItemsCreate);
 }
Example #6
0
 public void OnRemoved(OrderItemsCreate orderItemsCreate)
 {
     StockOrder.OrderItems.Remove(orderItemsCreate);
     StockOrderCreateCalculateTotalCostInPounds.Resolve(StockOrder);
 }
Example #7
0
 public static void Resolve(OrderItemsCreate orderItemsCreate)
 {
     orderItemsCreate.TotalCostInPounds = (orderItemsCreate.CostInPounds * orderItemsCreate.Quantity).Value;
 }
Example #8
0
 public void RemovedOrderItem(OrderItemsCreate orderItemsCreate)
 {
     OrderNewState.OnRemoved(orderItemsCreate);
 }