Exemplo n.º 1
0
 public ActionResult Search(ContactSearch newContact)
 {
     aCookie = Request.Cookies["loginCookie"];
     if (aCookie != null)
     {
         var searchList = new List<Contact>();
         if (ModelState.IsValid)
         {
             UserName = Server.HtmlEncode(aCookie.Value);
             user = userRepo.GetUserByName(UserName);
             searchList = userRepo.GetSearchedUserContacts(user,newContact.SearchQuery);
             newContact.UserList = searchList;
             return View(newContact);
         }
         else
         {
             newContact.UserList = searchList;
             return View(newContact);
         }
     }
     return RedirectToAction("Index", "Home");
 }
Exemplo n.º 2
0
 //
 // GET: /Contact/Search
 public ActionResult Search()
 {
     aCookie = Request.Cookies["loginCookie"];
     if (aCookie != null)
     {
         var searchList = new ContactSearch();
         return View(searchList);
     }
     return RedirectToAction("Index", "Home");
 }