Exemple #1
0
        private void RestaurantListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            IngredientsList.Clear();
            var selectedRestaurant = _restaurantRepository.LoadRestaurantData(RestaurantListBox.Text);

            if (selectedRestaurant == null)
            {
                return;
            }

            KitchenModelLabel.Text = $@"{selectedRestaurant.KitchenModel.Name}, price: {selectedRestaurant.KitchenModel.Price}";

            var employees = new BindingList <string>();

            foreach (var employee in selectedRestaurant.Employees)
            {
                employees.Add($"{employee.OIB} {employee.FirstName} {employee.LastName} {employee.BirthYear}");
            }
            EmployeeListBox.DataSource = employees;

            var recipes = new BindingList <Recipe>();

            foreach (var recipe in selectedRestaurant.Recipes)
            {
                recipes.Add(recipe);
            }
            RecipeListBox.DataSource    = recipes;
            RecipeListBox.DisplayMember = "Name";
        }
Exemple #2
0
        public List <Ingredient> ConvertToTheNumberOfServings(int servings)
        {
            List <Ingredient> convertedIngredients = IngredientsList.ConvertAll(x => new Ingredient(x));

            convertedIngredients.ForEach(i => i.Quantity = Math.Round(i.Quantity / NumberOfServings * servings, 2));
            return(convertedIngredients);
        }
Exemple #3
0
    public void ReceiveCompletedBurger(CompletedBurger completedBurger)
    {
        Debug.Log("Completed burger", completedBurger);
        this.completedBurger = completedBurger;
        actualIngredients    = completedBurger.ingredients;
        var tray = completedBurger.gameObject;

        completedBurger.container = tray;
        tray.transform.SetParent(this.transform);
        foreach (var i in tray.GetComponentsInChildren <NewtonVR.NVRInteractableItem>())
        {
            Destroy(i);
        }

        foreach (var i in tray.GetComponentsInChildren <Rigidbody>())
        {
            i.isKinematic = true;
        }

        tray.GetComponent <Rigidbody>().isKinematic = true;
        var trayInteractable = tray.GetComponent <NewtonVR.NVRInteractableItem>();

        if (trayInteractable != null)
        {
            Destroy(trayInteractable);
        }
        tray.GetComponent <Rigidbody>().isKinematic = true;
        if (orderLabel != null)
        {
            Destroy(orderLabel.gameObject);
        }
        orderLabel = null;
        StartCoroutine("FinishOrder", tray);
    }
Exemple #4
0
    void Start()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        animator = GetComponent <Animator>();

        itemTemplate.gameObject.SetActive(false);
        itemTransformList = new List <Transform>();

        ReadyToCook = false;

        itemList = new List <Item>();
        foreach (IngredientItem ingredient in ingredientList)
        {
            itemList.Add(new Item {
                name = ingredient.name, collected = false
            });
        }

        foreach (Item item in itemList)
        {
            CreateListEntry(item, container, itemTransformList);
        }
    }
Exemple #5
0
 public HomeController(IFileWriterService fileWriterService, ImportHelper importHelper, ILogger <HomeController> logger, ApplicationDbContext context)
 {
     _fileWriterService  = fileWriterService;
     _importHelper       = importHelper;
     _logger             = logger;
     _dbContext          = context;
     sandwichIngredients = new IngredientsList();
 }
        private void InitIngredients()
        {
            var enumarable = App.RecipeDbcontroller.GetRecipeIngredients(Recipe.RecipeID);

            foreach (Ingredients i in enumarable)
            {
                IngredientsList.Add(i);
            }
        }
 void IngredientsCalculator()
 {
     IngredientsList.Clear();
     InitIngredients();
     foreach (Ingredients i in IngredientsList)
     {
         i.Ammount = (i.Ammount / Recipe.Serves) * SelectedPicker.NumberOfPeople;
         OnPropertyChanged();
     }
 }
        public SandwichIngredientViewModel()
        {
            sandwichIngredients = new IngredientsList();

            var items = sandwichIngredients.Ingredients;

            foreach (var item in items)
            {
                Ingredients.Add(new SandwichIngredientItemViewModel(item, false));
            }
        }
 private void AddButton_Click(object sender, RoutedEventArgs e)
 {
     if (IngredientsList.SelectedItem != null)
     {
         selectedIngredients.Add((Ingredient)IngredientsList.SelectedItem);
         IngredientsList.UnselectAll();
         if (!SelectedIngredientsPanel.IsVisible)
         {
             SelectedIngredientsPanel.Visibility = Visibility.Visible;
         }
     }
 }
 public NeuralNetworkController(IFileWriterService fileWriterService, ImportHelper importHelper, ILogger <HomeController> logger, UserManager <ApplicationUser> userManager, ApplicationDbContext context)
 {
     _fileWriterService   = fileWriterService;
     _importHelper        = importHelper;
     _userManager         = userManager;
     _dbContext           = context;
     _logger              = logger;
     _numInputParameters  = 10;
     _numHiddenLayers     = 1;
     _hiddenNeurons       = new int[] { 2 };
     _numOutputParameters = 1;
     sandwichIngredients  = new IngredientsList();
 }
Exemple #11
0
        public void ConvertToString()
        {
            ingredientsList        = new IngredientsList();
            OutputIngredientsArray = new string[InputIngredientsArray.Length];

            for (int i = 0; i < InputIngredientsArray.Length; i++)
            {
                if (InputIngredientsArray[i] == 1)
                {
                    OutputIngredientsArray[i] = ingredientsList.Ingredients[i];
                }
            }
        }
Exemple #12
0
        private void RecipeListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            IngredientsList.Clear();
            var selectedRecipe = _recipeRepository.GetRecipe(RecipeListBox.Text);

            if (selectedRecipe == null)
            {
                return;
            }
            foreach (var ingredient in selectedRecipe.Ingredients)
            {
                IngredientsList.Items.Add(ingredient.Name);
            }
        }
Exemple #13
0
 public void SetOrder(string[] ingredients)
 {
     timeSinceOrderStarted = 0;
     if (orderLabel != null)
     {
         Destroy(orderLabel.gameObject);
         orderLabel = null;
     }
     if (ingredients == null)
     {
         return;
     }
     orderLabel = (IngredientsList)Instantiate(orderLabelPrefab, orderPosition.position, orderPosition.rotation);
     orderLabel.SetIngredientList(ingredients);
     orderLabel.transform.SetParent(gameObject.transform);
     desiredIngredients = ingredients;
 }
        void ReleaseDesignerOutlets()
        {
            if (ButtonFavorites != null)
            {
                ButtonFavorites.Dispose();
                ButtonFavorites = null;
            }

            if (ButtonShopList != null)
            {
                ButtonShopList.Dispose();
                ButtonShopList = null;
            }

            if (ConditionText != null)
            {
                ConditionText.Dispose();
                ConditionText = null;
            }

            if (DescriptionText != null)
            {
                DescriptionText.Dispose();
                DescriptionText = null;
            }

            if (DetailImage != null)
            {
                DetailImage.Dispose();
                DetailImage = null;
            }

            if (IngredientsList != null)
            {
                IngredientsList.Dispose();
                IngredientsList = null;
            }

            if (NameRecipe != null)
            {
                NameRecipe.Dispose();
                NameRecipe = null;
            }
        }
Exemple #15
0
 public void CleanLists()
 {
     for (int i = 0; i < IngredientsList.Count; i++)
     {
         if (IngredientsList[i] == null)
         {
             IngredientsList.RemoveAt(i);
             i--;
         }
     }
     for (int i = 0; i < InstructionsList.Count; i++)
     {
         if (InstructionsList[i] == null)
         {
             InstructionsList.RemoveAt(i);
             i--;
         }
     }
 }
Exemple #16
0
        public int InsertIngredientsListItem(int recipeId, IngredientsListItemForCreationDto ingredientListItemForCreationDto)
        {
            var ingredientsList = recipeContext.IngredientsLists.SingleOrDefault(il => il.RecipeId == recipeId);

            if (ingredientsList == null)
            {
                ingredientsList = new IngredientsList
                {
                    RecipeId = recipeId
                };
                recipeContext.Add(ingredientsList);
            }

            var ingredientsListItem = mapper.Map <IngredientsListItem>(ingredientListItemForCreationDto);

            ingredientsListItem.IngredientsList = ingredientsList;
            recipeContext.Add(ingredientsListItem);
            recipeContext.SaveChanges();
            return(ingredientsListItem.Id);
        }
Exemple #17
0
 public int GrowIngredients()
 {
     IngredientsList.Add("");
     return(IngredientsList.Count);
 }