Пример #1
0
        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));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
        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));
        }
Пример #5
0
        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));
        }
Пример #6
0
        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));
        }
Пример #7
0
        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));
        }
Пример #8
0
        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));
        }
Пример #9
0
        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));
        }
Пример #10
0
 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));
 }