public ActionResult createModele(Modele modele, FormCollection collection)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    if (etat)
                    {
                        BissInventaireEntities.Instance.Modele.Add(modele);
                        BissInventaireEntities.Instance.SaveChanges();
                        return RedirectToAction("getModele");
                    }
                  else
                    {
                        return RedirectToAction("Index","Error");
                    }
                }
                catch (Exception ex)
                {
                    LogThread.WriteLine(ex.Message);
                    return RedirectToAction("Index", "Error");
                }
            }
            else

            {

                return View();
            }
        }
        public ActionResult EditCategorie_Modele(Modele Catm)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    db.UpdateCategorie_ModeleDetached(Catm);
                    db.SaveCategorie_materiel();
                    return RedirectToAction("getModele");
                }
                catch (Exception ex)
                {
                    LogThread.WriteLine(ex.Message);
                    return RedirectToAction("Index", "Error");
                }
            }
            else

            {
                return View();
            }
        }
Пример #3
0
 public void UpdateCategorie_ModeleDetached(Modele e)
 {
     utOfWork.CategorieRepository.UpdateCategorie_ModeleDetached(e);
 }