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"); } }
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(); } }
public void UpdateServiceDDetached(ServiceD e) { utOfWork.ServiceDRepository.UpdateServiceDDetached(e); }
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(); } }