public ActionResult CreatePersonnel(Personnel pers, FormCollection collection) { int idregion = db.FindRegionByBatiment(pers.idBatiment); int idgou = db.FindGouverneratByBatiment(pers.idBatiment); int idpays = db.FindPaysByBatiment(pers.idBatiment); int iddelegation = db.FindDelegationByBatiment(pers.idBatiment); int idorg = db.FindOrganisationByDelegation(pers.idBatiment); pers.idDelegation = iddelegation; pers.idRegion = idregion; pers.idOrganisation = idorg; pers.idPays = idpays; pers.idGouvernorat = idgou; try { BissInventaireEntities.Instance.Personnel.Add(pers); BissInventaireEntities.Instance.SaveChanges(); return RedirectToAction("GetPersonnel"); } catch (Exception ex) { LogThread.WriteLine(ex.Message); return RedirectToAction("Index", "Error"); } }
public ActionResult Edit(Personnel pers, FormCollection collection) { int idregion = db.FindRegionByBatiment(pers.idBatiment); int idgou = db.FindGouverneratByBatiment(pers.idBatiment); int idpays = db.FindPaysByBatiment(pers.idBatiment); int iddelegation = db.FindDelegationByBatiment(pers.idBatiment); int idorg = db.FindOrganisationByDelegation(pers.idBatiment); pers.idDelegation = iddelegation; pers.idRegion = idregion; pers.idOrganisation = idorg; pers.idPays = idpays; pers.idGouvernorat = idgou; db.UpdatePersonnelDetached(pers); db.SavePersonnel(); TempData["msg"] = "Modification Avec Succe !!!"; return RedirectToAction("GetPersonnel"); }
public void UpdatePersonnelDetached(Personnel e) { utOfWork.PersonnelRepository.UpdatePersonnelDetached(e); }
public void CreatePersonnel(Personnel Personnel) { utOfWork.PersonnelRepository.Add(Personnel); }