Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        ///********************Edit Note
        // GET: NoteTopics/EditNote
        public IActionResult EditNote(int?id)
        {
            NoteTopic myTopic = _context.NoteTopic.Find(id);

            return(View(myTopic));
        }
Exemplo n.º 5
0
        // GET: NoteTopics/CreateYopic
        public IActionResult CreateTopic()
        {
            NoteTopic myNote = new NoteTopic();

            return(View(myNote));
        }