Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["authenticated"] == null)
     Response.Redirect("Login.aspx");
       ServiceInterface server = new ServiceInterface();
       Label1.Text = Request.QueryString["channelName"];
       List<WebProgram> progs=server.GetTodayEPGForChannel(Int32.Parse(Request.QueryString["idChannel"]));
       DataTable dt=new DataTable();
       dt.Columns.Add("time",typeof(string));
       dt.Columns.Add("genre", typeof(string));
       dt.Columns.Add("program",typeof(string));
       dt.Columns.Add("idProgram", typeof(int));
       foreach (WebProgram p in progs)
       {
     DataRow row = dt.NewRow();
     string s=p.startTime.ToString() + "-" + p.endTime.ToShortTimeString();
     if (p.startTime<DateTime.Now && p.endTime>DateTime.Now)
       s="<a name=\"currentdatetime\"></a>"+s;
     row["time"] = s;
     row["genre"] = p.genre;
     row["program"] = "<b>" + GetScraperLink(p.Title) + "</b><br/>" + p.description;
     row["idProgram"] = p.idProgram;
     dt.Rows.Add(row);
       }
       grid.DataSource = dt;
       grid.DataBind();
 }