Esempio n. 1
0
        public ActionResult Count()
        {
            RepeatCounter.ClearAll();

            //build list of word inputs
            int           numInputs  = Request.Form["word-input"].Count;
            List <string> wordInputs = new List <string> {
            };

            for (int i = 0; i < numInputs; i++)
            {
                string newWord = Request.Form["word-input"][i];
                wordInputs.Add(newWord);
            }

            //create RepeatCounter objects, check for validity & set counts
            foreach (string word in wordInputs)
            {
                RepeatCounter newCounter = new RepeatCounter(word, Request.Form["sentence-input"]);
                if (newCounter.IsValid())
                {
                    newCounter.SetCount();
                }
            }

            List <RepeatCounter> allCounters = RepeatCounter.GetAll();

            return(View("Index", allCounters));
        }
Esempio n. 2
0
        public ActionResult Display()
        {
            RepeatCounter.ClearAll();
            RepeatCounter newCount     = new RepeatCounter();
            string        userWord     = (Request.Form["userWord"]);
            string        userSentence = (Request.Form["userSentence"]);

            int result = RepeatCounter.WordCountCalc(userWord, userSentence);

            return(View("Index", newCount));
        }
        public ActionResult Display()
        {
            RepeatCounter.ClearAll();
            RepeatCounter newCount      = new RepeatCounter();
            string        inputWord     = (Request.Form["inputWord"]);
            string        inputSentence = (Request.Form["inputSentence"]);

            int result = RepeatCounter.WordCount(input, inputSentence);

            return(View("Index", newCount));
        }
 public void Dispose()
 {
     RepeatCounter.ClearAll();
 }
 public ActionResult Index()
 {
     RepeatCounter.ClearAll();
     return(View());
 }
 public ActionResult DeleteAll()
 {
     RepeatCounter.ClearAll();
     return(View());
 }
Esempio n. 7
0
 public ActionResult DeleteAll()
 {
     RepeatCounter.ClearAll();
     return(RedirectToAction("Index"));
 }
Esempio n. 8
0
 public ActionResult DeleteAll()
 {
     // RepeatCounter newRepeatCounter =new RepeatCounter();
     RepeatCounter.ClearAll();
     return(View());
 }