public async Task <IActionResult> Edit(int id, [Bind("usuario,idusuario,password,tipo,RememberMe")] Usuario usuario) { if (id != usuario.idusuario) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(usuario); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuarioExists(usuario.idusuario)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(usuario)); }
public async Task <IActionResult> Edit(int id, [Bind("id,Nombre")] Categoria categoria) { if (id != categoria.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(categoria); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoriaExists(categoria.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(categoria)); }
public async Task <IActionResult> Edit(int id, [Bind("idPedido,idUsuario,fecha")] Pedido pedido) { if (id != pedido.idPedido) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pedido); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PedidoExists(pedido.idPedido)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pedido)); }
public async Task <IActionResult> Edit(int id, [Bind("SalesPersonID,FirstName,LastName,Phone,HireDate,Active")] SalesPerson salesPerson) { if (id != salesPerson.SalesPersonID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(salesPerson); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SalesPersonExists(salesPerson.SalesPersonID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(salesPerson)); }
public async Task <IActionResult> Edit(int id, [Bind("CustomerID,SalesPersonID,CompanyName,Contact,Phone,Fax,Email")] Customer customer) { if (id != customer.CustomerID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(customer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.CustomerID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(customer)); }
public async Task <IActionResult> Edit(int id, [Bind("idProductos,Marcaid,Categoriaid,descripcion,precio,precioTotal,imagen,Eskaintza,Deskontua")] Producto producto) { if (id != producto.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(producto); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductoExists(producto.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Categoriaid"] = new SelectList(_context.Categoria, "id", "id", producto.Categoriaid); ViewData["Marcaid"] = new SelectList(_context.Marcas, "id", "id", producto.Marcaid); return(View(producto)); }
public async Task<IActionResult> Edit(int id, [Bind("ID,Title,ReleaseDate,Genre,Price,Rating")] WebEdu_LocalVersion_YuQin_DotNetCore21.Admin.Models.Admin broweringOfTextbook) { if (id != broweringOfTextbook.ID) { return NotFound(); } if (ModelState.IsValid) { try { _context.Update(broweringOfTextbook); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MovieExists(broweringOfTextbook.ID)) { return NotFound(); } else { throw; } } return RedirectToAction(nameof(Index)); } return View(broweringOfTextbook); }
public async Task <IActionResult> Edit(string id, [Bind("SaskiaId")] Saskia saskia) { if (id != saskia.SaskiaId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(saskia); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SaskiaExists(saskia.SaskiaId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(saskia)); }
public async Task <IActionResult> Edit(int id, [Bind("ProductID,Name,Description,StandardPrice,UnityType,OnHand,Ordered,BackOrdered")] Product product) { if (id != product.ProductID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(product); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductExists(product.ProductID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Edit(int id, [Bind("idLinea,idPedido,idProducto,numlineas,unidades,precio")] Linea linea) { if (id != linea.idLinea) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(linea); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LineaExists(linea.idLinea)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(linea)); }
public void BezeroaAldatu(BezeroaEskaera bezeroaEskaera) { BezeroaEskaera zaharra = _context.BezeroaEskaera.SingleOrDefault(b => b.Izena == bezeroaEskaera.Izena); zaharra.Izena = bezeroaEskaera.Izena; zaharra.Abizena = bezeroaEskaera.Abizena; zaharra.Data = bezeroaEskaera.Data; zaharra.Helbidea = bezeroaEskaera.Helbidea; zaharra.Hiria = bezeroaEskaera.Hiria; zaharra.Herrialdea = bezeroaEskaera.Herrialdea; zaharra.Postakodea = bezeroaEskaera.Postakodea; zaharra.Telefonoa = bezeroaEskaera.Telefonoa; _context.Update(zaharra); _context.SaveChanges(); }
public async Task <IActionResult> Edit(int id, [Bind("erabiltzeId,PaswordOld,Pasword1,Pasword2")] pasahitzaAldatu aldatu) { Usuario user = AdminDbContext.user; try { user.password = aldatu.Pasword2; _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { } return(RedirectToAction(nameof(Index))); //return View(aldatu); }