コード例 #1
0
        public IActionResult Edit(int recipeId, string name, string dyeColor)
        {
            MXRecipe recipeById = RecipeData.GetById(recipeId);

            recipeById.Name     = name;
            recipeById.DyeColor = dyeColor;
            return(Redirect("/Recipe"));
        }
コード例 #2
0
        public IActionResult Edit(int recipeId)
        {
            MXRecipe recipeById = RecipeData.GetById(recipeId);

            ViewBag.editRecipe = recipeById;
            ViewBag.title      = $"Edit Event {recipeById.Name}  (id={recipeById.Id})";
            return(View());
        }
コード例 #3
0
        public IActionResult Calculator(CalculateMXRecipeViewModel calculateMXRecipeViewModel)
        {
            MXRecipe newMXRecipe = new MXRecipe
            {
                Name     = calculateMXRecipeViewModel.Name,
                DyeColor = calculateMXRecipeViewModel.DyeColor
            };

            RecipeData.Add(newMXRecipe);
            return(Redirect("/Recipe"));
        }
コード例 #4
0
ファイル: RecipeData.cs プロジェクト: rrolon47/TestToDyeFor
 // Add
 public static void Add(MXRecipe newMXRecipe)
 {
     MXRecipes.Add(newMXRecipe.Id, newMXRecipe);
 }