public ActionResult PerformSearch(AdminSearchUserModel m) { if (m.Email == null) { ViewBag.InvalidEmail = "Please do not leave blank. Try Again."; return(View("SearchUsers", m)); } if (m.Email.Length > 100) { ViewBag.InvalidEmail = "Email too long. Try Again."; } grabFromDB DB = new grabFromDB(); if (DB.getUserListByEmail(m.Email).Count != 1) { ViewBag.InvalidEmail = "That user does not exist. Try Again."; return(View("SearchUsers", m)); } else { User user = new User(); user = DB.getUserListByEmail(m.Email)[0]; ViewBag.User = user; Globals.setUserToModify(user); AdminUserResultModel model = new AdminUserResultModel(); var universities = GetAllUniversities(); model.Universities = GetSelectListItems(universities); return(View("UserEdit", model)); } }
public ActionResult SearchUsers() { AdminSearchUserModel model = new AdminSearchUserModel(); return(View("SearchUsers", model)); }