public ActionResult Create(int?idt) { ViewBag.Readonly = true; ViewBag.ReadonlyObservation = true; if (Session["ID"] != null && Session["Role"].Equals("Admin")) { if (idt != null) { ViewBag.IdC = col.getCollaboratorsNames(idt); DemandeVisa visaExiste = (from v in visa.afficherVisa() where v.IdC.Equals(idt) select v).FirstOrDefault(); if (visaExiste != null) { return(RedirectToAction("Edit", new { id = visaExiste.Id })); } } if (idt == null) { ViewBag.IdC = col.getCollaboratorsNames(idt); } return(View()); } return(RedirectToAction("Index", "Login")); }
// GET: Deplacements/Create /// <summary> /// Return formulaire to create new displacement /// </summary> /// <returns></returns> public ActionResult Create() { ViewBag.IdD = colaborateur.getCollaboratorsNames(null); ViewBag.IdSelected = new SelectList(Enumerable.Empty <SelectListItem>()); if (Session["ID"] != null && Session["Role"].Equals("Admin")) { return(View()); } return(RedirectToAction("Index", "Login")); }