public IHttpActionResult Edit(SectionListItem sectionModel)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            Section section = service.SectionEdit(sectionModel);
            service.Save();

            return Json(new SectionListItem(section));
        }
 public CadetListItem(Cadet cadet)
 {
     CadetID = cadet.CadetID;
     Prenom = cadet.Prenom;
     Nom = cadet.Nom;
     NbBilletsDistribue = cadet.NbBilletsDistribue;
     NbBilletsVendu = cadet.NbBilletsVendu;
     if(cadet.Grade == null)
     {
         Grade = new GradeListItem() { GradeID = -1 };
     }
     else
     {
         Grade = new GradeListItem(cadet.Grade);
     }
     if (cadet.Section == null)
     {
         Section = new SectionListItem() { SectionID = -1 };
     }
     else
     {
         Section = new SectionListItem(cadet.Section);
     }
 }
        public Section SectionEdit(SectionListItem sectionModel)
        {
            Section section = SectionGetByID(sectionModel.SectionID);
            section.Nom = sectionModel.Nom;

            return section;
        }