Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        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));
        }