public ViewResult Story(string thestory, string username, string email, string title, bool ismember) { Story tale = new Story(); tale.IsMember = ismember; tale.Title = title; tale.TheStory = thestory; tale.Username = username; tale.Email = email; tale.Date = DateTime.Now; User user1 = new User(); user1.IsMember = ismember; user1.UserName = username; user1.EMAIL = email; StoryRepository.AddStory(tale); StoryRepository.AddUser(user1); ViewBag.storyCount = StoryRepository.GetStoryCount(); ViewBag.userCount = StoryRepository.GetUserCount(); return(View("StoryPage", StoryRepository.Stories)); }
public ViewResult StoryForm(Stories storyForm) { if (ModelState.IsValid) { StoryRepository.AddStory(storyForm); return(View("SubmittedStory", storyForm)); } else { // there is a validation error return(View()); } }