Esempio n. 1
0
        public void createDepot(Depot depot)
        {

            utOfWork.DepotRepository.Add(depot);


        }
Esempio n. 2
0
 public void UpdateDepotDetached(Depot e)
 {
     utOfWork.DepotRepository.UpdateDepotDetached(e);
 }
        public ActionResult EditDepot(Depot dep, FormCollection collection)
        {

            if (ModelState.IsValid)
            {

                depo.UpdateDepotDetached(dep);
                depo.SaveDepot();

                return RedirectToAction("getDepots");

            }
            else

            {
                ViewData["pays"] = new SelectList(BissInventaireEntities.Instance.Pays.ToList(), "libelle", "libelle");
                ViewData["gouvernourat"] = new SelectList(BissInventaireEntities.Instance.Gouvernorat.ToList(), "idGouvernorat", "libelle");
                ViewData["delegation"] = new SelectList(BissInventaireEntities.Instance.Delegation.ToList(), "idDelegation", "libelle");
                ViewData["region"] = new SelectList(BissInventaireEntities.Instance.Region.ToList(), "idRegion", "libelle");

                return View();
            }
        }
        public ActionResult CreateDepot(Depot dep, FormCollection collection)
        {
            if (Session["identifiant"] == null)
            { return RedirectToAction("Index", "Home"); }
            if (ModelState.IsValid)
            {
                if (etat)
                {
                    depo.createDepot(dep);
                    depo.SaveDepot();

                    return RedirectToAction("getDepots");
                }
                else
                {
                    return RedirectToAction("Index", "Error");
                }

            }
            else

            {
                //  ViewBag.msg = "Verifier l code postal";
                ViewData["pays"] = new SelectList(BissInventaireEntities.Instance.Pays.ToList(), "libelle", "libelle");
                ViewData["gouvernourat"] = new SelectList(BissInventaireEntities.Instance.Gouvernorat.ToList(), "idGouvernorat", "libelle");
                ViewData["delegation"] = new SelectList(BissInventaireEntities.Instance.Delegation.ToList(), "idDelegation", "libelle");
                ViewData["region"] = new SelectList(BissInventaireEntities.Instance.Region.ToList(), "idRegion", "libelle");

                return View();
            }
        }