예제 #1
0
        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"));
        }
예제 #2
0
 // 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"));
 }