コード例 #1
0
 public ActionResult AddAssignment(Assignment model)
 {
     using (var db = new SWC_LMSEntities())
     {
         db.Assignments.Add(model);
         db.SaveChanges();
     }
     return RedirectToAction("CourseGradebook", "Teacher", new{courseId=model.CourseId});
 }
コード例 #2
0
 public ActionResult AddAssignment(int courseId)
 {
     var viewModel = new Assignment {CourseId = courseId};
     return View(viewModel);
 }