public async Task <IActionResult> Edit(int id, [Bind("TopicKeywordId,TopicItemId,TopicKeywordName,TopicKeywordRemark,KeywordCreateDate")] TopicKeyword topicKeyword)
        {
            if (id != topicKeyword.TopicKeywordId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(topicKeyword);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TopicKeywordExists(topicKeyword.TopicKeywordId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TopicItemId"] = new SelectList(_context.TopicItem, "TopicItemId", "TopicItemId", topicKeyword.TopicItemId);
            return(View(topicKeyword));
        }
Esempio n. 2
0
 public IActionResult EditKeyword([Bind("TopicKeywordId,TopicItemId," +
                                        "TopicKeywordName,TopicKeywordRemark,KeywordCreateDate")] TopicKeyword topicKeyword)
 {
     if (ModelState.IsValid)
     {
         _context.Update(topicKeyword);
         _context.SaveChanges();
         return(RedirectToAction(nameof(MyWorkSpace)));
     }
     return(View(topicKeyword));
 }
        public async Task <IActionResult> Create([Bind("TopicKeywordId,TopicItemId,TopicKeywordName,TopicKeywordRemark,KeywordCreateDate")] TopicKeyword topicKeyword)
        {
            if (ModelState.IsValid)
            {
                _context.Add(topicKeyword);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TopicItemId"] = new SelectList(_context.TopicItem, "TopicItemId", "TopicItemId", topicKeyword.TopicItemId);
            return(View(topicKeyword));
        }
Esempio n. 4
0
        ///********************Edit Keyword
        // GET: TopicKeywords/Edit/5
        // GET: TopicKeywords/Edit/5
        public IActionResult EditKeyword(int?id)
        {
            TopicKeyword myKeyw = _context.TopicKeyword.Find(id);

            return(View(myKeyw));
        }
Esempio n. 5
0
        // GET: TopicKeywords/CreateKeyword
        public IActionResult CreateKeyword()
        {
            TopicKeyword myKey = new TopicKeyword();

            return(View(myKey));
        }