コード例 #1
0
ファイル: EPGSearch.aspx.cs プロジェクト: oxan/mpwebservices
 protected void ExecSearch()
 {
     ServiceInterface server = new ServiceInterface();
       List<WebProgram> progs = server.SearchEPG(edTitle.Text);
       DataTable dt = new DataTable();
       dt.Columns.Add("time", typeof(string));
       dt.Columns.Add("genre", typeof(string));
       dt.Columns.Add("channel", typeof(string));
       dt.Columns.Add("program", typeof(string));
       dt.Columns.Add("logo", 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["channel"] = p.channelName;
     row["program"] = "<b>" + GetScraperLink(p.Title) + "</b><br/>" + p.description;
     row["logo"]=Utils.GetLogoURL(p.channelName,true);
     row["idProgram"] = p.idProgram;
     dt.Rows.Add(row);
       }
       grid.DataSource = dt;
       grid.DataBind();
       int width; int height;
       Utils.GetThumbDimensions(out width, out height);
       grid.Columns[2].ControlStyle.Width = width;
       grid.Columns[2].ControlStyle.Height = height;
 }