public ActionResult Imprimer(int?id)
        {
            //condition pas encore
            if (id == null)
            {
                //return RedirectToAction("Index", "Default");
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var currentDemande = demandeService.ReadById(id.Value);

            if (currentDemande == null)
            {
                return(HttpNotFound($"this demande ({id}) is not found"));
            }

            demandeconge demandeconge = db.demandeconge.Find(id);

            Session["uid"] = currentDemande.idDemandeConge;

            if (demandeconge == null)
            {
                return(HttpNotFound());
            }

            return(View(demandeconge));
        }
        public ActionResult validation(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var currentDemande = demandeService.ReadById(id.Value);

            if (currentDemande == null)
            {
                return(HttpNotFound($"this demande ({id}) is not found"));
            }


            demandeconge demandeconge = db.demandeconge.Find(id);

            Session["uid"] = currentDemande.idDemandeConge;

            if (demandeconge == null)
            {
                return(HttpNotFound());
            }

            return(View(demandeconge));
        }
示例#3
0
        /*   public ActionResult historique()
         * {
         *     var employes = db.demandeconge;
         *     var demandeConge = new List<demandeconge>();
         *
         *
         *     foreach (var item in employes)
         *     {
         *         if (item.ValidationN2 == "accepte" && item.ValidationN1 == "accepte" && item.ValidationRH == "En cours")
         *
         *             demandeConge = db.demandeconge.Include(d => d.employe).Include(d => d.typeconge).ToList();
         *
         *
         *     }
         *     return View(demandeConge.ToList());
         *
         * }*/
        public ActionResult Validation(int?id)
        {
            if (id == null)
            {
                //return RedirectToAction("Index", "Default");
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var currentDemande = demandeService.ReadById(id.Value);

            if (currentDemande == null)
            {
                return(HttpNotFound($"this demande ({id}) is not found"));
            }

            demandeconge demandeconge = db.demandeconge.Find(id);

            Session["uid"] = currentDemande.idDemandeConge;

            if (demandeconge == null)
            {
                return(HttpNotFound());
            }

            return(View(demandeconge));

            /*
             * var historiqueModel = new HistoriqueModel
             * {
             *  IdDemande = currentDemande.idDemandeConge,
             *  IdType = currentDemande.IdtypeConge,
             *  //Nom = currentDemande.employe.NomComplet,
             *  //matricule = currentDemande.employe.matricule,
             *  DateD = (DateTime)currentDemande.DateDebut,
             *  DateF = (DateTime)currentDemande.DateFin,
             *  Datedc = (DateTime)currentDemande.DateDC,
             *  validation1 = currentDemande.ValidationN1,
             *  validation2 = currentDemande.ValidationN2,
             *  IdEmploye = currentDemande.IdEmploye
             *
             *
             *
             * };
             *
             * return View(historiqueModel);*/
        }