protected void Page_Load(object sender, EventArgs e)
{
if (Session["userDetails"] == null)
{
Response.Redirect("~/Account/Login.aspx");
}
else if (Request.QueryString["Term"] == null)
{
Response.Redirect("~/Groups/Groups.aspx");
}
else
{
var userDetails = (User)Session["userDetails"];
this.userID = userDetails.UserID;
String[] terms = Request.QueryString["Term"].Split();
List<String> searchTerms = new List<String>(terms);
List<Group> results = new List<Group>();
foreach (String searchTerm in searchTerms)
{
List<Group> searchGroups = GroupDAO.GetAllGroupsByName(searchTerm);
List<Group> taggedGroups = GroupDAO.GetAllGroupsByHashTag(searchTerm);
ListUnion_NoRepeats(searchGroups, taggedGroups);
ListUnion_NoRepeats(results, searchGroups);
}
Color[] backColors = { Color.FromArgb(34, 139, 34), Color.White };
Color[] textColors = { Color.White, Color.Black };
SearchGroupsDisplayTable1.PopulateGroupsTable(results, backColors, textColors);
}
}