public async Task <IActionResult> Create([Bind("ProduitId,ProduitName,PrixUnitaire")] Produit produit) { if (ModelState.IsValid) { _context.Add(produit); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(produit)); }
public async Task <IActionResult> Create([Bind("ClientId,ClientName,ClientPrenom")] Client client) { if (ModelState.IsValid) { _context.Add(client); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(client)); }
public async Task <IActionResult> Create([Bind("AchatId,ClientID,DateAchat")] Achat achat) { if (ModelState.IsValid) { _context.Add(achat); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ClientID"] = new SelectList(_context.Client, "ClientId", "ClientName", achat.ClientID); return(View(achat)); }
public async Task <IActionResult> Create([Bind("FacturationId,AchatId,PrixTotal")] Facturation facturation) { if (ModelState.IsValid) { _context.Add(facturation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AchatId"] = new SelectList(_context.Achat, "AchatId", "AchatId", facturation.AchatId); return(View(facturation)); }
public async Task <IActionResult> Create([Bind("VenteId,ProduitId,AchatId,Quantite")] Vente vente) { if (ModelState.IsValid) { _context.Add(vente); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AchatId"] = new SelectList(_context.Achat, "AchatId", "AchatId", vente.AchatId); ViewData["ProduitId"] = new SelectList(_context.Produit, "ProduitId", "ProduitName", vente.ProduitId); return(View(vente)); }