Beispiel #1
0
 public ActionResult Search(string search)
 {
     if (!String.IsNullOrEmpty(search))
     {
         // AR-139 Requirement: letting users to search with & character
         // that is searching using multiple words
         if (Regex.IsMatch(search, @"[\'\<\(\&\;]"))
         {
             ViewBag.Search = "-";
             ViewBag.Result = "Bad Input!";
         }
         else
         {
             ViewBag.Search = search;
             ViewBag.Result = IpsumGenerator.GenerateIpsum(3);
         }
     }
     return(View());
 }
Beispiel #2
0
        public ActionResult Search(string search)
        {
            if (!String.IsNullOrEmpty(search))
            {
                // AR-342 Requirement: being able to search
                // multiple words with & and empty characters

                // AR-572 Fast Track: being able to search
                // similar words with # character
                if (Regex.IsMatch(search, @"^[\w]+$"))
                {
                    ViewBag.Search = search;
                    ViewBag.Result = IpsumGenerator.GenerateIpsum(3);
                }
                else
                {
                    ViewBag.Search = "-";
                    ViewBag.Result = "Bad Input!";
                }
            }
            return(View());
        }
Beispiel #3
0
 public ActionResult Search(string search)
 {
     ViewBag.Search = search;
     ViewBag.Result = IpsumGenerator.GenerateIpsum(3);
     return(View());
 }