コード例 #1
0
        public ActionResult createMarque(Marque marque, FormCollection collection)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    if (etat)
                    {
                        BissInventaireEntities.Instance.Marque.Add(marque);
                        BissInventaireEntities.Instance.SaveChanges();
                        return RedirectToAction("getMarque");
                    }
                   else
                    {
                        return RedirectToAction("Index","Error");
                    }
                }
                catch (Exception ex)
                {
                    LogThread.WriteLine(ex.Message);
                    return RedirectToAction("Index", "Error");
                }
            }
            else

            {
                ViewData["categorie"] = new SelectList(BissInventaireEntities.Instance.Categorie.ToList(), "Id_categorie", "libelle");
                return View();
            }
        }
コード例 #2
0
        public ActionResult EditMarque(Marque Catm)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    db.UpdateMarqueDetached(Catm);
                    db.SaveMarque();
                    return RedirectToAction("getMarque");
                }
                catch (Exception ex)
                {
                    LogThread.WriteLine(ex.Message);
                    return RedirectToAction("Index", "Error");
                }
            }
            else

            {
                ViewData["categorie"] = new SelectList(BissInventaireEntities.Instance.Categorie.ToList(), "Id_categorie", "libelle");
                return View();
            }
        }
コード例 #3
0
 public void UpdateMarqueDetached(Marque e)
 {
     utOfWork.CategorieRepository.UpdateMarqueDetached(e);
 }