Esempio n. 1
0
        public async Task <IActionResult> Edit(long id, [Bind("VenteId,ProduitId,AchatId,Quantite")] Vente vente)
        {
            if (id != vente.VenteId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VenteExists(vente.VenteId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(long id, [Bind("AchatId,ClientID,DateAchat")] Achat achat)
        {
            if (id != achat.AchatId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(achat);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AchatExists(achat.AchatId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientID"] = new SelectList(_context.Client, "ClientId", "ClientName", achat.ClientID);
            return(View(achat));
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(long id, [Bind("ProduitId,ProduitName,PrixUnitaire")] Produit produit)
        {
            if (id != produit.ProduitId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(produit);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProduitExists(produit.ProduitId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(produit));
        }
Esempio n. 4
0
        public async Task <IActionResult> Edit(long id, [Bind("ClientId,ClientName,ClientPrenom")] Client client)
        {
            if (id != client.ClientId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(client);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClientExists(client.ClientId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Esempio n. 5
0
        public async Task <IActionResult> Edit(long id, [Bind("FacturationId,AchatId,PrixTotal")] Facturation facturation)
        {
            if (id != facturation.FacturationId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(facturation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FacturationExists(facturation.FacturationId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AchatId"] = new SelectList(_context.Achat, "AchatId", "AchatId", facturation.AchatId);
            return(View(facturation));
        }