Exemple #1
0
 // GET: Curricula/Create
 public ActionResult Create(int courseId)
 {
     var model = new CreateCurriculumViewmodel {
              Teachers = GetTeachers()
         };
     return View(model);
 }
Exemple #2
0
 public ActionResult Create([Bind(Include = "CurriculumId,CourseId,CurriculumName,TeacherId")] Curriculum curriculum)
 {
     if (ModelState.IsValid)
     {
         CurriculaRepo.InsertOrUpdate(curriculum);
         return RedirectToAction("Index");
     }
         var model = new CreateCurriculumViewmodel {
              CurriculumId = curriculum.CurriculumId,
              CurriculumName = curriculum.CurriculumName,
              CourseId = curriculum.CourseId,
              Teachers = GetTeachers(),
              TeacherId = curriculum.TeacherId
         };
         return View(model);
 }
Exemple #3
0
 // GET: Curricula/Edit/5
 public ActionResult Edit(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     Curriculum curriculum = CurriculaRepo.Find((int)id);
     if (curriculum == null)
     {
         return HttpNotFound();
     }
         var model = new CreateCurriculumViewmodel {
              CurriculumId = curriculum.CurriculumId,
              CurriculumName = curriculum.CurriculumName,
              CourseId = curriculum.CourseId,
              Teachers = GetTeachers(),
              TeacherId = curriculum.TeacherId
         };
         return View(model);
 }