public ActionResult Edit(int id, DateTime datedebut, int choixchantier, JDTPost jdtpost) { if (SessionManager.SessionUser != null) { try { _serviceJDT.Update(id, new JournalDesTravaux(jdtpost.PersonnelId, jdtpost.PosteId, jdtpost.DateChantier, jdtpost.HeuresProd, jdtpost.VoitPerso, jdtpost.ZoneDepl, jdtpost.ChefChantierId, SessionManager.SessionUser.PersonnelId, jdtpost.EstValide)); TempData["choixchantier"] = choixchantier; TempData["datedebut"] = datedebut; return(RedirectToAction("Index", new { choixchantier = @TempData["choixchantier"], datedebut = @TempData["datedebut"] })); } catch (Exception ex) { return(View()); } } else { return(RedirectToAction("../../Home/Index")); } }
public ActionResult Create(DateTime datedebut, int choixchantier) { if (SessionManager.SessionUser != null) { TempData["choixchantier"] = choixchantier; TempData["datedebut"] = datedebut; JDTPost jdtpost = new JDTPost(); jdtpost.Poste = vgetlist.GetVPostes().Where(p => p.ChantierId == (int)TempData["choixchantier"]); jdtpost.Personnel = vgetlist.GetVPersonnels(); listdate.Add((DateTime)datedebut); for (int i = 1; i < 7; i++) { listdate.Add(((DateTime)datedebut).AddDays(i)); } jdtpost.ListeDate = listdate; return(View("Create", jdtpost)); } else { return(RedirectToAction("../../Home/Index")); } }
public void Update(int id, JDTPost jdtpost) { _service.Update(id, new JournalDesTravaux(jdtpost.PersonnelId, jdtpost.PosteId, jdtpost.DateChantier, jdtpost.HeuresProd, jdtpost.VoitPerso, jdtpost.ZoneDepl, jdtpost.ChefChantierId, jdtpost.Login, jdtpost.EstValide)); }
public int Create(JDTPost jdtpost) //public int Create(JournalDesTravaux jdtpost) { return(_service.Create(new JournalDesTravaux(jdtpost.PersonnelId, jdtpost.PosteId, jdtpost.DateChantier, jdtpost.HeuresProd, jdtpost.VoitPerso, jdtpost.ZoneDepl, jdtpost.ChefChantierId, jdtpost.Login, jdtpost.EstValide))); }