public async Task <IActionResult> Create([Bind("BlogThemeId,BlogThemetitle,ThemeCreateDate")] BlogTheme blogTheme) { if (ModelState.IsValid) { _context.Add(blogTheme); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(blogTheme)); }
public async Task <IActionResult> Create([Bind("UserProfileId,FirstName,LastName,NickName,Age,Bio,ProfileCreateDate,UserProfileAccount")] UserProfile userProfile) { if (ModelState.IsValid) { _context.Add(userProfile); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(userProfile)); }
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)); }
public async Task <IActionResult> Create([Bind("BlogPostId,BlogInfoId,BlogPostTitle,BlogText,PostCreateDate")] BlogPost blogPost) { if (ModelState.IsValid) { _context.Add(blogPost); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BlogInfoId"] = new SelectList(_context.BlogInfo, "BlogInfoId", "BlogInfoId", blogPost.BlogInfoId); return(View(blogPost)); }
public async Task <IActionResult> Create([Bind("BlogSubThemeId,BlogThemeId,BlogSubThemetitle,SubThemeCreateDate")] BlogSubTheme blogSubTheme) { if (ModelState.IsValid) { _context.Add(blogSubTheme); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BlogThemeId"] = new SelectList(_context.BlogTheme, "BlogThemeId", "BlogThemetitle", blogSubTheme.BlogThemeId); return(View(blogSubTheme)); }
public async Task <IActionResult> Create([Bind("TopicItemId,NoteTopicId,BlogPostId,TopicItemThought,ItemCreateDate")] TopicItem topicItem) { if (ModelState.IsValid) { _context.Add(topicItem); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BlogPostId"] = new SelectList(_context.BlogPost, "BlogPostId", "BlogText", topicItem.BlogPostId); ViewData["NoteTopicId"] = new SelectList(_context.NoteTopic, "NoteTopicId", "NoteTopicComment", topicItem.NoteTopicId); return(View(topicItem)); }
public async Task <IActionResult> Create([Bind("BlogInfoId,BlogSubThemeId,BlogInfoTitle,UserProfileId,InfoCreateDate")] BlogInfo blogInfo) { if (ModelState.IsValid) { _context.Add(blogInfo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BlogSubThemeId"] = new SelectList(_context.BlogSubTheme, "BlogSubThemeId", "BlogSubThemetitle", blogInfo.BlogSubThemeId); ViewData["UserProfileId"] = new SelectList(_context.UserProfile, "UserProfileId", "Bio", blogInfo.UserProfileId); return(View(blogInfo)); }
public async Task <IActionResult> Create([Bind("LogGroupingId,UserProfileId,LogGroupingtitle," + "LogGroupingComment,GroupingCreateDate")] LogGrouping logGrouping) { if (ModelState.IsValid) { _context.Add(logGrouping); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserProfileId"] = new SelectList(_context.UserProfile, "UserProfileId", "Bio", logGrouping.UserProfileId); return(View(logGrouping)); }
public async Task <IActionResult> Create([Bind("GroupedItemId,LogGroupingId,BlogPostId," + "GroupedItemComment,ItemCreateDate")] GroupedItem groupedItem) { if (ModelState.IsValid) { _context.Add(groupedItem); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BlogPostId"] = new SelectList(_context.BlogPost, "BlogPostId", "BlogText", groupedItem.BlogPostId); ViewData["LogGroupingId"] = new SelectList(_context.LogGrouping, "LogGroupingId", "LogGroupingComment", groupedItem.LogGroupingId); return(View(groupedItem)); }
public IActionResult AddItem([Bind("LogGroupingId,BlogPostId," + "GroupedItemComment,ItemCreateDate")] GroupedItem groupedItem) { if (ModelState.IsValid) { _context.Add(groupedItem); //wait scaffoled controllers Add to the table,not the dB _context.SaveChanges(); return(RedirectToAction(nameof(MyPersonalLog))); //so now we tell the app where to return to! } return(View(groupedItem)); }