public Ingredient Get(long id) { if (AuthorizedUsers["Get"].SingleOrDefault(x => x == Role) != null) { return(IngredientController.Get(id)); } else { return(null); } }
public void ChangeIngredient(string ingredientName) { using (IIngredientController controller = factory.CreateIngredientController()) { DataControllerMessage <IngredientEditDTO> controllerMessage = controller.Get(ingredientName); if (controllerMessage.IsSuccess) { this.ingredient = controllerMessage.Data; this.Stocks.Clear(); foreach (int stockNo in ingredient.StocksAvailable) { this.Stocks.Add(stockNo); } RaisePropertyChangedEvent("Name"); } } }