Пример #1
0
 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");
     }
 }
Пример #2
0
        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");
        }
Пример #3
0
 public void UpdatePersonnelDetached(Personnel e)
 {
     utOfWork.PersonnelRepository.UpdatePersonnelDetached(e);
 }
Пример #4
0
        public void CreatePersonnel(Personnel Personnel)
        {

            utOfWork.PersonnelRepository.Add(Personnel);

        }