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(); }
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" }); }
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 }); } }
protected override async Task OnInitializedAsync() { Categories = await CategoryDataService.Get(); Products = await ProductDataService.Get(); }
public async void AddProductDialog_OnDialogClose() { Products = (await ProductDataService.Get()); StateHasChanged(); }