private async void LoadProducts() { ProductsList.Clear(); List <ProductInventoryModel> products = null; await Task.Run(() => { products = serviceRepository.LoadProductInventory(); }); ProductsList.AddRange(products); }
public void OnPost() { try { _system.DrugSystem.Environment.Language = Language.English; _system.DrugSystem.Environment.DrugTerminology = DrugTerminology.MDDF; _system.DrugSystem.Environment.AttributePopulation.All(); var filter = new Filter { DrugClass = { Brand = true, BrandedGeneric = true } }; var products = _system.DrugSystem.Navigation.GetProductsByName(SearchTerm, filter); ProductsList.AddRange(products); } catch (FDBApplicationException fdbAppException) { Console.WriteLine("An FDB Application Exception was thrown"); Console.WriteLine(fdbAppException.Message); if (fdbAppException.InnerException != null) { Console.WriteLine(fdbAppException.InnerException.Message); } Console.WriteLine(fdbAppException.StackTrace); throw; } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); } }