public async Task <IActionResult> Edit(Guid id, [Bind("Id,NoSiret,Nom,Adresse,NoTel,Mail")] Client client) { if (id != client.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(client); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientExists(client.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(client)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,IdFacture,Nom,Montant,Description")] Prestation prestation) { if (id != prestation.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(prestation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrestationExists(prestation.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdFacture"] = new SelectList(_context.Factures, "Id", "Id", prestation.IdFacture); return(View(prestation)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,IdClient,NoFacture,DateEmission,DateReglement,Description")] Facture facture) { if (id != facture.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(facture); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FactureExists(facture.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdClient"] = new SelectList(_context.Clients, "Id", "Nom", facture.IdClient); return(View(facture)); }