public ActionResult AddSections(int id, int count)
 {
     var learningMaterial = _learningMatService.GetById(id);
     for (int i = 0; i < count; i++)
     {
         var newSection = new NHiberanteDal.DTO.SectionDto {Title = "New Section"};
         learningMaterial.Sections.Add(newSection);
     }
     var ok = _learningMatService.Update(learningMaterial);
     return Json(new ResponseMessage(ok));
 }
Exemplo n.º 2
0
        public ActionResult AddSections(int id, int count)
        {
            var learningMaterial = _learningMatService.GetById(id);

            for (int i = 0; i < count; i++)
            {
                var newSection = new NHiberanteDal.DTO.SectionDto {
                    Title = "New Section"
                };
                learningMaterial.Sections.Add(newSection);
            }
            var ok = _learningMatService.Update(learningMaterial);

            return(Json(new ResponseMessage(ok)));
        }