예제 #1
0
 protected override async Task OnInitializedAsync()
 {
     Elements               = (await DataService.GetAll()).ToArray();
     Suppliers              = (await SupplierDataService.GetAll()).ToArray();
     Warehouses             = (await WarehouseDataService.GetAll()).ToArray();
     PaymentTerms           = (await PaymentTermDataService.GetAll()).ToArray();
     _productListParameters = new ProductListParameters();
     Products               = (await ProductDataService.Get(_productListParameters)).ToArray();
     Taxes = (await TaxDataService.GetAll()).ToArray();
 }
예제 #2
0
        protected override async Task OnInitializedAsync()
        {
            int.TryParse(ProductId, out var productId);
            Product = await ProductDataService.Get(productId);

            CategoryId = Product.CategoryId.ToString();

            Categories = await CategoryDataService.Get();

            Categories.Insert(0, new Category {
                CategoryId = -1, Name = "Please select"
            });
        }
예제 #3
0
        protected override async Task OnInitializedAsync()
        {
            Products = await ProductDataService.Get();

            Categories = await CategoryDataService.Get();

            foreach (var product in Products)
            {
                Model.ProductViewItems.Add(new ProductViewItem
                {
                    CategoryId   = product.CategoryId,
                    CategoryName = Categories.First(x => x.CategoryId == product.CategoryId).Name,
                    Image        = product.Image,
                    IsAvailable  = product.IsAvailable,
                    Name         = product.Name,
                    ProductId    = product.ProductId,
                    UnitPrice    = product.UnitPrice
                });
            }
        }
예제 #4
0
        protected override async Task OnInitializedAsync()
        {
            Categories = await CategoryDataService.Get();

            Products = await ProductDataService.Get();
        }
예제 #5
0
 public async void AddProductDialog_OnDialogClose()
 {
     Products = (await ProductDataService.Get());
     StateHasChanged();
 }