Ejemplo n.º 1
0
        public void CreateBatiment(Batiment Batiment)
        {

            utOfWork.BatimentRepository.Add(Batiment);


        }
Ejemplo n.º 2
0
 public ActionResult CreateBatiment(Batiment reg)
 {
     try
     {
         batiment.CreateBatiment(reg);
         batiment.SaveBatiment();
       
         return RedirectToAction("GetBatiment");
     }
     catch (Exception ex)
     {
         LogThread.WriteLine(ex.Message);
         return RedirectToAction("Index", "Error");
     }
 }
Ejemplo n.º 3
0
        public ActionResult EditBatiment(Batiment reg)
        {
            try
            {
                var bat = batiment.FindBatimentByID(reg.idBatiment);
            //var bat2 = BissInventaireEntities.Instance.Batiment.Find(reg.idBatiment);
            batiment.UpdateBatimentDetached(reg);
                batiment.SaveBatiment();

                return RedirectToAction("GetBatiment");
        }
            catch (Exception ex)
            {
                LogThread.WriteLine(ex.Message);
                return RedirectToAction("Index", "Error");
    }

}
Ejemplo n.º 4
0
        public ActionResult CreateBatiment(Batiment reg)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    if (etat)
                    {
                        batiment.CreateBatiment(reg);
                        batiment.SaveBatiment();

                        return RedirectToAction("GetBatiment");
                    }
                    else
                    {
                        return RedirectToAction("Index", "Error");
                    }
            }
                catch (Exception ex)
                {
                    LogThread.WriteLine(ex.Message);
                    return RedirectToAction("Index", "Error");

                    //MsgBox("An exception occurred:"+ ex.Message);
                }
            }
            else

            {

                ViewData["gouv"] = new SelectList(BissInventaireEntities.Instance.Gouvernorat.ToList(), "idGouvernorat", "libelle");
                ViewData["region"] = new SelectList(BissInventaireEntities.Instance.Region.ToList(), "idRegion", "libelle");
                ViewData["pays"] = new SelectList(BissInventaireEntities.Instance.Pays.ToList(), "idPays", "libelle");
                ViewData["delegations"] = new SelectList(BissInventaireEntities.Instance.Delegation.ToList(), "idDelegation", "libelle");
                ViewData["organisation"] = new SelectList(BissInventaireEntities.Instance.Organisation.ToList(), "idOrganisation", "libelle");

                return View();
            }
        }
Ejemplo n.º 5
0
        public ActionResult EditBatimentTest(Batiment bat)
        {
            if (ModelState.IsValid)
            {
                //try
                //{
                batiment.UpdateBatimentDetached(bat);
                batiment.SaveBatiment();
                return RedirectToAction("GetBatiment");
                //    }
                //    catch (Exception ex)
                //    {
                //        LogThread.WriteLine(ex.Message);
                //        return RedirectToAction("Index", "Error");
                //    }
                //}
            }
            else

            {
                ViewData["gouv"] = new SelectList(BissInventaireEntities.Instance.Gouvernorat.ToList(), "idGouvernorat", "libelle");
                ViewData["region"] = new SelectList(BissInventaireEntities.Instance.Region.ToList(), "idRegion", "libelle");
                ViewData["pays"] = new SelectList(BissInventaireEntities.Instance.Pays.ToList(), "idPays", "libelle");
                ViewData["delegations"] = new SelectList(BissInventaireEntities.Instance.Delegation.ToList(), "idDelegation", "libelle");
                ViewData["organisation"] = new SelectList(BissInventaireEntities.Instance.Organisation.ToList(), "idOrganisation", "libelle");
                return View();
            }
        }
Ejemplo n.º 6
0
 public void UpdateBatimentDetached(Batiment e)
 {
     utOfWork.BatimentRepository.UpdateBatimentDetached(e);
 }