public ActionResult ViewSuggestions() { var filePath = Server.MapPath(@"~/Suggestions/Suggestions.txt");; var ops = OperationsFactory.CreateSuggestionOperations(); var response = ops.DisplaySuggestions(filePath); return(View(response)); }
public ActionResult DeleteSuggestion(int suggestionID) { var filePath = Server.MapPath(@"~/Suggestions/Suggestions.txt");; var ops = OperationsFactory.CreateSuggestionOperations(); ops.DeleteSuggestions(suggestionID, filePath); return(RedirectToAction("ViewSuggestions")); }
public void DisplaySuggestionsTest() { Response <List <Suggestion> > response = new Response <List <Suggestion> >(); var ops = OperationsFactory.CreateSuggestionOperations(); response = ops.DisplaySuggestions("filepath"); Assert.IsTrue(response.Success); Assert.AreEqual(3, response.Data.Count); }
public ActionResult AddSuggestionForm(Suggestion suggestion) { var filePath = Server.MapPath(@"~/Suggestions/Suggestions.txt"); var ops = OperationsFactory.CreateSuggestionOperations(); ops.AddSuggestion(suggestion, filePath); return(View("ConfirmationPage")); }