public IActionResult DeleteFournit(string id)
        {
            Fourniture model = db.Fournitures.Find(id);

            db.Fournitures.Remove(model);
            db.SaveChanges();
            Liste();
            return(RedirectToAction("Index"));
        }
        public IActionResult CreateFourniture(string nom)
        {
            Fourniture model = new Fourniture {
                Nom = nom
            };

            db.Fournitures.Add(model);
            db.SaveChanges();
            return(RedirectToAction("Create"));
        }
        public IActionResult UpdateFournit(string id, string nom)
        {
            Fourniture model = new Fourniture {
                ID = id, Nom = nom
            };

            db.Fournitures.Update(model);
            db.SaveChanges();
            Liste();
            return(RedirectToAction("Index"));
        }
Example #4
0
 public void removeListart(List <Fourniture> art)
 {
     foreach (Fourniture f in art)
     {
         if (f.idfour > 0)
         {
             Fourniture fou = db.Fourniture.Single(a => a.idfour == f.idfour);
             db.Fourniture.Remove(fou);
             db.SaveChanges();
         }
     }
 }
Example #5
0
        public int findlastart()
        {
            int        numart = 0;
            Fourniture art    = new Fourniture();

            art = db.Fourniture.ToList().LastOrDefault();
            if (art == null)
            {
                numart = 1;
            }
            else
            {
                numart = (int)art.idfour;
            }

            return(numart);
        }
Example #6
0
 public void updatefourniture(Fourniture art)
 {
     db.Database.ExecuteSqlCommand("update Fourniture set quantitenstock='" + art.quantitenstock + "' where codefour='" + art.codefour + "'");
     db.SaveChanges();
 }
Example #7
0
        public void removeart(Fourniture art)
        {
            db.Fourniture.Remove(art);

            db.SaveChanges();
        }
Example #8
0
 //crud
 public void addFourniture(Fourniture art)
 {
     db.Fourniture.Add(art);
     db.SaveChanges();
 }