Esempio n. 1
0
 public ActionResult EditServiceD(ServiceD Catm, FormCollection collection)
 {
     try
     {
         db.UpdateServiceDDetached(Catm);
        db.SaveServiceD();
         return RedirectToAction("GetServiceD");
     }
     catch (Exception ex)
     {
         LogThread.WriteLine(ex.Message);
         return RedirectToAction("Index", "Error");
     }
 }
Esempio n. 2
0
 public ActionResult CreateServiceD(ServiceD Catm, FormCollection collection)
 {
     try
     {
         BissInventaireEntities.Instance.ServiceD.Add(Catm);
         BissInventaireEntities.Instance.SaveChanges();
         return RedirectToAction("GetServiceD");
     }
     catch (Exception ex)
     {
         LogThread.WriteLine(ex.Message);
         return RedirectToAction("Index", "Error");
     }
 }
        public ActionResult CreateServiceD(ServiceD Catm, FormCollection collection)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    BissInventaireEntities.Instance.ServiceD.Add(Catm);
                    BissInventaireEntities.Instance.SaveChanges();
                    return RedirectToAction("GetServiceD");
                }
                catch (Exception ex)
                {
                    LogThread.WriteLine(ex.Message);
                    return RedirectToAction("Index", "Error");
                }
            }
            else

            {
                ViewData["Direction"] = new SelectList(BissInventaireEntities.Instance.Direction.ToList(), "Id_direction", "Libelle");
                return View();
            }
        }
Esempio n. 4
0
 public void UpdateServiceDDetached(ServiceD e)
 {
     utOfWork.ServiceDRepository.UpdateServiceDDetached(e);
 }
Esempio n. 5
0
        public void CreateServiceD(ServiceD ServiceD)
        {

            utOfWork.ServiceDRepository.Add(ServiceD);

        }
        public ActionResult EditServiceD(ServiceD reg)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    db.UpdateServiceDDetached(reg);
                    db.SaveServiceD();
                    return RedirectToAction("GetServiceD");
                }
                catch (Exception ex)
                {
                    LogThread.WriteLine(ex.Message);
                    return RedirectToAction("Index", "Error");
                }
            }
            else

            {
                ViewData["Direction"] = new SelectList(BissInventaireEntities.Instance.Direction.ToList(), "Id_direction", "Libelle");
                
                return View();
            }
        }