public async Task <IActionResult> Edit(int id, [Bind("Id,Description,Name,Prize")] Pizzas pizzas) { if (id != pizzas.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pizzas); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PizzasExists(pizzas.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(pizzas)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,City,Country,Date,PizzaId")] Orgins orgins) { if (id != orgins.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(orgins); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrginsExists(orgins.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["PizzaId"] = new SelectList(_context.Pizzas.OrderBy(p => p.Name), "Id", "Name", orgins.PizzaId); return(View(orgins)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Description,Grade,PizzaId,Title,Date")] Reviews reviews) { if (id != reviews.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(reviews); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReviewsExists(reviews.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["PizzaId"] = new SelectList(_context.Pizzas.OrderBy(r => r.Name), "Id", "Name", reviews.PizzaId); return(View(reviews)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Gluten,Name")] Ingredients ingredients, string type) { if (id != ingredients.Id) { return(NotFound()); } if (ModelState.IsValid) { try { ingredients.Type = SetingredientsType(type); _context.Update(ingredients); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IngredientsExists(ingredients.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(ingredients)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,IngredientId,PizzaId")] PizzaIngredients pizzaIngredients) { if (id != pizzaIngredients.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pizzaIngredients); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PizzaIngredientsExists(pizzaIngredients.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["IngredientId"] = new SelectList(_context.Ingredients.OrderBy(i => i.Name), "Id", "Name", pizzaIngredients.IngredientId); ViewData["PizzaId"] = new SelectList(_context.Pizzas.OrderBy(p => p.Name), "Id", "Name", pizzaIngredients.PizzaId); return(View(pizzaIngredients)); }