public async Task <IActionResult> Create([Bind("CourseId,name,description,department,number,semeseter,year, professor, professorEmail")] Course course) { if (ModelState.IsValid) { _context.Add(course); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(course)); }
public async Task <IActionResult> Create([Bind("LearningOutcomeId,name,description,CourseNum")] LearningOutcome learningOutcome) { if (ModelState.IsValid) { _context.Add(learningOutcome); await _context.SaveChangesAsync(); return(RedirectToAction("ByCourse", new { number = learningOutcome.CourseNum })); } return(View(learningOutcome)); }
public async Task <IActionResult> Create([FromBody] CourseNote courseNote) { if (courseNote == null) { return(Json(new { success = false })); } _context.CourseNote.Add(courseNote); await _context.SaveChangesAsync(); return(Json(new { success = true })); }
public async Task <IActionResult> Create([FromBody] LearningOutcomeNote learningOutcomeNote) { if (learningOutcomeNote == null) { return(Json(new { success = false })); } _context.LearningOutcomeNote.Add(learningOutcomeNote); await _context.SaveChangesAsync(); return(Json(new { success = true })); }