protected void FillRecommendedEvents() { HttpCookie cookie = Request.Cookies["BrowserDate"]; Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"))); //only show top 10 int topCount = 10; //Put the sets together DataSet dsAll = dat.RetrieveRecommendedEvents(topCount, true); bool noneMessage = false; if (dsAll.Tables.Count > 0) if (dsAll.Tables[0].Rows.Count > 0) { //insert link to all recommended events Session["RecomDS"] = dsAll; Literal link = new Literal(); link.Text = "<h4 style=\"margin-bottom: 5px;\">Top 10 Recommended Events</h4><div><a class=\"NavyLink12\" onclick=\"OpenRadRecom();\">See All</a></div>"; RecommendedEvents.Controls.Add(link); Hashtable hash = new Hashtable(); ASP.controls_pager_ascx pagerPanel = new ASP.controls_pager_ascx(); pagerPanel.PANEL_NAME = "ctl00_ContentPlaceHolder1_ctl13_Panel"; pagerPanel.NUMBER_OF_ITEMS_PER_PAGE = 3; pagerPanel.PANEL_CSSCLASS = "FavoritesPanel"; pagerPanel.WIDTH = 260; ArrayList a = new ArrayList(topCount); for (int i = 0; i < topCount; i++) { dat.InsertOneEvent(dsAll, i, ref a, false); } RecommendedEvents.Controls.Add(pagerPanel); pagerPanel.DATA = a; pagerPanel.DataBind2(); } else { noneMessage = true; } else noneMessage = true; if (noneMessage) { Label lab = new Label(); lab.Text = "There are no recommended events here this month. There are a few reasons for this. "+ "There simply is no events that fit your recommendation criteria, or you have selected not to "+ "recommend any events. To modify your preferences please visit the 'My Preferences' tab on this page."; RecommendedEvents.Controls.Add(lab); } }
protected void FillEvents(DataSet dsAll) { HttpCookie cookie = Request.Cookies["BrowserDate"]; Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"))); int count = dsAll.Tables[0].Rows.Count; Encryption decrypt = new Encryption(); //if (Request.QueryString["message"] != null) // MessageLabel.Text = decrypt.decrypt(Request.QueryString["message"].ToString()); //else if (Session["Message"] != null) //{ // MessageLabel.Text = Session["Message"].ToString(); //} if (count > 0) { ASP.controls_pager_ascx pagerPanel = new ASP.controls_pager_ascx(); pagerPanel.NUMBER_OF_ITEMS_PER_PAGE = 6; pagerPanel.PANEL_NAME = "ctl02_Panel"; pagerPanel.PANEL_CSSCLASS = "FavoritesPanel"; pagerPanel.WIDTH = 650; ArrayList a = new ArrayList(count * 4); for (int i = 0; i < count; i++) { dat.InsertOneEvent(dsAll, i, ref a, true); } RecommendedEvents.Controls.Clear(); RecommendedEvents.Controls.Add(pagerPanel); pagerPanel.DATA = a; pagerPanel.DataBind2(); } else { Label lab = new Label(); lab.CssClass = "EventBody"; lab.Text = "<br/>No Recommended events in this time frame."; RecommendedEvents.Controls.Clear(); RecommendedEvents.Controls.Add(lab); } }