Exemplo n.º 1
0
        public ActionResult Update()
        {
            EleveVM elevevm = new EleveVM(EleveRequest.GetEleveById(long.Parse(User.Identity.Name)));

            ViewBag.Classe = new SelectList(ClasseRequest.GetAllClasses(), "id", "libelle", elevevm.Eleve.idClasse);
            return(View(elevevm));
        }
Exemplo n.º 2
0
 public Retard(int id, string titre, string description, string file, int idEleve, int idUserConnecte)
 {
     this.id          = id;
     this.titre       = titre;
     this.description = description;
     this.file        = "https://picsum.photos/200";
     this.eleve       = EleveRequest.GetEleveById(idEleve);
     votes            = Vote.GetValueFromList(VoteRequest.getVoteByRetard(id));
     currentUserVote  = DidIVoted(idUserConnecte, id);
 }
Exemplo n.º 3
0
 public ActionResult Edit(Retard retard)
 {
     if (ModelState.IsValid)
     {
         retard.file  = Request["fileEnvoie"];
         retard.eleve = EleveRequest.GetEleveById(Convert.ToInt64(Request["Eleve"]));
         RetardRequest.Update(retard);
         return(RedirectToAction("Index", "Home"));
     }
     ViewBag.Retards_Tags = new SelectList(TagsRequest.GetTags(), "id", "libelle");
     //ViewBag.Eleve = new SelectList(EleveRequest.GetEleves(), "id", "pseudo");
     return(View());
 }
Exemplo n.º 4
0
        public ActionResult Create([Bind(Include = "id,titre,description,Retards_Tags,pj")] Retard retard)
        {
            if (ModelState.IsValid)
            {
                retard.file  = Request["fileEnvoie"];
                retard.eleve = EleveRequest.GetEleveById(Int32.Parse(User.Identity.Name));
                RetardRequest.Create(retard);
                retard = RetardRequest.getLastRetard(retard);
                Retards_Tags rt = new Retards_Tags {
                    Id_Retard = retard.id, Id_Tags = Int32.Parse(Request["Retards_Tags"])
                };
                Tags_RetardRequest.Create(rt);


                return(RedirectToAction("Index", "Home"));
            }


            ViewBag.Retards_Tags = new SelectList(TagsRequest.GetTags(), "id", "libelle");
            //ViewBag.Eleve = new SelectList(EleveRequest.GetEleves(), "id", "pseudo");
            return(View());
        }