示例#1
0
        public ActionResult ViewSuggestions()
        {
            var filePath = Server.MapPath(@"~/Suggestions/Suggestions.txt");;
            var ops      = OperationsFactory.CreateSuggestionOperations();
            var response = ops.DisplaySuggestions(filePath);

            return(View(response));
        }
示例#2
0
        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);
        }
示例#4
0
        public ActionResult AddSuggestionForm(Suggestion suggestion)
        {
            var filePath = Server.MapPath(@"~/Suggestions/Suggestions.txt");
            var ops      = OperationsFactory.CreateSuggestionOperations();

            ops.AddSuggestion(suggestion, filePath);

            return(View("ConfirmationPage"));
        }