public IActionResult EditNote([Bind("NoteTopicId,UserProfileId,NoteTopicTitle," + "NoteTopicComment,TopicCreateDate")] NoteTopic noteTopic) { if (ModelState.IsValid) { _context.Update(noteTopic); _context.SaveChanges(); return(RedirectToAction(nameof(MyWorkSpace))); } return(View(noteTopic)); }
public async Task <IActionResult> Create([Bind("NoteTopicId,UserProfileId," + "NoteTopicTitle,NoteTopicComment,TopicCreateDate")] NoteTopic noteTopic) { if (ModelState.IsValid) { _context.Add(noteTopic); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserProfileId"] = new SelectList(_context.UserProfile, "UserProfileId", "Bio", noteTopic.UserProfileId); return(View(noteTopic)); }
public IActionResult Edit(int?id, [Bind("NoteTopicId,UserProfileId,NoteTopicTitle," + "NoteTopicComment,TopicCreateDate")] NoteTopic noteTopic) { if (id != noteTopic.NoteTopicId) { return(NotFound()); } if (ModelState.IsValid) { _context.Update(noteTopic); _context.SaveChanges(); return(RedirectToAction(nameof(Index))); } ViewData["UserProfileId"] = new SelectList(_context.UserProfile, "UserProfileId", "Bio", noteTopic.UserProfileId); return(View(noteTopic)); }
///********************Edit Note // GET: NoteTopics/EditNote public IActionResult EditNote(int?id) { NoteTopic myTopic = _context.NoteTopic.Find(id); return(View(myTopic)); }
// GET: NoteTopics/CreateYopic public IActionResult CreateTopic() { NoteTopic myNote = new NoteTopic(); return(View(myNote)); }