public async Task <IActionResult> Edit(int id, [Bind("CourseNoteId,ExamName,StudentCourseId")] CoursesNotes coursesNotes) { if (id != coursesNotes.CourseNoteId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(coursesNotes); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CoursesNotesExists(coursesNotes.CourseNoteId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["StudentCourseId"] = new SelectList(_context.StudentCourses, "StudentCourseId", "StudentCourseId", coursesNotes.StudentCourseId); return(View(coursesNotes)); }
//______________________________________________________课程笔记 public static bool Submit_CourseNote(int uid, int couid, int movid, string content) { ZZULIEntities ef = GetEntity(); CoursesNotes cn = new CoursesNotes() { User_ID = uid, Cou_ID = couid, Mov_ID = movid, CN_Content = content, CN_Time = DateTime.Now }; ef.CoursesNotes.Add(cn); return(ef.SaveChanges() > 0 ? true : false); }
public async Task <IActionResult> Create([Bind("CourseNoteId,ExamName,StudentCourseId")] CoursesNotes coursesNotes) { if (ModelState.IsValid) { _context.Add(coursesNotes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StudentCourseId"] = new SelectList(_context.StudentCourses, "StudentCourseId", "StudentCourseId", coursesNotes.StudentCourseId); return(View(coursesNotes)); }