From: <mas...@us...> - 2007-04-18 16:38:09
|
Revision: 43 http://svn.sourceforge.net/mp-webinterface/?rev=43&view=rev Author: maschine Date: 2007-04-18 09:38:04 -0700 (Wed, 18 Apr 2007) Log Message: ----------- First version of the guide view. Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/Default.aspx.designer.cs trunk/Version2/Web App/MPW/css/mpw_style.css Modified: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx 2007-04-16 13:22:05 UTC (rev 42) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-04-18 16:38:04 UTC (rev 43) @@ -1,10 +1,12 @@ -<%@ Page Language="C#" MasterPageFile="~/MPW.Master" AutoEventWireup="true" - Codebehind="Default.aspx.cs" Inherits="MPW.MasterPages.WebForm11" Title="Untitled Page" %> +<%@ Page Language="C#" MasterPageFile="~/MPW.Master" AutoEventWireup="true" Codebehind="Default.aspx.cs" + Inherits="MPW.MasterPages.WebForm11" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" runat="server"> <br /> <asp:Button ID="ButtonPrev" runat="server" Text="<" /> <asp:Button ID="ButtonNext" runat="server" Text=">" /> + <asp:DropDownList ID="GroupDropDown" runat="server"> + </asp:DropDownList> <asp:DropDownList ID="TimeDropDown" runat="server"> </asp:DropDownList> <asp:DropDownList ID="DateDropDown" runat="server"> @@ -12,7 +14,7 @@ <br /> <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> <ContentTemplate> - <asp:Table ID="Guide" runat="server" HorizontalAlign="Left"> + <asp:Table ID="Guide" runat="server" Width="90%"> </asp:Table> </ContentTemplate> <Triggers> Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-04-16 13:22:05 UTC (rev 42) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-04-18 16:38:04 UTC (rev 43) @@ -40,24 +40,84 @@ channels.Remove(channel); } + //The Time + TableRow timerow = new TableRow(); + TableCell spacer = new TableCell(); + timerow.Cells.Add(spacer); + + for (int i = 0; i < 3; i++) + { + TableCell cell = new TableCell(); + cell.Text = "| " + guideStart.AddHours(i).ToShortTimeString(); + cell.Width = 180; + timerow.Cells.Add(cell); + } + Guide.Rows.Add(timerow); + //Iterate through all the channels foreach (Channel channel in channels) { TableRow r = new TableRow(); TableCell cell_channel = new TableCell(); TableCell cell_program = new TableCell(); + cell_program.ColumnSpan = 3; Label lbl_channel = new Label(); lbl_channel.Text = "<strong>" + channel.Name + "</strong>"; - Label lbl_program = new Label(); - lbl_program.Text = "EPG"; - cell_channel.Controls.Add(lbl_channel); cell_channel.CssClass = "guideChannel"; - cell_program.Controls.Add(lbl_program); + try + { + Program current = channel.GetProgramAt(guideStart); + Table programsTable = new Table(); + TableRow programsRow = new TableRow(); + + TableCell firstcell = new TableCell(); + firstcell.CssClass = "guidecell"; + + TimeSpan widthTime = current.EndTime - guideStart; + Unit widthPixel = new Unit(widthTime.Minutes.ToString()); + firstcell.Width = widthPixel; + firstcell.Text = current.Title; + programsRow.Cells.Add(firstcell); + + bool more = true; + + while (more == true) + { + Program next = channel.GetProgramAt(current.EndTime.AddMinutes(1)); + if (next.EndTime <= guideEnd) + { + TableCell nextcell = new TableCell(); + nextcell.CssClass = "guidecell"; + + widthTime = next.EndTime - next.StartTime; + widthPixel = new Unit(widthTime.Minutes.ToString()); + nextcell.Width = widthPixel; + nextcell.Text = next.Title; + programsRow.Cells.Add(nextcell); + current = next; + } + else + { + more = false; + } + } + + programsTable.Rows.Add(programsRow); + cell_program.Controls.Add(programsTable); + + } + catch + { + Label noEPG = new Label(); + noEPG.Text = Resources.Resource.NoEPGInfo; + cell_program.Controls.Add(noEPG); + } + r.Cells.Add(cell_channel); r.Cells.Add(cell_program); Modified: trunk/Version2/Web App/MPW/Default.aspx.designer.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.designer.cs 2007-04-16 13:22:05 UTC (rev 42) +++ trunk/Version2/Web App/MPW/Default.aspx.designer.cs 2007-04-18 16:38:04 UTC (rev 43) @@ -38,6 +38,15 @@ protected global::System.Web.UI.WebControls.Button ButtonNext; /// <summary> + /// GroupDropDown control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.DropDownList GroupDropDown; + + /// <summary> /// TimeDropDown control. /// </summary> /// <remarks> Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2007-04-16 13:22:05 UTC (rev 42) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2007-04-18 16:38:04 UTC (rev 43) @@ -226,6 +226,13 @@ } input.deleteschedule { - margin-left:10px; - vertical-align:middle; + margin-left: 10px; + vertical-align: middle; } + +td.guidecell +{ + height:20px; + overflow:hidden; + background-color:Lime; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-07-17 17:25:14
|
Revision: 47 http://svn.sourceforge.net/mp-webinterface/?rev=47&view=rev Author: maschine Date: 2007-07-17 10:25:09 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Guide changes. Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/css/mpw_style.css Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-04-25 20:34:27 UTC (rev 46) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-07-17 17:25:09 UTC (rev 47) @@ -14,111 +14,149 @@ public partial class _Default : System.Web.UI.Page { - private DateTime guideStart = DateTime.Now; + private DateTime guideStart; private DateTime guideEnd; protected void Page_Load(object sender, EventArgs e) { - guideEnd = guideStart.AddHours(3); + int mins = DateTime.Now.Minute; + guideStart = DateTime.Now.Subtract(new TimeSpan(0, mins, 0)); + if (mins >= 30) + { + guideStart = guideStart.AddMinutes(30); + } - //Establish the connection to the TV Server and the DB. - MPWUtils.SetupConnection(); + guideEnd = guideStart.AddHours(3); - // Get a list of all tv-channels - IList channels = Channel.ListAll(); + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); - // List all groups - IList groups = ChannelGroup.ListAll(); + // Get a list of all tv-channels + IList channels = Channel.ListAll(); - // Remove non-TV channels - foreach (Channel channel in channels) - { - if (!channel.IsTv) - channels.Remove(channel); - } + // List all groups + IList groups = ChannelGroup.ListAll(); - //The Time - TableRow timerow = new TableRow(); - TableCell spacer = new TableCell(); - timerow.Cells.Add(spacer); + // Remove non-TV channels + foreach (Channel channel in channels) + { + if (!channel.IsTv) + channels.Remove(channel); + } - for (int i = 0; i < 3; i++) - { - TableCell cell = new TableCell(); - cell.Text = "| " + guideStart.AddHours(i).ToShortTimeString(); - cell.Width = 180; - timerow.Cells.Add(cell); - } - Guide.Rows.Add(timerow); + //The Time + TableRow timerow = new TableRow(); + TableCell spacer = new TableCell(); + timerow.Cells.Add(spacer); - //Iterate through all the channels - foreach (Channel channel in channels) - { - TableRow r = new TableRow(); - TableCell cell_channel = new TableCell(); - TableCell cell_program = new TableCell(); - cell_program.ColumnSpan = 3; + for (int i = 0; i < 3; i++) + { + TableCell cell = new TableCell(); + cell.Text = "| " + guideStart.AddHours(i).ToShortTimeString(); + cell.Width = Unit.Percentage(30); + timerow.Cells.Add(cell); + } + Guide.Rows.Add(timerow); - Label lbl_channel = new Label(); - lbl_channel.Text = "<strong>" + channel.Name + "</strong>"; + //Iterate through all the channels + foreach (Channel channel in channels) + { + TableRow r = new TableRow(); + TableCell cell_channel = new TableCell(); + TableCell cell_program = new TableCell(); + cell_program.ColumnSpan = 3; - cell_channel.Controls.Add(lbl_channel); - cell_channel.CssClass = "guideChannel"; + cell_channel.CssClass = "logocell"; - try - { - Program current = channel.GetProgramAt(guideStart); + Image channelLogo = new Image(); + channelLogo.CssClass = "channellogo"; + channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); - Table programsTable = new Table(); - TableRow programsRow = new TableRow(); + if (channelLogo.ImageUrl != "") + { + cell_channel.Controls.Add(channelLogo); + Label br = new Label(); + br.Text = "<br />"; + cell_channel.Controls.Add(br); + } - TableCell firstcell = new TableCell(); - firstcell.CssClass = "guidecell"; + Label lbl_channel = new Label(); + lbl_channel.Text = "<strong>" + channel.Name + "</strong>"; - TimeSpan widthTime = current.EndTime - guideStart; - Unit widthPixel = new Unit(widthTime.Minutes.ToString()); - firstcell.Width = widthPixel; - firstcell.Text = current.Title; - programsRow.Cells.Add(firstcell); + cell_channel.Controls.Add(lbl_channel); + cell_channel.CssClass = "guideChannel"; - bool more = true; - - while (more == true) - { - Program next = channel.GetProgramAt(current.EndTime.AddMinutes(1)); - if (next.EndTime <= guideEnd) + try { - TableCell nextcell = new TableCell(); - nextcell.CssClass = "guidecell"; + Program current = channel.GetProgramAt(guideStart); - widthTime = next.EndTime - next.StartTime; - widthPixel = new Unit(widthTime.Minutes.ToString()); - nextcell.Width = widthPixel; - nextcell.Text = next.Title; - programsRow.Cells.Add(nextcell); - current = next; + Table programsTable = new Table(); + programsTable.CssClass = "guidetable"; + programsTable.Width = Unit.Percentage(100); + TableRow programsRow = new TableRow(); + + TableCell firstcell = new TableCell(); + firstcell.CssClass = "guidecell"; + + TimeSpan widthTime = current.EndTime - guideStart; + int width = Int32.Parse(widthTime.Hours.ToString()) * 60; + width += Int32.Parse(widthTime.Minutes.ToString()); + firstcell.ColumnSpan = width / 2; + firstcell.Text = current.Title + " " + width.ToString(); + programsRow.Cells.Add(firstcell); + + bool more = true; + + while (more == true) + { + Program next = channel.GetProgramAt(current.EndTime.AddMinutes(1)); + if (next.EndTime <= guideEnd) + { + TableCell nextcell = new TableCell(); + nextcell.CssClass = "guidecell"; + + widthTime = next.EndTime - next.StartTime; + width = Int32.Parse(widthTime.Hours.ToString()) * 60; + width += Int32.Parse(widthTime.Minutes.ToString()); + nextcell.ColumnSpan = width / 2; + nextcell.Text = next.Title + " " + width.ToString(); + programsRow.Cells.Add(nextcell); + current = next; + if (next.EndTime == guideEnd) + { + more = false; + } + } + else + { + TableCell nextcell = new TableCell(); + nextcell.CssClass = "guidecell"; + + widthTime = guideEnd - next.StartTime; + width = Int32.Parse(widthTime.Hours.ToString()) * 60; + width += Int32.Parse(widthTime.Minutes.ToString()); + nextcell.ColumnSpan = width / 2; + nextcell.Text = next.Title + " " + width.ToString(); + programsRow.Cells.Add(nextcell); + more = false; + } + } + + programsTable.Rows.Add(programsRow); + cell_program.Controls.Add(programsTable); + } - else + catch { - more = false; + Label noEPG = new Label(); + noEPG.Text = Resources.Resource.NoEPGInfo; + cell_program.Controls.Add(noEPG); } - } - programsTable.Rows.Add(programsRow); - cell_program.Controls.Add(programsTable); + r.Cells.Add(cell_channel); + r.Cells.Add(cell_program); + Guide.Rows.Add(r); } - catch - { - Label noEPG = new Label(); - noEPG.Text = Resources.Resource.NoEPGInfo; - cell_program.Controls.Add(noEPG); - } - - r.Cells.Add(cell_channel); - r.Cells.Add(cell_program); - - Guide.Rows.Add(r); - } } - } +} Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2007-04-25 20:34:27 UTC (rev 46) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2007-07-17 17:25:09 UTC (rev 47) @@ -67,6 +67,7 @@ table.content { + width: 95%; } td.leftcontent @@ -116,6 +117,12 @@ background-repeat: no-repeat; } +table.guidetable +{ + table-layout:fixed; + overflow:hidden +} + td.seperatorcell { height: 35px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-07-24 13:26:55
|
Revision: 48 http://svn.sourceforge.net/mp-webinterface/?rev=48&view=rev Author: maschine Date: 2007-07-24 06:26:50 -0700 (Tue, 24 Jul 2007) Log Message: ----------- Adding ProgramDetail page and improvements to guide and now/next. Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/NowNext.aspx trunk/Version2/Web App/MPW/NowNext.aspx.cs Added Paths: ----------- trunk/Version2/Web App/MPW/ProgramDetail.aspx trunk/Version2/Web App/MPW/ProgramDetail.aspx.cs Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-07-17 17:25:09 UTC (rev 47) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-07-24 13:26:50 UTC (rev 48) @@ -65,6 +65,7 @@ TableCell cell_channel = new TableCell(); TableCell cell_program = new TableCell(); cell_program.ColumnSpan = 3; + cell_program.Height = 80; cell_channel.CssClass = "logocell"; @@ -102,7 +103,7 @@ int width = Int32.Parse(widthTime.Hours.ToString()) * 60; width += Int32.Parse(widthTime.Minutes.ToString()); firstcell.ColumnSpan = width / 2; - firstcell.Text = current.Title + " " + width.ToString(); + firstcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + current.IdProgram + "\">" + current.Title + "</a>"; programsRow.Cells.Add(firstcell); bool more = true; @@ -119,7 +120,7 @@ width = Int32.Parse(widthTime.Hours.ToString()) * 60; width += Int32.Parse(widthTime.Minutes.ToString()); nextcell.ColumnSpan = width / 2; - nextcell.Text = next.Title + " " + width.ToString(); + nextcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + next.IdProgram + "\">" + next.Title + "</a>"; programsRow.Cells.Add(nextcell); current = next; if (next.EndTime == guideEnd) @@ -136,7 +137,7 @@ width = Int32.Parse(widthTime.Hours.ToString()) * 60; width += Int32.Parse(widthTime.Minutes.ToString()); nextcell.ColumnSpan = width / 2; - nextcell.Text = next.Title + " " + width.ToString(); + nextcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + next.IdProgram + "\">" + next.Title + "</a>"; programsRow.Cells.Add(nextcell); more = false; } Modified: trunk/Version2/Web App/MPW/NowNext.aspx =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx 2007-07-17 17:25:09 UTC (rev 47) +++ trunk/Version2/Web App/MPW/NowNext.aspx 2007-07-24 13:26:50 UTC (rev 48) @@ -7,31 +7,6 @@ <asp:Panel ID="NowNextPanel" runat="server"> </asp:Panel> </div> - <asp:Panel ID="DetailsPanel" runat="server" Visible="false" CssClass="detailsPanel"> - <div> - <div style="width: 75px; height: 85px; float: left;"> - <asp:Image ID="detailChannelLogo" runat="server" /> - <br /> - <asp:Label ID="detailChannelName" runat="server" Text="Channel Name"></asp:Label></div> - <div style="float: left;"> - <asp:Label ID="detailShowName" runat="server" Text="Show Name" CssClass="detailShowTitle"></asp:Label> - <br /> - <asp:Label ID="detailShowTime" runat="server" Text="Time"></asp:Label> - </div> - <div style="float:right;width:20px;"> - <asp:ImageButton ID="CloseDetails" runat="server" CausesValidation="False" ImageAlign="Middle" ImageUrl="~/Images/redx.gif" OnClick="closeDetails" PostBackUrl="~/NowNext.aspx" /> - </div> - </div> - <div class="recordingoptions"> - <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Resource, RecordThis %>"></asp:Label> - <asp:DropDownList ID="ScheduleType" runat="server"> - </asp:DropDownList> - <asp:HiddenField ID="HiddenFieldProgramID" runat="server" /> - <asp:Button ID="Button1" runat="server" Text="Button" OnClick="addSchedule" /></div> - <div class="description"> - <asp:Label ID="detailShowDesc" runat="server" Text="Show Description"></asp:Label> - </div> - </asp:Panel> </ContentTemplate> </asp:UpdatePanel> </asp:Content> Modified: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-07-17 17:25:09 UTC (rev 47) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-07-24 13:26:50 UTC (rev 48) @@ -44,65 +44,7 @@ updateContents(); } - /// <summary> - /// Opens the popup with details for a show. - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - protected void openDetails(object sender, CommandEventArgs e) - { - int idProgram = int.Parse(e.CommandArgument.ToString()); - prepareDetails(idProgram); - DetailsPanel.Visible = true; - } - - /// <summary> - /// Adds a new Schedule from the details panel. - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - protected void addSchedule(object sender, EventArgs e) - { - int idProgram = int.Parse(HiddenFieldProgramID.Value); - int recTypeNr = int.Parse(ScheduleType.SelectedValue); - ScheduleRecordingType recType = (ScheduleRecordingType)recTypeNr; - if (MPWUtils.addSchedule(idProgram, recType)) - { - DetailsPanel.Visible = false; - updateContents(); - } - //TODO: Implement error handling - } - - /// <summary> - /// Closes the popup with details for a show. - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - protected void closeDetails(object sender, ImageClickEventArgs e) - { - DetailsPanel.Visible = false; - } - - /// <summary> - /// Prepares the contents of the Details panel - /// </summary> - /// <param name="idProgram">The program ID of the selected show.</param> - protected void prepareDetails(int idProgram) - { - - Program p = Program.Retrieve(idProgram); - Channel c = Channel.Retrieve(p.IdChannel); - detailChannelName.Text = c.Name; - detailChannelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), c.Name); - detailShowName.Text = p.Title; - detailShowTime.Text = "(" + p.StartTime.ToShortTimeString() + " - " + p.EndTime.ToShortTimeString() + ")"; - detailShowDesc.Text = p.Description; - HiddenFieldProgramID.Value = idProgram.ToString(); - MPWUtils.prepareScheduleTypeDropDown(ScheduleType); - } - - /// <summary> + /// <summary> /// Updates the now and next program rows. /// </summary> protected void updateContents() @@ -188,10 +130,8 @@ TableCell cell_program = new TableCell(); cell_program.CssClass = "detailscell"; - Label lbl_program_now_1 = new Label(); - Label lbl_program_now_2 = new Label(); - Label lbl_program_next_1 = new Label(); - Label lbl_program_next_2 = new Label(); + Label lbl_program_now = new Label(); + Label lbl_program_next = new Label(); try { @@ -200,19 +140,12 @@ Program next = channel.GetProgramAt(now.EndTime.AddMinutes(2)); bool[] nextRec = IsRecording(next); - lbl_program_now_1.Text = "<span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; - cell_program.Controls.Add(lbl_program_now_1); + lbl_program_now.Text = "<span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; + lbl_program_now.Text += "<a href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram + "\">" + now.Title + "</a>"; ; + lbl_program_now.Text += " (" + now.StartTime.ToShortTimeString() + " - "; + lbl_program_now.Text += now.EndTime.ToShortTimeString() + ")"; + cell_program.Controls.Add(lbl_program_now); - LinkButton nowLink = new LinkButton(); - nowLink.Text = now.Title; - nowLink.CommandArgument = now.IdProgram.ToString(); - nowLink.Command += new CommandEventHandler(openDetails); - cell_program.Controls.Add(nowLink); - - lbl_program_now_2.Text = " (" + now.StartTime.ToShortTimeString() + " - "; - lbl_program_now_2.Text += now.EndTime.ToShortTimeString() + ")"; - cell_program.Controls.Add(lbl_program_now_2); - if (nowRec[0]) { Image recIcon = new Image(); @@ -224,13 +157,13 @@ cell_program.Controls.Add(recIcon); } - lbl_program_next_1.Text = "<br /> <br />"; + lbl_program_next.Text = "<br /> <br />"; - lbl_program_next_1.Text += "<span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; - lbl_program_next_1.Text += next.Title; - lbl_program_next_1.Text += " (" + next.StartTime.ToShortTimeString() + " - "; - lbl_program_next_1.Text += next.EndTime.ToShortTimeString() + ")"; - cell_program.Controls.Add(lbl_program_next_1); + lbl_program_next.Text += "<span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; + lbl_program_next.Text += next.Title; + lbl_program_next.Text += " (" + next.StartTime.ToShortTimeString() + " - "; + lbl_program_next.Text += next.EndTime.ToShortTimeString() + ")"; + cell_program.Controls.Add(lbl_program_next); if (nextRec[0]) { @@ -246,8 +179,8 @@ } catch { - lbl_program_now_1.Text = Resources.Resource.NoEPGInfo; - cell_program.Controls.Add(lbl_program_now_1); + lbl_program_now.Text = Resources.Resource.NoEPGInfo; + cell_program.Controls.Add(lbl_program_now); } channelRow.Cells.Add(cell_channel); Added: trunk/Version2/Web App/MPW/ProgramDetail.aspx =================================================================== --- trunk/Version2/Web App/MPW/ProgramDetail.aspx (rev 0) +++ trunk/Version2/Web App/MPW/ProgramDetail.aspx 2007-07-24 13:26:50 UTC (rev 48) @@ -0,0 +1,35 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="ProgramDetail.aspx.cs" Inherits="Default2" Title="Untitled Page" %> + +<asp:Content ID="ProgramDetail" ContentPlaceHolderID="MPWContent" runat="Server"> + <asp:UpdatePanel ID="ContentUpdatePanel" runat="server" UpdateMode="Always"> + <ContentTemplate> + <div> + <asp:Panel ID="DetailsPanel" runat="server"> + <div> + <div style="width: 75px; height: 100px; float: left; text-align:center"> + <asp:Image ID="detailChannelLogo" runat="server" /> + <br /> + <asp:Label ID="detailChannelName" runat="server" Text="Channel Name"></asp:Label></div> + <div style="float: left; padding-left:20px"> + <asp:Label ID="detailShowName" runat="server" Text="Show Name" CssClass="detailShowTitle"></asp:Label> + <br /> <br /> + <asp:Label ID="detailShowTime" runat="server" Text="Time"></asp:Label> + </div> + <div style="float:right;width:20px;"> + <asp:Image ID="Dots" runat="server" /> + </div> + </div> + <div class="recordingoptions"> + <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Resource, RecordThis %>"></asp:Label> + <asp:DropDownList ID="ScheduleType" runat="server"> + </asp:DropDownList> + <asp:HiddenField ID="HiddenFieldProgramID" runat="server" /> + <asp:Button ID="Button1" runat="server" Text="Button" OnClick="addSchedule" /></div> + <div class="description"> + <asp:Label ID="detailShowDesc" runat="server" Text="Show Description"></asp:Label> + </div> + </asp:Panel> + </ContentTemplate> + </asp:UpdatePanel> +</asp:Content> + Added: trunk/Version2/Web App/MPW/ProgramDetail.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/ProgramDetail.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/ProgramDetail.aspx.cs 2007-07-24 13:26:50 UTC (rev 48) @@ -0,0 +1,127 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using TvDatabase; +using MPW; +using System.Collections.Generic; + +public partial class Default2 : System.Web.UI.Page +{ + IList _schedules; + int idProgram; + + /// <summary> + /// Checks if a program is scheduled as single / series recording + /// </summary> + /// <param name="program">The program to check</param> + /// <returns>A bool array with meaning [isScheduled, isSeries]</returns> + protected bool[] IsRecording(Program program) + { + bool[] result = { false, false }; + foreach (Schedule schedule in _schedules) + { + if (schedule.IsRecordingProgram(program, true)) + { + result[0] = true; + if (schedule.ScheduleType != 0) + result[1] = true; ; + } + } + return result; + } + + protected void Page_Load(object sender, EventArgs e) + { + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.NowNext; + updateContents(); + } + + + /// <summary> + /// Adds a new Schedule from the details panel. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void addSchedule(object sender, EventArgs e) + { + int idProgram = int.Parse(HiddenFieldProgramID.Value); + int recTypeNr = int.Parse(ScheduleType.SelectedValue); + ScheduleRecordingType recType = (ScheduleRecordingType)recTypeNr; + if (MPWUtils.addSchedule(idProgram, recType)) + { + DetailsPanel.Visible = false; + updateContents(); + } + //TODO: Implement error handling + } + + + /// <summary> + /// Updates the now and next program rows. + /// </summary> + protected void updateContents() + { + + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + + //A new Businesslayer + TvBusinessLayer layer = new TvBusinessLayer(); + + //Get all schedules + _schedules = Schedule.ListAll(); + + //Get the program ID from teh URL + try + { + idProgram = int.Parse(Request.QueryString.Get("idProgram")); + } + catch (Exception) + { + //Ung\xFCltige idProgram + } + + try + { + Program p = Program.Retrieve(idProgram); + Channel c = Channel.Retrieve(p.IdChannel); + detailChannelName.Text = c.Name; + bool[] isRec = IsRecording(p); + + if (isRec[0]) + { + if (isRec[1]) + Dots.ImageUrl = "Images/rec_series.png"; + else + Dots.ImageUrl = "Images/rec_single.png"; + } + else + { + Dots = null; + } + + detailChannelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), c.Name); + detailShowName.Text = p.Title; + detailShowTime.Text = "(" + p.StartTime.ToShortTimeString() + " - " + p.EndTime.ToShortTimeString() + ")"; + detailShowDesc.Text = p.Description; + HiddenFieldProgramID.Value = idProgram.ToString(); + MPWUtils.prepareScheduleTypeDropDown(ScheduleType); + } + catch (Exception) + { + //Fehler beim detailShowDesc holen. + } + + + } +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-09-17 16:30:03
|
Revision: 49 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=49&view=rev Author: maschine Date: 2007-09-17 09:29:53 -0700 (Mon, 17 Sep 2007) Log Message: ----------- Changes by gemx and my improvements to guide channel group chosing. Modified Paths: -------------- trunk/Version2/Web App/MPW/App_Code/Utils.cs trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll trunk/Version2/Web App/MPW/Bin/TVDatabase.dll trunk/Version2/Web App/MPW/Bin/TVLibrary.dll trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll trunk/Version2/Web App/MPW/Bin/TvControl.dll trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/NowNext.aspx trunk/Version2/Web App/MPW/NowNext.aspx.cs trunk/Version2/Web App/MPW/web.config Added Paths: ----------- trunk/Version2/Web App/MPW/Images/osd_play_nofocus.png trunk/Version2/Web App/MPW/Images/play_enabled.png trunk/Version2/Web App/MPW/JS/boxover.js Modified: trunk/Version2/Web App/MPW/App_Code/Utils.cs =================================================================== --- trunk/Version2/Web App/MPW/App_Code/Utils.cs 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/App_Code/Utils.cs 2007-09-17 16:29:53 UTC (rev 49) @@ -138,5 +138,26 @@ ScheduleType.Items.Add(new ListItem(Resources.Resource.WorkingDays, ((int)ScheduleRecordingType.WorkingDays).ToString())); } + public static TvResult StartTimeShift(int idChannel,ref string rtspURL) + { + VirtualCard vcard; + TvResult result; + User me = new User(); + if (RemoteControl.Instance.IsTimeShifting(ref me)) + RemoteControl.Instance.StopTimeShifting(ref me); + try + { + result = RemoteControl.Instance.StartTimeShifting(ref me, idChannel, out vcard); + } + catch (Exception) + { + return TvResult.UnknownError; + } + if (result == TvResult.Succeeded) + { + rtspURL = vcard.RTSPUrl; + } + return result; + } } } \ No newline at end of file Modified: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx 2007-09-17 16:29:53 UTC (rev 49) @@ -117,6 +117,9 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <data name="ChannelGroup" xml:space="preserve"> + <value>Programmgruppe</value> + </data> <data name="Daily" xml:space="preserve"> <value>Täglich</value> <comment>ScheduleType</comment> @@ -175,10 +178,19 @@ <value>Timer</value> <comment>Navigation</comment> </data> + <data name="ScheduleThisProgram" xml:space="preserve"> + <value>Diese Sendung aufzeichnen</value> + </data> <data name="Search" xml:space="preserve"> <value>Suchen</value> <comment>Navigation</comment> </data> + <data name="Update" xml:space="preserve"> + <value>Aktualisieren</value> + </data> + <data name="WatchThisChannel" xml:space="preserve"> + <value>Diesen Kanal anschauen</value> + </data> <data name="Weekends" xml:space="preserve"> <value>Weekends</value> <comment>ScheduleType</comment> Modified: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx 2007-09-17 16:29:53 UTC (rev 49) @@ -117,6 +117,9 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <data name="ChannelGroup" xml:space="preserve"> + <value>Programmgruppe</value> + </data> <data name="Daily" xml:space="preserve"> <value>Daily</value> <comment>ScheduleType</comment> @@ -181,10 +184,19 @@ <value>Schedules</value> <comment>Navigation</comment> </data> + <data name="ScheduleThisProgram" xml:space="preserve"> + <value>ScheduleThisProgram</value> + </data> <data name="Search" xml:space="preserve"> <value>Search</value> <comment>Navigation</comment> </data> + <data name="Update" xml:space="preserve"> + <value>Update</value> + </data> + <data name="WatchThisChannel" xml:space="preserve"> + <value>Watch this channel</value> + </data> <data name="Weekends" xml:space="preserve"> <value>Weekends</value> <comment>ScheduleType</comment> Modified: trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvControl.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-09-17 16:29:53 UTC (rev 49) @@ -1,17 +1,22 @@ -<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %> -<asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" Runat="Server"> - <br /> - <asp:Button ID="ButtonPrev" runat="server" Text="<" /> - <asp:Button ID="ButtonNext" runat="server" Text=">" /> - <asp:DropDownList ID="GroupDropDown" runat="server"> - </asp:DropDownList> - <asp:DropDownList ID="TimeDropDown" runat="server"> - </asp:DropDownList> - <asp:DropDownList ID="DateDropDown" runat="server"> - </asp:DropDownList> - <br /> +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" + Inherits="_Default" Title="Untitled Page" %> + +<asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" runat="Server"> <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> <ContentTemplate> + <br /> + <asp:Label ID="LabelChannelGroup" runat="server" Text="Label"></asp:Label> + <asp:DropDownList ID="DropDownListChannelGroups" runat="server" OnSelectedIndexChanged="groupChosen" AutoPostBack="True"> + </asp:DropDownList> + <asp:Button ID="ButtonPrev" runat="server" Text="<" /> + <asp:Button ID="ButtonNext" runat="server" Text=">" /> + <asp:DropDownList ID="GroupDropDown" runat="server"> + </asp:DropDownList> + <asp:DropDownList ID="TimeDropDown" runat="server"> + </asp:DropDownList> + <asp:DropDownList ID="DateDropDown" runat="server"> + </asp:DropDownList> + <br /> <asp:Table ID="Guide" runat="server" Width="90%"> </asp:Table> </ContentTemplate> @@ -19,4 +24,3 @@ </Triggers> </asp:UpdatePanel> </asp:Content> - Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-09-17 16:29:53 UTC (rev 49) @@ -17,8 +17,45 @@ private DateTime guideStart; private DateTime guideEnd; + private int chosengroup = 0; + + IList groups; + IList channels; + + //A new Businesslayer + TvBusinessLayer layer = new TvBusinessLayer(); + protected void Page_Load(object sender, EventArgs e) { + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + + // Get a list of all tv-channels + if (!IsPostBack) + { + // List all groups + groups = ChannelGroup.ListAll(); + + // Prepare DropDown list for channel groups. + LabelChannelGroup.Text = Resources.Resource.ChannelGroup; + DropDownListChannelGroups.Items.Clear(); + foreach (ChannelGroup group in groups) + DropDownListChannelGroups.Items.Add(new ListItem(group.GroupName, group.IdGroup.ToString())); + DropDownListChannelGroups.SelectedIndex = chosengroup; + } + + updateContents(); + } + + /// <summary> + /// Method to update all visible content. + /// </summary> + protected void updateContents() + { + chosengroup = Int32.Parse(DropDownListChannelGroups.SelectedValue); + ChannelGroup group = ChannelGroup.Retrieve(chosengroup); + channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); + int mins = DateTime.Now.Minute; guideStart = DateTime.Now.Subtract(new TimeSpan(0, mins, 0)); if (mins >= 30) @@ -28,22 +65,6 @@ guideEnd = guideStart.AddHours(3); - //Establish the connection to the TV Server and the DB. - MPWUtils.SetupConnection(); - - // Get a list of all tv-channels - IList channels = Channel.ListAll(); - - // List all groups - IList groups = ChannelGroup.ListAll(); - - // Remove non-TV channels - foreach (Channel channel in channels) - { - if (!channel.IsTv) - channels.Remove(channel); - } - //The Time TableRow timerow = new TableRow(); TableCell spacer = new TableCell(); @@ -61,6 +82,8 @@ //Iterate through all the channels foreach (Channel channel in channels) { + if (!channel.IsTv) + continue; TableRow r = new TableRow(); TableCell cell_channel = new TableCell(); TableCell cell_program = new TableCell(); @@ -160,4 +183,15 @@ Guide.Rows.Add(r); } } + + /// <summary> + /// Is called if another channel group is chosen. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void groupChosen(object sender, EventArgs e) + { + Guide.Controls.Clear(); + updateContents(); + } } Added: trunk/Version2/Web App/MPW/Images/osd_play_nofocus.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/osd_play_nofocus.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/play_enabled.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/play_enabled.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/JS/boxover.js =================================================================== --- trunk/Version2/Web App/MPW/JS/boxover.js (rev 0) +++ trunk/Version2/Web App/MPW/JS/boxover.js 2007-09-17 16:29:53 UTC (rev 49) @@ -0,0 +1,372 @@ +/* --- BoxOver --- +/* --- v 2.1 17th June 2006 +By Oliver Bryant with help of Matthew Tagg +http://boxover.swazz.org */ + +if (typeof document.attachEvent!='undefined') { + window.attachEvent('onload',init); + document.attachEvent('onmousemove',moveMouse); + document.attachEvent('onclick',checkMove); } +else { + window.addEventListener('load',init,false); + document.addEventListener('mousemove',moveMouse,false); + document.addEventListener('click',checkMove,false); +} + +var oDv=document.createElement("div"); +var dvHdr=document.createElement("div"); +var dvBdy=document.createElement("div"); +var windowlock,boxMove,fixposx,fixposy,lockX,lockY,fixx,fixy,ox,oy,boxLeft,boxRight,boxTop,boxBottom,evt,mouseX,mouseY,boxOpen,totalScrollTop,totalScrollLeft; +boxOpen=false; +ox=10; +oy=10; +lockX=0; +lockY=0; + +function init() { + oDv.appendChild(dvHdr); + oDv.appendChild(dvBdy); + oDv.style.position="absolute"; + oDv.style.visibility='hidden'; + document.body.appendChild(oDv); +} + +function defHdrStyle() { + dvHdr.innerHTML='<img style="vertical-align:middle" src="info.gif"> '+dvHdr.innerHTML; + dvHdr.style.fontWeight='bold'; + dvHdr.style.width='200px'; + dvHdr.style.fontFamily='arial'; + dvHdr.style.border='1px solid #A5CFE9'; + dvHdr.style.padding='3'; + dvHdr.style.fontSize='11'; + dvHdr.style.color='#4B7A98'; + dvHdr.style.background='#D5EBF9'; + dvHdr.style.filter='alpha(opacity=90)'; // IE + dvHdr.style.opacity='0.85'; // FF +} + +function defBdyStyle() { + dvBdy.style.borderBottom='1px solid #A5CFE9'; + dvBdy.style.borderLeft='1px solid #A5CFE9'; + dvBdy.style.borderRight='1px solid #A5CFE9'; + dvBdy.style.width='200px'; + dvBdy.style.fontFamily='arial'; + dvBdy.style.fontSize='11'; + dvBdy.style.padding='3'; + dvBdy.style.color='#1B4966'; + dvBdy.style.background='#FFFFFF'; + dvBdy.style.filter='alpha(opacity=90)'; // IE + dvBdy.style.opacity='0.85'; // FF +} + +function checkElemBO(txt) { +if (!txt || typeof(txt) != 'string') return false; +if ((txt.indexOf('header')>-1)&&(txt.indexOf('body')>-1)&&(txt.indexOf('[')>-1)&&(txt.indexOf('[')>-1)) + return true; +else + return false; +} + +function scanBO(curNode) { + if (checkElemBO(curNode.title)) { + curNode.boHDR=getParam('header',curNode.title); + curNode.boBDY=getParam('body',curNode.title); + curNode.boCSSBDY=getParam('cssbody',curNode.title); + curNode.boCSSHDR=getParam('cssheader',curNode.title); + curNode.IEbugfix=(getParam('hideselects',curNode.title)=='on')?true:false; + curNode.fixX=parseInt(getParam('fixedrelx',curNode.title)); + curNode.fixY=parseInt(getParam('fixedrely',curNode.title)); + curNode.absX=parseInt(getParam('fixedabsx',curNode.title)); + curNode.absY=parseInt(getParam('fixedabsy',curNode.title)); + curNode.offY=(getParam('offsety',curNode.title)!='')?parseInt(getParam('offsety',curNode.title)):10; + curNode.offX=(getParam('offsetx',curNode.title)!='')?parseInt(getParam('offsetx',curNode.title)):10; + curNode.fade=(getParam('fade',curNode.title)=='on')?true:false; + curNode.fadespeed=(getParam('fadespeed',curNode.title)!='')?getParam('fadespeed',curNode.title):0.04; + curNode.delay=(getParam('delay',curNode.title)!='')?parseInt(getParam('delay',curNode.title)):0; + if (getParam('requireclick',curNode.title)=='on') { + curNode.requireclick=true; + document.all?curNode.attachEvent('onclick',showHideBox):curNode.addEventListener('click',showHideBox,false); + document.all?curNode.attachEvent('onmouseover',hideBox):curNode.addEventListener('mouseover',hideBox,false); + } + else {// Note : if requireclick is on the stop clicks are ignored + if (getParam('doubleclickstop',curNode.title)!='off') { + document.all?curNode.attachEvent('ondblclick',pauseBox):curNode.addEventListener('dblclick',pauseBox,false); + } + if (getParam('singleclickstop',curNode.title)=='on') { + document.all?curNode.attachEvent('onclick',pauseBox):curNode.addEventListener('click',pauseBox,false); + } + } + curNode.windowLock=getParam('windowlock',curNode.title).toLowerCase()=='off'?false:true; + curNode.title=''; + curNode.hasbox=1; + } + else + curNode.hasbox=2; +} + + +function getParam(param,list) { + var reg = new RegExp('([^a-zA-Z]' + param + '|^' + param + ')\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]'); + var res = reg.exec(list); + var returnvar; + if(res) + return res[2].replace('[[','[').replace(']]',']'); + else + return ''; +} + +function Left(elem){ + var x=0; + if (elem.calcLeft) + return elem.calcLeft; + var oElem=elem; + while(elem){ + if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderLeftWidth)))&&(x!=0)) + x+=parseInt(elem.currentStyle.borderLeftWidth); + x+=elem.offsetLeft; + elem=elem.offsetParent; + } + oElem.calcLeft=x; + return x; + } + +function Top(elem){ + var x=0; + if (elem.calcTop) + return elem.calcTop; + var oElem=elem; + while(elem){ + if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderTopWidth)))&&(x!=0)) + x+=parseInt(elem.currentStyle.borderTopWidth); + x+=elem.offsetTop; + elem=elem.offsetParent; + } + oElem.calcTop=x; + return x; + +} + +var ah,ab; +function applyStyles() { + if(ab) + oDv.removeChild(dvBdy); + if (ah) + oDv.removeChild(dvHdr); + dvHdr=document.createElement("div"); + dvBdy=document.createElement("div"); + CBE.boCSSBDY?dvBdy.className=CBE.boCSSBDY:defBdyStyle(); + CBE.boCSSHDR?dvHdr.className=CBE.boCSSHDR:defHdrStyle(); + dvHdr.innerHTML=CBE.boHDR; + dvBdy.innerHTML=CBE.boBDY; + ah=false; + ab=false; + if (CBE.boHDR!='') { + oDv.appendChild(dvHdr); + ah=true; + } + if (CBE.boBDY!=''){ + oDv.appendChild(dvBdy); + ab=true; + } +} + +var CSE,iterElem,LSE,CBE,LBE, totalScrollLeft, totalScrollTop, width, height ; +var ini=false; + +// Customised function for inner window dimension +function SHW() { + if (document.body && (document.body.clientWidth !=0)) { + width=document.body.clientWidth; + height=document.body.clientHeight; + } + if (document.documentElement && (document.documentElement.clientWidth!=0) && (document.body.clientWidth + 20 >= document.documentElement.clientWidth)) { + width=document.documentElement.clientWidth; + height=document.documentElement.clientHeight; + } + return [width,height]; +} + + +var ID=null; +function moveMouse(e) { + //boxMove=true; + e?evt=e:evt=event; + + CSE=evt.target?evt.target:evt.srcElement; + + if (!CSE.hasbox) { + // Note we need to scan up DOM here, some elements like TR don't get triggered as srcElement + iElem=CSE; + while ((iElem.parentNode) && (!iElem.hasbox)) { + scanBO(iElem); + iElem=iElem.parentNode; + } + } + + if ((CSE!=LSE)&&(!isChild(CSE,dvHdr))&&(!isChild(CSE,dvBdy))){ + if (!CSE.boxItem) { + iterElem=CSE; + while ((iterElem.hasbox==2)&&(iterElem.parentNode)) + iterElem=iterElem.parentNode; + CSE.boxItem=iterElem; + } + iterElem=CSE.boxItem; + if (CSE.boxItem&&(CSE.boxItem.hasbox==1)) { + LBE=CBE; + CBE=iterElem; + if (CBE!=LBE) { + applyStyles(); + if (!CBE.requireclick) + if (CBE.fade) { + if (ID!=null) + clearTimeout(ID); + ID=setTimeout("fadeIn("+CBE.fadespeed+")",CBE.delay); + } + else { + if (ID!=null) + clearTimeout(ID); + COL=1; + ID=setTimeout("oDv.style.visibility='visible';ID=null;",CBE.delay); + } + if (CBE.IEbugfix) {hideSelects();} + fixposx=!isNaN(CBE.fixX)?Left(CBE)+CBE.fixX:CBE.absX; + fixposy=!isNaN(CBE.fixY)?Top(CBE)+CBE.fixY:CBE.absY; + lockX=0; + lockY=0; + boxMove=true; + ox=CBE.offX?CBE.offX:10; + oy=CBE.offY?CBE.offY:10; + } + } + else if (!isChild(CSE,dvHdr) && !isChild(CSE,dvBdy) && (boxMove)) { + // The conditional here fixes flickering between tables cells. + if ((!isChild(CBE,CSE)) || (CSE.tagName!='TABLE')) { + CBE=null; + if (ID!=null) + clearTimeout(ID); + fadeOut(); + showSelects(); + } + } + LSE=CSE; + } + else if (((isChild(CSE,dvHdr) || isChild(CSE,dvBdy))&&(boxMove))) { + totalScrollLeft=0; + totalScrollTop=0; + + iterElem=CSE; + while(iterElem) { + if(!isNaN(parseInt(iterElem.scrollTop))) + totalScrollTop+=parseInt(iterElem.scrollTop); + if(!isNaN(parseInt(iterElem.scrollLeft))) + totalScrollLeft+=parseInt(iterElem.scrollLeft); + iterElem=iterElem.parentNode; + } + if (CBE!=null) { + boxLeft=Left(CBE)-totalScrollLeft; + boxRight=parseInt(Left(CBE)+CBE.offsetWidth)-totalScrollLeft; + boxTop=Top(CBE)-totalScrollTop; + boxBottom=parseInt(Top(CBE)+CBE.offsetHeight)-totalScrollTop; + doCheck(); + } + } + + if (boxMove&&CBE) { + // This added to alleviate bug in IE6 w.r.t DOCTYPE + bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop; + bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft; + mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft; + mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop; + if ((CBE)&&(CBE.windowLock)) { + mouseY < -oy?lockY=-mouseY-oy:lockY=0; + mouseX < -ox?lockX=-mouseX-ox:lockX=0; + mouseY > (SHW()[1]-oDv.offsetHeight-oy)?lockY=-mouseY+SHW()[1]-oDv.offsetHeight-oy:lockY=lockY; + mouseX > (SHW()[0]-dvBdy.offsetWidth-ox)?lockX=-mouseX-ox+SHW()[0]-dvBdy.offsetWidth:lockX=lockX; + } + oDv.style.left=((fixposx)||(fixposx==0))?fixposx:bodyScrollLet+mouseX+ox+lockX+"px"; + oDv.style.top=((fixposy)||(fixposy==0))?fixposy:bodyScrollTop+mouseY+oy+lockY+"px"; + + } +} + +function doCheck() { + if ( (mouseX < boxLeft) || (mouseX >boxRight) || (mouseY < boxTop) || (mouseY > boxBottom)) { + if (!CBE.requireclick) + fadeOut(); + if (CBE.IEbugfix) {showSelects();} + CBE=null; + } +} + +function pauseBox(e) { + e?evt=e:evt=event; + boxMove=false; + evt.cancelBubble=true; +} + +function showHideBox(e) { + oDv.style.visibility=(oDv.style.visibility!='visible')?'visible':'hidden'; +} + +function hideBox(e) { + oDv.style.visibility='hidden'; +} + +var COL=0; +var stopfade=false; +function fadeIn(fs) { + ID=null; + COL=0; + oDv.style.visibility='visible'; + fadeIn2(fs); +} + +function fadeIn2(fs) { + COL=COL+fs; + COL=(COL>1)?1:COL; + oDv.style.filter='alpha(opacity='+parseInt(100*COL)+')'; + oDv.style.opacity=COL; + if (COL<1) + setTimeout("fadeIn2("+fs+")",20); +} + + +function fadeOut() { + oDv.style.visibility='hidden'; + +} + +function isChild(s,d) { + while(s) { + if (s==d) + return true; + s=s.parentNode; + } + return false; +} + +var cSrc; +function checkMove(e) { + e?evt=e:evt=event; + cSrc=evt.target?evt.target:evt.srcElement; + if ((!boxMove)&&(!isChild(cSrc,oDv))) { + fadeOut(); + if (CBE&&CBE.IEbugfix) {showSelects();} + boxMove=true; + CBE=null; + } +} + +function showSelects(){ + var elements = document.getElementsByTagName("select"); + for (i=0;i< elements.length;i++){ + elements[i].style.visibility='visible'; + } +} + +function hideSelects(){ + var elements = document.getElementsByTagName("select"); + for (i=0;i< elements.length;i++){ + elements[i].style.visibility='hidden'; + } +} \ No newline at end of file Modified: trunk/Version2/Web App/MPW/NowNext.aspx =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/NowNext.aspx 2007-09-17 16:29:53 UTC (rev 49) @@ -1,12 +1,21 @@ <%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="NowNext.aspx.cs" Inherits="Default2" Title="Untitled Page" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> + <asp:Content ID="NowNext" ContentPlaceHolderID="MPWContent" runat="Server"> - <asp:UpdatePanel ID="ContentUpdatePanel" runat="server" UpdateMode="Always"> +<script type="text/javascript" src="JS/boxover.js"></script> + <asp:UpdatePanel ID="ContentUpdatePanel" runat="server" UpdateMode="Always" > <ContentTemplate> <div> + <asp:Label ID="LabelChannelGroup" runat="server" Text="Label"></asp:Label> + <asp:DropDownList ID="DropDownListChannelGroups" runat="server"> + </asp:DropDownList> + <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Button" /> <asp:Panel ID="NowNextPanel" runat="server"> </asp:Panel> - </div> + + </div> + </ContentTemplate> </asp:UpdatePanel> </asp:Content> Modified: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-09-17 16:29:53 UTC (rev 49) @@ -8,7 +8,7 @@ using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; - +using TvControl; using TvDatabase; using MPW; using System.Collections.Generic; @@ -39,8 +39,22 @@ protected void Page_Load(object sender, EventArgs e) { - MPWMaster m = (MPWMaster)Page.Master; - m.Sectiontitle = Resources.Resource.NowNext; + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + if (!IsPostBack) + { + MPWMaster m = (MPWMaster)Page.Master; + //Set language resources + m.Sectiontitle = Resources.Resource.NowNext; + LabelChannelGroup.Text = Resources.Resource.ChannelGroup; + btnUpdate.Text = Resources.Resource.Update; + + IList groups = ChannelGroup.ListAll(); + DropDownListChannelGroups.Items.Clear(); + foreach (ChannelGroup group in groups) + DropDownListChannelGroups.Items.Add(new ListItem(group.GroupName,group.IdGroup.ToString())); + DropDownListChannelGroups.SelectedIndex = 0; + } updateContents(); } @@ -52,39 +66,33 @@ //Clear everything NowNextPanel.Controls.Clear(); - //Establish the connection to the TV Server and the DB. - MPWUtils.SetupConnection(); - //A new Businesslayer TvBusinessLayer layer = new TvBusinessLayer(); //Get all schedules _schedules = Schedule.ListAll(); - //Get all groups - IList groups = ChannelGroup.ListAll(); + ChannelGroup group=ChannelGroup.Retrieve(Int32.Parse(DropDownListChannelGroups.SelectedValue)); - foreach (ChannelGroup group in groups) - { - Table groupTable = new Table(); - groupTable.CellPadding = 0; - groupTable.CellSpacing = 0; - groupTable.CssClass = "grouptable"; + Table groupTable = new Table(); + groupTable.CellPadding = 0; + groupTable.CellSpacing = 0; + groupTable.CssClass = "grouptable"; - // Seperator with group name - TableRow groupSeperatorRow = new TableRow(); - TableCell groupSeperatorCell = new TableCell(); - groupSeperatorCell.CssClass = "seperatorcell"; - groupSeperatorCell.ColumnSpan = 3; - Label groupName = new Label(); - groupName.Text = group.GroupName; - groupSeperatorCell.Controls.Add(groupName); - groupSeperatorRow.Cells.Add(groupSeperatorCell); - groupTable.Rows.Add(groupSeperatorRow); + // Seperator with group name + TableRow groupSeperatorRow = new TableRow(); + TableCell groupSeperatorCell = new TableCell(); + groupSeperatorCell.CssClass = "seperatorcell"; + groupSeperatorCell.ColumnSpan = 3; + Label groupName = new Label(); + groupName.Text = group.GroupName; + groupSeperatorCell.Controls.Add(groupName); + groupSeperatorRow.Cells.Add(groupSeperatorCell); + groupTable.Rows.Add(groupSeperatorRow); - // Get a list of all tv-channels - IList channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); - List<Channel> channelstv = new List<Channel>(); + // Get a list of all tv-channels + IList channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); + List<Channel> channelstv = new List<Channel>(); // Remove non TV channels foreach (Channel channel in channels) @@ -105,8 +113,17 @@ TableCell channelNameCell = new TableCell(); channelNameCell.CssClass = "namecell"; channelNameCell.ColumnSpan = 2; + ImageButton btnStartTimeShift = new ImageButton(); + btnStartTimeShift.ImageUrl = "Images/osd_play_nofocus.png"; + btnStartTimeShift.Width = 20; + btnStartTimeShift.Height = 20; + btnStartTimeShift.ToolTip = Resources.Resource.WatchThisChannel; + btnStartTimeShift.CommandName = "StartTimeshifting"; + btnStartTimeShift.CommandArgument = channel.IdChannel.ToString(); + btnStartTimeShift.Command += new CommandEventHandler(btnStartTimeShift_Command); + channelNameCell.Controls.Add(btnStartTimeShift); Label channelName = new Label(); - channelName.Text = channel.Name; + channelName.Text = " "+channel.DisplayName; channelNameCell.Controls.Add(channelName); channelNameRow.Cells.Add(channelNameCell); groupTable.Rows.Add(channelNameRow); @@ -140,10 +157,10 @@ Program next = channel.GetProgramAt(now.EndTime.AddMinutes(2)); bool[] nextRec = IsRecording(next); - lbl_program_now.Text = "<span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; - lbl_program_now.Text += "<a href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram + "\">" + now.Title + "</a>"; ; + lbl_program_now.Text = "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\""+Resources.Resource.ScheduleThisProgram+"\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; + lbl_program_now.Text += "<div style=\"display:inline\" TITLE=\"header=["+now.Title+"] body=["+now.Description+"] fade=[on]\">" + now.Title; lbl_program_now.Text += " (" + now.StartTime.ToShortTimeString() + " - "; - lbl_program_now.Text += now.EndTime.ToShortTimeString() + ")"; + lbl_program_now.Text += now.EndTime.ToShortTimeString() + ")</div>"; cell_program.Controls.Add(lbl_program_now); if (nowRec[0]) @@ -159,10 +176,10 @@ lbl_program_next.Text = "<br /> <br />"; - lbl_program_next.Text += "<span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; - lbl_program_next.Text += next.Title; + lbl_program_next.Text += "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\""+Resources.Resource.ScheduleThisProgram+"\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; + lbl_program_next.Text += "<div style=\"display:inline\" TITLE=\"header=[" + next.Title + "] body=[" + next.Description + "] fade=[on]\">" + next.Title; lbl_program_next.Text += " (" + next.StartTime.ToShortTimeString() + " - "; - lbl_program_next.Text += next.EndTime.ToShortTimeString() + ")"; + lbl_program_next.Text += next.EndTime.ToShortTimeString() + ")</div>"; cell_program.Controls.Add(lbl_program_next); if (nextRec[0]) @@ -189,8 +206,22 @@ groupTable.Rows.Add(channelRow); NowNextPanel.Controls.Add(groupTable); - } + } } + + void btnStartTimeShift_Command(object sender, CommandEventArgs e) + { + string rtspURL = ""; + TvResult result=MPWUtils.StartTimeShift(Int32.Parse((string)e.CommandArgument), ref rtspURL); + if (result==TvResult.Succeeded) + ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "window.open('" + rtspURL + "');",true); + else + ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "alert('Failed to start timeshifting."+Environment.NewLine+"Reason: "+result.ToString()+"');", true); } + protected void btnUpdate_Click(object sender, EventArgs e) + { + updateContents(); + } +} Modified: trunk/Version2/Web App/MPW/web.config =================================================================== --- trunk/Version2/Web App/MPW/web.config 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/web.config 2007-09-17 16:29:53 UTC (rev 49) @@ -27,7 +27,8 @@ <compilation debug="true"> <assemblies> <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> - </assemblies> + <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> + <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies> </compilation> <httpHandlers> <remove verb="*" path="*.asmx"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-09-17 17:58:18
|
Revision: 50 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=50&view=rev Author: maschine Date: 2007-09-17 10:58:15 -0700 (Mon, 17 Sep 2007) Log Message: ----------- Change channel group on index change. Modified Paths: -------------- trunk/Version2/Web App/MPW/NowNext.aspx trunk/Version2/Web App/MPW/NowNext.aspx.cs Modified: trunk/Version2/Web App/MPW/NowNext.aspx =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx 2007-09-17 16:29:53 UTC (rev 49) +++ trunk/Version2/Web App/MPW/NowNext.aspx 2007-09-17 17:58:15 UTC (rev 50) @@ -8,9 +8,8 @@ <ContentTemplate> <div> <asp:Label ID="LabelChannelGroup" runat="server" Text="Label"></asp:Label> - <asp:DropDownList ID="DropDownListChannelGroups" runat="server"> - </asp:DropDownList> - <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Button" /> + <asp:DropDownList ID="DropDownListChannelGroups" runat="server" OnSelectedIndexChanged="groupChosen" AutoPostBack="True"> + </asp:DropDownList> <asp:Panel ID="NowNextPanel" runat="server"> </asp:Panel> Modified: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-09-17 16:29:53 UTC (rev 49) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-09-17 17:58:15 UTC (rev 50) @@ -16,7 +16,11 @@ public partial class Default2 : System.Web.UI.Page { IList _schedules; + IList groups; + IList channels; + private int chosengroup = 0; + /// <summary> /// Checks if a program is scheduled as single / series recording /// </summary> @@ -24,204 +28,210 @@ /// <returns>A bool array with meaning [isScheduled, isSeries]</returns> protected bool[] IsRecording(Program program) { - bool[] result = { false, false }; - foreach (Schedule schedule in _schedules) - { - if (schedule.IsRecordingProgram(program, true)) + bool[] result = { false, false }; + foreach (Schedule schedule in _schedules) { - result[0] = true; - if (schedule.ScheduleType != 0) - result[1] = true; ; + if (schedule.IsRecordingProgram(program, true)) + { + result[0] = true; + if (schedule.ScheduleType != 0) + result[1] = true; ; + } } - } - return result; + return result; } protected void Page_Load(object sender, EventArgs e) { - //Establish the connection to the TV Server and the DB. - MPWUtils.SetupConnection(); - if (!IsPostBack) - { - MPWMaster m = (MPWMaster)Page.Master; - //Set language resources - m.Sectiontitle = Resources.Resource.NowNext; - LabelChannelGroup.Text = Resources.Resource.ChannelGroup; - btnUpdate.Text = Resources.Resource.Update; + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + if (!IsPostBack) + { + MPWMaster m = (MPWMaster)Page.Master; + //Set language resources + m.Sectiontitle = Resources.Resource.NowNext; + LabelChannelGroup.Text = Resources.Resource.ChannelGroup; - IList groups = ChannelGroup.ListAll(); - DropDownListChannelGroups.Items.Clear(); - foreach (ChannelGroup group in groups) - DropDownListChannelGroups.Items.Add(new ListItem(group.GroupName,group.IdGroup.ToString())); - DropDownListChannelGroups.SelectedIndex = 0; - } - updateContents(); + groups = ChannelGroup.ListAll(); + DropDownListChannelGroups.Items.Clear(); + foreach (ChannelGroup group in groups) + DropDownListChannelGroups.Items.Add(new ListItem(group.GroupName, group.IdGroup.ToString())); + DropDownListChannelGroups.SelectedIndex = chosengroup; + } + updateContents(); } - /// <summary> + /// <summary> /// Updates the now and next program rows. /// </summary> protected void updateContents() { - //Clear everything - NowNextPanel.Controls.Clear(); + //Clear everything + NowNextPanel.Controls.Clear(); - //A new Businesslayer - TvBusinessLayer layer = new TvBusinessLayer(); + //A new Businesslayer + TvBusinessLayer layer = new TvBusinessLayer(); - //Get all schedules - _schedules = Schedule.ListAll(); + //Get all schedules + _schedules = Schedule.ListAll(); - ChannelGroup group=ChannelGroup.Retrieve(Int32.Parse(DropDownListChannelGroups.SelectedValue)); + chosengroup = Int32.Parse(DropDownListChannelGroups.SelectedValue); + ChannelGroup group = ChannelGroup.Retrieve(chosengroup); - Table groupTable = new Table(); - groupTable.CellPadding = 0; - groupTable.CellSpacing = 0; - groupTable.CssClass = "grouptable"; + Table groupTable = new Table(); + groupTable.CellPadding = 0; + groupTable.CellSpacing = 0; + groupTable.CssClass = "grouptable"; - // Seperator with group name - TableRow groupSeperatorRow = new TableRow(); - TableCell groupSeperatorCell = new TableCell(); - groupSeperatorCell.CssClass = "seperatorcell"; - groupSeperatorCell.ColumnSpan = 3; - Label groupName = new Label(); - groupName.Text = group.GroupName; - groupSeperatorCell.Controls.Add(groupName); - groupSeperatorRow.Cells.Add(groupSeperatorCell); - groupTable.Rows.Add(groupSeperatorRow); + // Seperator with group name + TableRow groupSeperatorRow = new TableRow(); + TableCell groupSeperatorCell = new TableCell(); + groupSeperatorCell.CssClass = "seperatorcell"; + groupSeperatorCell.ColumnSpan = 3; + Label groupName = new Label(); + groupName.Text = group.GroupName; + groupSeperatorCell.Controls.Add(groupName); + groupSeperatorRow.Cells.Add(groupSeperatorCell); + groupTable.Rows.Add(groupSeperatorRow); - // Get a list of all tv-channels - IList channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); - List<Channel> channelstv = new List<Channel>(); + // Get a list of all tv-channels + IList channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); + List<Channel> channelstv = new List<Channel>(); // Remove non TV channels foreach (Channel channel in channels) { - if (channel.IsTv) - channelstv.Add(channel); + if (channel.IsTv) + channelstv.Add(channel); } //Iterate through all the channels foreach (Channel channel in channelstv) { - TableRow channelNameRow = new TableRow(); + TableRow channelNameRow = new TableRow(); - TableCell spacer = new TableCell(); - spacer.CssClass = "spacer"; - channelNameRow.Controls.Add(spacer); + TableCell spacer = new TableCell(); + spacer.CssClass = "spacer"; + channelNameRow.Controls.Add(spacer); - TableCell channelNameCell = new TableCell(); - channelNameCell.CssClass = "namecell"; - channelNameCell.ColumnSpan = 2; - ImageButton btnStartTimeShift = new ImageButton(); - btnStartTimeShift.ImageUrl = "Images/osd_play_nofocus.png"; - btnStartTimeShift.Width = 20; - btnStartTimeShift.Height = 20; - btnStartTimeShift.ToolTip = Resources.Resource.WatchThisChannel; - btnStartTimeShift.CommandName = "StartTimeshifting"; - btnStartTimeShift.CommandArgument = channel.IdChannel.ToString(); - btnStartTimeShift.Command += new CommandEventHandler(btnStartTimeShift_Command); - channelNameCell.Controls.Add(btnStartTimeShift); - Label channelName = new Label(); - channelName.Text = " "+channel.DisplayName; - channelNameCell.Controls.Add(channelName); - channelNameRow.Cells.Add(channelNameCell); - groupTable.Rows.Add(channelNameRow); + TableCell channelNameCell = new TableCell(); + channelNameCell.CssClass = "namecell"; + channelNameCell.ColumnSpan = 2; + ImageButton btnStartTimeShift = new ImageButton(); + btnStartTimeShift.ImageUrl = "Images/osd_play_nofocus.png"; + btnStartTimeShift.Width = 20; + btnStartTimeShift.Height = 20; + btnStartTimeShift.ToolTip = Resources.Resource.WatchThisChannel; + btnStartTimeShift.CommandName = "StartTimeshifting"; + btnStartTimeShift.CommandArgument = channel.IdChannel.ToString(); + btnStartTimeShift.Command += new CommandEventHandler(btnStartTimeShift_Command); + channelNameCell.Controls.Add(btnStartTimeShift); + Label channelName = new Label(); + channelName.Text = " " + channel.DisplayName; + channelNameCell.Controls.Add(channelName); + channelNameRow.Cells.Add(channelNameCell); + groupTable.Rows.Add(channelNameRow); - TableRow channelRow = new TableRow(); + TableRow channelRow = new TableRow(); - TableCell spacer2 = new TableCell(); - spacer2.CssClass = "spacer2"; - channelRow.Controls.Add(spacer2); + TableCell spacer2 = new TableCell(); + spacer2.CssClass = "spacer2"; + channelRow.Controls.Add(spacer2); - TableCell cell_channel = new TableCell(); - cell_channel.CssClass = "logocell"; + TableCell cell_channel = new TableCell(); + cell_channel.CssClass = "logocell"; - Image channelLogo = new Image(); - channelLogo.CssClass = "channellogo"; - channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); + Image channelLogo = new Image(); + channelLogo.CssClass = "channellogo"; + channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); - if (channelLogo.ImageUrl != "") - cell_channel.Controls.Add(channelLogo); + if (channelLogo.ImageUrl != "") + cell_channel.Controls.Add(channelLogo); - TableCell cell_program = new TableCell(); - cell_program.CssClass = "detailscell"; + TableCell cell_program = new TableCell(); + cell_program.CssClass = "detailscell"; - Label lbl_program_now = new Label(); - Label lbl_program_next = new Label(); + Label lbl_program_now = new Label(); + Label lbl_program_next = new Label(); - try - { - Program now = channel.GetProgramAt(DateTime.Now); - bool[] nowRec = IsRecording(now); - Program next = channel.GetProgramAt(now.EndTime.AddMinutes(2)); - bool[] nextRec = IsRecording(next); + try + { + Program now = channel.GetProgramAt(DateTime.Now); + bool[] nowRec = IsRecording(now); + Program next = channel.GetProgramAt(now.EndTime.AddMinutes(2)); + bool[] nextRec = IsRecording(next); - lbl_program_now.Text = "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\""+Resources.Resource.ScheduleThisProgram+"\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; - lbl_program_now.Text += "<div style=\"display:inline\" TITLE=\"header=["+now.Title+"] body=["+now.Description+"] fade=[on]\">" + now.Title; - lbl_program_now.Text += " (" + now.StartTime.ToShortTimeString() + " - "; - lbl_program_now.Text += now.EndTime.ToShortTimeString() + ")</div>"; - cell_program.Controls.Add(lbl_program_now); + lbl_program_now.Text = "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\"" + Resources.Resource.ScheduleThisProgram + "\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; + lbl_program_now.Text += "<div style=\"display:inline\" TITLE=\"header=[" + now.Title + "] body=[" + now.Description + "] fade=[on]\">" + now.Title; + lbl_program_now.Text += " (" + now.StartTime.ToShortTimeString() + " - "; + lbl_program_now.Text += now.EndTime.ToShortTimeString() + ")</div>"; + cell_program.Controls.Add(lbl_program_now); - if (nowRec[0]) - { - Image recIcon = new Image(); - if (nowRec[1]) - recIcon.ImageUrl = "Images/rec_series.png"; - else - recIcon.ImageUrl = "Images/rec_single.png"; - recIcon.ImageAlign = ImageAlign.Middle; - cell_program.Controls.Add(recIcon); - } + if (nowRec[0]) + { + Image recIcon = new Image(); + if (nowRec[1]) + recIcon.ImageUrl = "Images/rec_series.png"; + else + recIcon.ImageUrl = "Images/rec_single.png"; + recIcon.ImageAlign = ImageAlign.Middle; + cell_program.Controls.Add(recIcon); + } - lbl_program_next.Text = "<br /> <br />"; + lbl_program_next.Text = "<br /> <br />"; - lbl_program_next.Text += "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\""+Resources.Resource.ScheduleThisProgram+"\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; - lbl_program_next.Text += "<div style=\"display:inline\" TITLE=\"header=[" + next.Title + "] body=[" + next.Description + "] fade=[on]\">" + next.Title; - lbl_program_next.Text += " (" + next.StartTime.ToShortTimeString() + " - "; - lbl_program_next.Text += next.EndTime.ToShortTimeString() + ")</div>"; - cell_program.Controls.Add(lbl_program_next); + lbl_program_next.Text += "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\"" + Resources.Resource.ScheduleThisProgram + "\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; + lbl_program_next.Text += "<div style=\"display:inline\" TITLE=\"header=[" + next.Title + "] body=[" + next.Description + "] fade=[on]\">" + next.Title; + lbl_program_next.Text += " (" + next.StartTime.ToShortTimeString() + " - "; + lbl_program_next.Text += next.EndTime.ToShortTimeString() + ")</div>"; + cell_program.Controls.Add(lbl_program_next); - if (nextRec[0]) + if (nextRec[0]) + { + Image recIcon = new Image(); + if (nextRec[1]) + recIcon.ImageUrl = "Images/rec_series.png"; + else + recIcon.ImageUrl = "Images/rec_single.png"; + recIcon.ImageAlign = ImageAlign.Middle; + cell_program.Controls.Add(recIcon); + } + + } + catch { - Image recIcon = new Image(); - if (nextRec[1]) - recIcon.ImageUrl = "Images/rec_series.png"; - else - recIcon.ImageUrl = "Images/rec_single.png"; - recIcon.ImageAlign = ImageAlign.Middle; - cell_program.Controls.Add(recIcon); + lbl_program_now.Text = Resources.Resource.NoEPGInfo; + cell_program.Controls.Add(lbl_program_now); } - } - catch - { - lbl_program_now.Text = Resources.Resource.NoEPGInfo; - cell_program.Controls.Add(lbl_program_now); - } + channelRow.Cells.Add(cell_channel); + channelRow.Cells.Add(cell_program); - channelRow.Cells.Add(cell_channel); - channelRow.Cells.Add(cell_program); + groupTable.Rows.Add(channelRow); - groupTable.Rows.Add(channelRow); + NowNextPanel.Controls.Add(groupTable); - NowNextPanel.Controls.Add(groupTable); + } + } - } + void btnStartTimeShift_Command(object sender, CommandEventArgs e) + { + string rtspURL = ""; + TvResult result = MPWUtils.StartTimeShift(Int32.Parse((string)e.CommandArgument), ref rtspURL); + if (result == TvResult.Succeeded) + ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "window.open('" + rtspURL + "');", true); + else + ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "alert('Failed to start timeshifting." + Environment.NewLine + "Reason: " + result.ToString() + "');", true); } - void btnStartTimeShift_Command(object sender, CommandEventArgs e) - { - string rtspURL = ""; - TvResult result=MPWUtils.StartTimeShift(Int32.Parse((string)e.CommandArgument), ref rtspURL); - if (result==TvResult.Succeeded) - ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "window.open('" + rtspURL + "');",true); - else - ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "alert('Failed to start timeshifting."+Environment.NewLine+"Reason: "+result.ToString()+"');", true); - } - protected void btnUpdate_Click(object sender, EventArgs e) - { - updateContents(); - } + /// <summary> + /// Is called if another channel group is chosen. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void groupChosen(object sender, EventArgs e) + { + updateContents(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-09-17 20:36:45
|
Revision: 51 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=51&view=rev Author: maschine Date: 2007-09-17 13:36:37 -0700 (Mon, 17 Sep 2007) Log Message: ----------- New graphics - thanks mofux :-) Design improvements Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/Images/loading.gif trunk/Version2/Web App/MPW/Images/osd_play_nofocus.png trunk/Version2/Web App/MPW/Images/play_enabled.png trunk/Version2/Web App/MPW/Images/rec_series.png trunk/Version2/Web App/MPW/Images/rec_single.png trunk/Version2/Web App/MPW/MPW.master trunk/Version2/Web App/MPW/css/mpw_style.css Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-09-17 17:58:15 UTC (rev 50) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-09-17 20:36:37 UTC (rev 51) @@ -143,6 +143,7 @@ width = Int32.Parse(widthTime.Hours.ToString()) * 60; width += Int32.Parse(widthTime.Minutes.ToString()); nextcell.ColumnSpan = width / 2; + nextcell.Height = 64; nextcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + next.IdProgram + "\">" + next.Title + "</a>"; programsRow.Cells.Add(nextcell); current = next; Modified: trunk/Version2/Web App/MPW/Images/loading.gif =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Images/osd_play_nofocus.png =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Images/play_enabled.png =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Images/rec_series.png =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Images/rec_single.png =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/MPW.master =================================================================== --- trunk/Version2/Web App/MPW/MPW.master 2007-09-17 17:58:15 UTC (rev 50) +++ trunk/Version2/Web App/MPW/MPW.master 2007-09-17 20:36:37 UTC (rev 51) @@ -15,17 +15,18 @@ <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div class="logodiv"> - <div style="width: 700px; float: left;"> - <!-- <img src="../Images/mp_logo_header.png" alt="MP logo" /> --> + <div style="width: 266px; float: left;"> + <img src="Images/banner-left.png" alt="MP logo" /> </div> - <div style="width: 200px; float: right;"> + <div style="width: 50px; float: right; padding-top: 10px; background-image: url(Images/banner-right.png)"> <asp:UpdateProgress ID="GlobalUpdateProgress" runat="server" DisplayAfter="10"> <ProgressTemplate> - <img src="../Images/loading.gif" alt="Loading..." /> <br /> - <!-- Getting data... Please wait! --> + <img src="Images/loading.gif" alt="Loading..." /> + <br /> </ProgressTemplate> </asp:UpdateProgress> + </div> </div> <div class="navidiv"> @@ -41,7 +42,7 @@ </td> <td id="nav_search" class="navcell"> <asp:HyperLink ID="LinkSearch" runat="server" Text="<%$ Resources:Resource, Search %>" - NavigateUrl="~/Search.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> </td> <td id="nav_sched" class="navcell"> <asp:HyperLink ID="LinkSchedules" runat="server" Text="<%$ Resources:Resource, Schedules %>" @@ -49,11 +50,11 @@ </td> <td id="nav_rec" class="navcell"> <asp:HyperLink ID="LinkRecordings" runat="server" Text="<%$ Resources:Resource, Recordings %>" - NavigateUrl="~/Recordings.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> </td> <td id="nav_live" class="navcell"> <asp:HyperLink ID="LinkLiveTV" runat="server" Text="<%$ Resources:Resource, LiveTV %>" - NavigateUrl="~/LiveTV.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> </td> </tr> </table> Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2007-09-17 17:58:15 UTC (rev 50) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2007-09-17 20:36:37 UTC (rev 51) @@ -30,9 +30,11 @@ div.logodiv { width: 100%; - height: 79px; - background-image: url(../Images/bg_logo.jpg); - background-repeat: no-repeat; + height: 81px; + background-image: url(../Images/banner-mid.png); + border-width: 1px; + border-style: solid; + border-color: #6491A8; } div.navidiv @@ -158,9 +160,10 @@ { height: 85px; width: 86px; - padding: 0px 0px 0px 22px; + padding: 10px 0px 0px 22px; background-image: url(../Images/bg_channel_logo.png); background-repeat: no-repeat; + vertical-align: top; } td.detailscell @@ -239,7 +242,7 @@ td.guidecell { - height:20px; + height:64px; overflow:hidden; background-color:Lime; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-10-04 16:07:15
|
Revision: 52 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=52&view=rev Author: maschine Date: 2007-10-04 09:07:13 -0700 (Thu, 04 Oct 2007) Log Message: ----------- Navigation through the guide is now possible +3h -3h. Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/css/mpw_style.css trunk/Version2/Web App/MPW/web.config Modified: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx 2007-09-17 20:36:37 UTC (rev 51) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-10-04 16:07:13 UTC (rev 52) @@ -8,16 +8,14 @@ <asp:Label ID="LabelChannelGroup" runat="server" Text="Label"></asp:Label> <asp:DropDownList ID="DropDownListChannelGroups" runat="server" OnSelectedIndexChanged="groupChosen" AutoPostBack="True"> </asp:DropDownList> - <asp:Button ID="ButtonPrev" runat="server" Text="<" /> - <asp:Button ID="ButtonNext" runat="server" Text=">" /> - <asp:DropDownList ID="GroupDropDown" runat="server"> + <asp:Button ID="ButtonPrev" runat="server" Text="<" OnClick="buttonminusclick" /> + <asp:Button ID="ButtonNext" runat="server" Text=">" OnClick="buttonplusclick" /> + <asp:DropDownList ID="DateDropDown" runat="server"> </asp:DropDownList> <asp:DropDownList ID="TimeDropDown" runat="server"> </asp:DropDownList> - <asp:DropDownList ID="DateDropDown" runat="server"> - </asp:DropDownList> <br /> - <asp:Table ID="Guide" runat="server" Width="90%"> + <asp:Table ID="Guide" runat="server" CssClass="guidetable"> </asp:Table> </ContentTemplate> <Triggers> Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-09-17 20:36:37 UTC (rev 51) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-10-04 16:07:13 UTC (rev 52) @@ -14,10 +14,10 @@ public partial class _Default : System.Web.UI.Page { - private DateTime guideStart; - private DateTime guideEnd; + DateTime guideStart; + DateTime guideEnd; - private int chosengroup = 0; + int chosengroup = 0; IList groups; IList channels; @@ -44,6 +44,7 @@ DropDownListChannelGroups.SelectedIndex = chosengroup; } + Guide.Controls.Clear(); updateContents(); } @@ -52,19 +53,27 @@ /// </summary> protected void updateContents() { + if (Session["guideStart"] == null) + { + int mins = DateTime.Now.Minute; + guideStart = DateTime.Now.Subtract(new TimeSpan(0, mins, 0)); + if (mins >= 30) + { + guideStart = guideStart.AddMinutes(30); + } + guideEnd = guideStart.AddHours(3); + Session["guideStart"] = guideStart; + } + else + { + guideStart = (DateTime)Session["guideStart"]; + guideEnd = guideStart.AddHours(3); + } + chosengroup = Int32.Parse(DropDownListChannelGroups.SelectedValue); ChannelGroup group = ChannelGroup.Retrieve(chosengroup); channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); - int mins = DateTime.Now.Minute; - guideStart = DateTime.Now.Subtract(new TimeSpan(0, mins, 0)); - if (mins >= 30) - { - guideStart = guideStart.AddMinutes(30); - } - - guideEnd = guideStart.AddHours(3); - //The Time TableRow timerow = new TableRow(); TableCell spacer = new TableCell(); @@ -126,7 +135,12 @@ int width = Int32.Parse(widthTime.Hours.ToString()) * 60; width += Int32.Parse(widthTime.Minutes.ToString()); firstcell.ColumnSpan = width / 2; - firstcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + current.IdProgram + "\">" + current.Title + "</a>"; + String cuttitle; + if (current.Title.Length > width) + cuttitle = current.Title.Substring(0, width); + else + cuttitle = current.Title; + firstcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + current.IdProgram + "\">" + cuttitle + "</a>"; programsRow.Cells.Add(firstcell); bool more = true; @@ -195,4 +209,28 @@ Guide.Controls.Clear(); updateContents(); } + + /// <summary> + /// User pressed the time plus button + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void buttonplusclick(object sender, EventArgs e) + { + Session["guideStart"] = guideStart.AddHours(3); + Guide.Controls.Clear(); + updateContents(); + } + + /// <summary> + /// User pressed the time minus button + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void buttonminusclick(object sender, EventArgs e) + { + Session["guideStart"] = guideStart.AddHours(-3); + Guide.Controls.Clear(); + updateContents(); + } } Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2007-09-17 20:36:37 UTC (rev 51) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2007-10-04 16:07:13 UTC (rev 52) @@ -240,9 +240,17 @@ vertical-align: middle; } +table.guidetable +{ + overflow:hidden; + width:90%; +} + + td.guidecell { - height:64px; overflow:hidden; - background-color:Lime; + height:50px; + background-color:#D4D3D3; + border: 1px solid #000000; } Modified: trunk/Version2/Web App/MPW/web.config =================================================================== --- trunk/Version2/Web App/MPW/web.config 2007-09-17 20:36:37 UTC (rev 51) +++ trunk/Version2/Web App/MPW/web.config 2007-10-04 16:07:13 UTC (rev 52) @@ -13,12 +13,12 @@ </sectionGroup> </configSections> <system.web> - <pages> - <controls> - <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> - </controls> - </pages> - <!-- + <pages enableSessionState="true"> + <controls> + <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> + </controls> + </pages> + <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-11-20 21:45:42
|
Revision: 53 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=53&view=rev Author: maschine Date: 2007-11-20 13:45:20 -0800 (Tue, 20 Nov 2007) Log Message: ----------- First version of browsing the guide by selecting time and date. Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs Modified: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx 2007-10-04 16:07:13 UTC (rev 52) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-11-20 21:45:20 UTC (rev 53) @@ -10,9 +10,9 @@ </asp:DropDownList> <asp:Button ID="ButtonPrev" runat="server" Text="<" OnClick="buttonminusclick" /> <asp:Button ID="ButtonNext" runat="server" Text=">" OnClick="buttonplusclick" /> - <asp:DropDownList ID="DateDropDown" runat="server"> + <asp:DropDownList ID="DateDropDown" runat="server" OnSelectedIndexChanged="dateDropDownChanged" AutoPostBack="True"> </asp:DropDownList> - <asp:DropDownList ID="TimeDropDown" runat="server"> + <asp:DropDownList ID="TimeDropDown" runat="server" OnSelectedIndexChanged="timeDropDownChanged" AutoPostBack="True"> </asp:DropDownList> <br /> <asp:Table ID="Guide" runat="server" CssClass="guidetable"> Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-10-04 16:07:13 UTC (rev 52) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-11-20 21:45:20 UTC (rev 53) @@ -36,6 +36,24 @@ // List all groups groups = ChannelGroup.ListAll(); + //Prepare DropDown for Days + DateTime day = DateTime.Today; + day = day.AddDays(-1); + for (int i = 0; i < 14; i++) + { + day = day.AddDays(1); + DateDropDown.Items.Add(new ListItem(day.ToLongDateString(), day.Ticks.ToString())); + } + + //Prepare DropDown for times + DateTime time = DateTime.Today; + time = time.AddHours(-1); + for (int i = 0; i < 24; i++) + { + time = time.AddHours(1); + TimeDropDown.Items.Add(new ListItem(time.ToShortTimeString(), time.Ticks.ToString())); + } + // Prepare DropDown list for channel groups. LabelChannelGroup.Text = Resources.Resource.ChannelGroup; DropDownListChannelGroups.Items.Clear(); @@ -233,4 +251,38 @@ Guide.Controls.Clear(); updateContents(); } + + /// <summary> + /// User changed the value of the Date DropDown + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void dateDropDownChanged(object sender, EventArgs e) + { + DateTime guidestart = (DateTime)Session["guideStart"]; + long oldticks; + long.TryParse(DateDropDown.SelectedItem.Value, out oldticks); + DateTime selected = new DateTime(oldticks); + TimeSpan datespan = selected - guideStart; + Session["guideStart"] = guideStart.AddDays(datespan.Days); + Guide.Controls.Clear(); + updateContents(); + } + + /// <summary> + /// User changed the value of the Time DropDown + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void timeDropDownChanged(object sender, EventArgs e) + { + DateTime guidestart = (DateTime)Session["guideStart"]; + long oldticks; + long.TryParse(TimeDropDown.SelectedItem.Value, out oldticks); + DateTime selected = new DateTime(oldticks); + int timespan = selected.Hour - guideStart.Hour; + Session["guideStart"] = guideStart.AddHours(timespan); + Guide.Controls.Clear(); + updateContents(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2008-01-07 09:18:25
|
Revision: 55 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=55&view=rev Author: maschine Date: 2008-01-07 01:18:23 -0800 (Mon, 07 Jan 2008) Log Message: ----------- Fixed page titles; templates for new pages; search works (basic) for date searches; updated dlls. Modified Paths: -------------- trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll trunk/Version2/Web App/MPW/Bin/TVDatabase.dll trunk/Version2/Web App/MPW/Bin/TVLibrary.dll trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll trunk/Version2/Web App/MPW/Bin/TvControl.dll trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/MPW.master trunk/Version2/Web App/MPW/NowNext.aspx trunk/Version2/Web App/MPW/NowNext.aspx.cs trunk/Version2/Web App/MPW/Schedules.aspx trunk/Version2/Web App/MPW/Schedules.aspx.cs trunk/Version2/Web App/MPW/Search.aspx trunk/Version2/Web App/MPW/Search.aspx.cs trunk/Version2/Web App/MPW/css/mpw_style.css Added Paths: ----------- trunk/Version2/Web App/MPW/LiveTV.aspx trunk/Version2/Web App/MPW/LiveTV.aspx.cs trunk/Version2/Web App/MPW/Recordings.aspx trunk/Version2/Web App/MPW/Recordings.aspx.cs Modified: trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvControl.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Default.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -1,5 +1,5 @@ <%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" - Inherits="_Default" Title="Untitled Page" %> + Inherits="Default" Title="Guide" %> <asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" runat="Server"> <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -12,7 +12,7 @@ using MPW; using TvDatabase; -public partial class _Default : System.Web.UI.Page +public partial class Default : System.Web.UI.Page { DateTime guideStart; DateTime guideEnd; @@ -27,6 +27,10 @@ protected void Page_Load(object sender, EventArgs e) { + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.Guide; + //Establish the connection to the TV Server and the DB. MPWUtils.SetupConnection(); Added: trunk/Version2/Web App/MPW/LiveTV.aspx =================================================================== --- trunk/Version2/Web App/MPW/LiveTV.aspx (rev 0) +++ trunk/Version2/Web App/MPW/LiveTV.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -0,0 +1,15 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="LiveTV.aspx.cs" + Inherits="LiveTV" Title="Live TV" %> + +<asp:Content ID="Content_search" ContentPlaceHolderID="MPWContent" runat="Server"> + <h1> + <asp:Label ID="label_searchresults" runat="server" Text="<%$ Resources:Resource, LiveTV %>"></asp:Label></h1> + <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> + <contenttemplate> + <asp:Table ID="Guide" runat="server" CssClass="guidetable"> + </asp:Table> + </contenttemplate> + <triggers> + </triggers> + </asp:UpdatePanel> +</asp:Content> Added: trunk/Version2/Web App/MPW/LiveTV.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/LiveTV.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/LiveTV.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -0,0 +1,25 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using MPW; +using TvDatabase; + +public partial class LiveTV : System.Web.UI.Page +{ + + protected void Page_Load(object sender, EventArgs e) + { + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.LiveTV; + } + +} Modified: trunk/Version2/Web App/MPW/MPW.master =================================================================== --- trunk/Version2/Web App/MPW/MPW.master 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/MPW.master 2008-01-07 09:18:23 UTC (rev 55) @@ -62,14 +62,14 @@ </td> <td id="nav_rec" class="navcell"> <asp:HyperLink ID="LinkRecordings" runat="server" Text="<%$ Resources:Resource, Recordings %>" - NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/Recordings.aspx" CssClass="navilink"></asp:HyperLink> </td> <td id="bar5"> | </td> <td id="nav_live" class="navcell"> <asp:HyperLink ID="LinkLiveTV" runat="server" Text="<%$ Resources:Resource, LiveTV %>" - NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/LiveTV.aspx" CssClass="navilink"></asp:HyperLink> </td> </tr> </table> Modified: trunk/Version2/Web App/MPW/NowNext.aspx =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/NowNext.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -1,4 +1,4 @@ -<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="NowNext.aspx.cs" Inherits="Default2" Title="Untitled Page" %> +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="NowNext.aspx.cs" Inherits="NowNext" Title="Untitled Page" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> Modified: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -13,11 +13,10 @@ using MPW; using System.Collections.Generic; -public partial class Default2 : System.Web.UI.Page +public partial class NowNext : System.Web.UI.Page { IList _schedules; IList groups; - IList channels; private int chosengroup = 0; @@ -43,13 +42,14 @@ protected void Page_Load(object sender, EventArgs e) { + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.NowNext; + //Establish the connection to the TV Server and the DB. MPWUtils.SetupConnection(); if (!IsPostBack) { - MPWMaster m = (MPWMaster)Page.Master; - //Set language resources - m.Sectiontitle = Resources.Resource.NowNext; LabelChannelGroup.Text = Resources.Resource.ChannelGroup; groups = ChannelGroup.ListAll(); Added: trunk/Version2/Web App/MPW/Recordings.aspx =================================================================== --- trunk/Version2/Web App/MPW/Recordings.aspx (rev 0) +++ trunk/Version2/Web App/MPW/Recordings.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -0,0 +1,13 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Recordings.aspx.cs" + Inherits="Recordings" Title="Recordings" %> + +<asp:Content ID="Content_recordings" ContentPlaceHolderID="MPWContent" runat="Server"> + <h1> + <asp:Label ID="label_recordings" runat="server" Text="<%$ Resources:Resource, Recordings %>"></asp:Label></h1> + <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> + <ContentTemplate> + </ContentTemplate> + <Triggers> + </Triggers> + </asp:UpdatePanel> +</asp:Content> Added: trunk/Version2/Web App/MPW/Recordings.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Recordings.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/Recordings.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -0,0 +1,24 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using MPW; +using TvDatabase; + +public partial class Recordings : System.Web.UI.Page +{ + + protected void Page_Load(object sender, EventArgs e) + { + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.Recordings; + } +} Modified: trunk/Version2/Web App/MPW/Schedules.aspx =================================================================== --- trunk/Version2/Web App/MPW/Schedules.aspx 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Schedules.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -1,5 +1,7 @@ -<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Schedules.aspx.cs" Inherits="Default2" Title="Untitled Page" %> -<asp:Content ID="Schedules" ContentPlaceHolderID="MPWContent" Runat="Server"> +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Schedules.aspx.cs" + Inherits="Schedules" Title="Schedules" %> + +<asp:Content ID="Schedules" ContentPlaceHolderID="MPWContent" runat="Server"> <asp:UpdatePanel ID="ContentUpdatePanel" runat="server" UpdateMode="Always"> <ContentTemplate> <asp:Panel ID="SchedulesPanel" runat="server"> @@ -7,4 +9,3 @@ </ContentTemplate> </asp:UpdatePanel> </asp:Content> - Modified: trunk/Version2/Web App/MPW/Schedules.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Schedules.aspx.cs 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Schedules.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -12,13 +12,15 @@ using TvDatabase; using MPW; -public partial class Default2 : System.Web.UI.Page +public partial class Schedules : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { - MPWMaster m = (MPWMaster)Page.Master; - m.Sectiontitle = Resources.Resource.Schedules; - updateContents(); + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.Schedules; + + updateContents(); } /// <summary> @@ -29,10 +31,10 @@ /// <param name="e"></param> protected void deleteSchedule(object sender, ImageClickEventArgs e) { - ImageButton b = (ImageButton)sender; - int idSchedule = int.Parse(b.CommandArgument); - MPWUtils.deleteSchedule(idSchedule); - updateContents(); + ImageButton b = (ImageButton)sender; + int idSchedule = int.Parse(b.CommandArgument); + MPWUtils.deleteSchedule(idSchedule); + updateContents(); } /// <summary> @@ -40,129 +42,129 @@ /// </summary> protected void updateContents() { - //Clear everything - SchedulesPanel.Controls.Clear(); + //Clear everything + SchedulesPanel.Controls.Clear(); - //Establish the connection to the TV Server and the DB. - MPWUtils.SetupConnection(); + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); - //A new Businesslayer - TvBusinessLayer layer = new TvBusinessLayer(); + //A new Businesslayer + TvBusinessLayer layer = new TvBusinessLayer(); - //Get all schedules - IList schedules = Schedule.ListAll(); - IList single = Schedule.ListAll(); - IList series = Schedule.ListAll(); + //Get all schedules + IList schedules = Schedule.ListAll(); + IList single = Schedule.ListAll(); + IList series = Schedule.ListAll(); - single.Clear(); - series.Clear(); + single.Clear(); + series.Clear(); - foreach (Schedule schedule in schedules) - { - if (schedule.ScheduleType > 0) - series.Add(schedule); - else - single.Add(schedule); - } + foreach (Schedule schedule in schedules) + { + if (schedule.ScheduleType > 0) + series.Add(schedule); + else + single.Add(schedule); + } - if (single.Count > 0) - { - addTable("single", single); - } + if (single.Count > 0) + { + addTable("single", single); + } - if (series.Count > 0) - { - addTable("series", series); - } + if (series.Count > 0) + { + addTable("series", series); + } } protected void addTable(String type, IList schedules) { - Table singleTable = new Table(); - singleTable.CellPadding = 0; - singleTable.CellSpacing = 0; - singleTable.CssClass = "grouptable"; + Table singleTable = new Table(); + singleTable.CellPadding = 0; + singleTable.CellSpacing = 0; + singleTable.CssClass = "grouptable"; - TableRow SeperatorRow = new TableRow(); - TableCell SeperatorCell = new TableCell(); - SeperatorCell.CssClass = "seperatorcell"; - SeperatorCell.ColumnSpan = 3; - Label l = new Label(); - if (type == "single") - l.Text = Resources.Resource.RecSingle; - else - l.Text = Resources.Resource.RecSeries; - SeperatorCell.Controls.Add(l); - SeperatorRow.Cells.Add(SeperatorCell); - singleTable.Rows.Add(SeperatorRow); + TableRow SeperatorRow = new TableRow(); + TableCell SeperatorCell = new TableCell(); + SeperatorCell.CssClass = "seperatorcell"; + SeperatorCell.ColumnSpan = 3; + Label l = new Label(); + if (type == "single") + l.Text = Resources.Resource.RecSingle; + else + l.Text = Resources.Resource.RecSeries; + SeperatorCell.Controls.Add(l); + SeperatorRow.Cells.Add(SeperatorCell); + singleTable.Rows.Add(SeperatorRow); - //Iterate through all the schedules - foreach (Schedule schedule in schedules) - { - TableRow scheduleNameRow = new TableRow(); + //Iterate through all the schedules + foreach (Schedule schedule in schedules) + { + TableRow scheduleNameRow = new TableRow(); - TableCell spacer = new TableCell(); - spacer.CssClass = "spacer"; - scheduleNameRow.Controls.Add(spacer); + TableCell spacer = new TableCell(); + spacer.CssClass = "spacer"; + scheduleNameRow.Controls.Add(spacer); - TableCell scheduleNameCell = new TableCell(); - scheduleNameCell.CssClass = "namecell"; - scheduleNameCell.ColumnSpan = 2; - Label channelName = new Label(); - channelName.Text = schedule.ProgramName; - scheduleNameCell.Controls.Add(channelName); + TableCell scheduleNameCell = new TableCell(); + scheduleNameCell.CssClass = "namecell"; + scheduleNameCell.ColumnSpan = 2; + Label channelName = new Label(); + channelName.Text = schedule.ProgramName; + scheduleNameCell.Controls.Add(channelName); - ImageButton deleteScheduleButton = new ImageButton(); - deleteScheduleButton.ImageUrl = "Images/redx.gif"; - deleteScheduleButton.CssClass = "deleteschedule"; - deleteScheduleButton.CommandArgument = schedule.IdSchedule.ToString(); - deleteScheduleButton.Click += new ImageClickEventHandler(deleteSchedule); - scheduleNameCell.Controls.Add(deleteScheduleButton); + ImageButton deleteScheduleButton = new ImageButton(); + deleteScheduleButton.ImageUrl = "Images/redx.gif"; + deleteScheduleButton.CssClass = "deleteschedule"; + deleteScheduleButton.CommandArgument = schedule.IdSchedule.ToString(); + deleteScheduleButton.Click += new ImageClickEventHandler(deleteSchedule); + scheduleNameCell.Controls.Add(deleteScheduleButton); - scheduleNameRow.Cells.Add(scheduleNameCell); - singleTable.Rows.Add(scheduleNameRow); + scheduleNameRow.Cells.Add(scheduleNameCell); + singleTable.Rows.Add(scheduleNameRow); - TableRow logoRow = new TableRow(); + TableRow logoRow = new TableRow(); - TableCell spacer2 = new TableCell(); - spacer2.CssClass = "spacer2"; - logoRow.Controls.Add(spacer2); + TableCell spacer2 = new TableCell(); + spacer2.CssClass = "spacer2"; + logoRow.Controls.Add(spacer2); - TableCell cell_logo = new TableCell(); - cell_logo.CssClass = "logocell"; + TableCell cell_logo = new TableCell(); + cell_logo.CssClass = "logocell"; - Image channelLogo = new Image(); - channelLogo.CssClass = "channellogo"; - Channel channel = Channel.Retrieve(schedule.IdChannel); - channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); + Image channelLogo = new Image(); + channelLogo.CssClass = "channellogo"; + Channel channel = Channel.Retrieve(schedule.IdChannel); + channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); - if (channelLogo.ImageUrl != "") - cell_logo.Controls.Add(channelLogo); + if (channelLogo.ImageUrl != "") + cell_logo.Controls.Add(channelLogo); - TableCell cell_description = new TableCell(); - cell_description.CssClass = "detailscell"; + TableCell cell_description = new TableCell(); + cell_description.CssClass = "detailscell"; - Label description = new Label(); + Label description = new Label(); - try - { - Channel c = Channel.Retrieve(schedule.IdChannel); - Program p = c.GetProgramAt(schedule.StartTime); - description.Text = p.Description; - cell_description.Controls.Add(description); - } - catch - { - description.Text = Resources.Resource.NoEPGInfo; - cell_description.Controls.Add(description); - } + try + { + Channel c = Channel.Retrieve(schedule.IdChannel); + Program p = c.GetProgramAt(schedule.StartTime); + description.Text = p.Description; + cell_description.Controls.Add(description); + } + catch + { + description.Text = Resources.Resource.NoEPGInfo; + cell_description.Controls.Add(description); + } - logoRow.Cells.Add(cell_logo); - logoRow.Cells.Add(cell_description); + logoRow.Cells.Add(cell_logo); + logoRow.Cells.Add(cell_description); - singleTable.Rows.Add(logoRow); + singleTable.Rows.Add(logoRow); - SchedulesPanel.Controls.Add(singleTable); - } + SchedulesPanel.Controls.Add(singleTable); + } } - } +} Modified: trunk/Version2/Web App/MPW/Search.aspx =================================================================== --- trunk/Version2/Web App/MPW/Search.aspx 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Search.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -8,30 +8,33 @@ <strong> <asp:Label ID="label_searchbydate" runat="server" Text="<%$ Resources:Resource, searchbydate %>"></asp:Label></strong> <br /> - <asp:RadioButton ID="radio_searchbydate1" runat="server" Checked="True" /> - <asp:Label ID="label_searchbydate1" runat="server" Text="<%$ Resources:Resource, primetimeshows %>"></asp:Label> + <asp:RadioButton ID="radio_searchbydate1" runat="server" Checked="True" Text="<%$ Resources:Resource, primetimeshows %>" + GroupName="date" /> <br /> - <asp:RadioButton ID="radio_searchbydate2" runat="server" /> - <asp:Label ID="label_searchbydate2" runat="server" Text="<%$ Resources:Resource, nowontv %>"></asp:Label> + <asp:RadioButton ID="radio_searchbydate2" runat="server" Text="<%$ Resources:Resource, nowontv %>" + GroupName="date" /> <br /> - <asp:RadioButton ID="radio_searchbydate3" runat="server" /> - <asp:Label ID="label_searchbydate3" runat="server" Text="<%$ Resources:Resource, customtime %>"></asp:Label> + <asp:RadioButton ID="radio_searchbydate3" runat="server" Text="<%$ Resources:Resource, customtime %>" + GroupName="date" />: + <asp:TextBox ID="customtime_h" runat="server" CssClass="customtime"></asp:TextBox> + : + <asp:TextBox ID="customtime_m" runat="server" CssClass="customtime"></asp:TextBox> <br /> - <asp:Button ID="button_searchbydate" runat="server" Text="<%$ Resources:Resource, Search %>" /> + <asp:Button ID="button_searchbydate" runat="server" Text="<%$ Resources:Resource, Search %>" + OnClick="button_searchbydate_Click" /> </div> <div style="line-height: 25px; float: left; width: 250px;"> <strong> <asp:Label ID="label_searchtext" runat="server" Text="<%$ Resources:Resource, searchbytext %>"></asp:Label></strong> <br /> - <asp:CheckBox ID="check_searchintitle" runat="server" Checked="True" /> - <asp:Label ID="label_searchintitle" runat="server" Text="<%$ Resources:Resource, searchintitle %>">"></asp:Label> + <asp:CheckBox ID="check_searchintitle" runat="server" Checked="True" Text="<%$ Resources:Resource, searchintitle %>" /> <br /> - <asp:CheckBox ID="check_searchindescription" runat="server" Checked="True" /> - <asp:Label ID="label_searchindescription" runat="server" Text="<%$ Resources:Resource, searchindescription %>">"></asp:Label> + <asp:CheckBox ID="check_searchindescription" runat="server" Checked="True" Text="<%$ Resources:Resource, searchindescription %>" /> <br /> <asp:TextBox ID="field_searchtext" runat="server"></asp:TextBox> <br /> - <asp:Button ID="button_searchtext" runat="server" Text="<%$ Resources:Resource, Search %>" /> + <asp:Button ID="button_searchtext" runat="server" Text="<%$ Resources:Resource, Search %>" + OnClick="button_searchtext_Click" /> </div> <div style="line-height: 25px; float: left; width: 250px;"> <strong> @@ -40,16 +43,19 @@ <asp:DropDownList ID="dropdown_searchbygenre" runat="server"> </asp:DropDownList> <br /> - <asp:Button ID="button_searchbygenre" runat="server" Text="<%$ Resources:Resource, Search %>" /> + <asp:Button ID="button_searchbygenre" runat="server" Text="<%$ Resources:Resource, Search %>" + OnClick="button_searchbygenre_Click" /> </div> - <div style="clear: both;"></div> + <div style="clear: both;"> + </div> <h1> <asp:Label ID="label_searchresults" runat="server" Text="<%$ Resources:Resource, searchresults %>"></asp:Label></h1> <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> - <contenttemplate> - 123 - </contenttemplate> - <triggers> - </triggers> + <ContentTemplate> + <asp:Table ID="Guide" runat="server" CssClass="guidetable"> + </asp:Table> + </ContentTemplate> + <Triggers> + </Triggers> </asp:UpdatePanel> </asp:Content> Modified: trunk/Version2/Web App/MPW/Search.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Search.aspx.cs 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Search.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -17,6 +17,108 @@ protected void Page_Load(object sender, EventArgs e) { - + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.Search; } + + /// <summary> + /// Method to update all visible content. + /// </summary> + protected void updateContents(IList searchresults) + { + + //Iterate through all the channels + foreach (Program program in searchresults) + { + Channel channel = Channel.Retrieve(program.IdChannel); + if (!channel.IsTv) + continue; + TableRow r = new TableRow(); + TableCell cell_channel = new TableCell(); + TableCell cell_program = new TableCell(); + cell_program.Height = 80; + + cell_channel.CssClass = "logocell"; + + Image channelLogo = new Image(); + channelLogo.CssClass = "channellogo"; + channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); + + if (channelLogo.ImageUrl != "") + { + cell_channel.Controls.Add(channelLogo); + Label br = new Label(); + br.Text = "<br />"; + cell_channel.Controls.Add(br); + } + + Label lbl_channel = new Label(); + lbl_channel.Text = "<strong>" + channel.Name + "</strong>"; + + cell_channel.Controls.Add(lbl_channel); + cell_channel.CssClass = "guideChannel"; + + Label resultdetails = new Label(); + resultdetails.Text = program.Description; + cell_program.Controls.Add(resultdetails); + + r.Cells.Add(cell_channel); + r.Cells.Add(cell_program); + + Guide.Rows.Add(r); + } + } + + /// <summary> + /// User chose to search by date and clicked the corresponding button. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void button_searchbydate_Click(object sender, EventArgs e) + { + // Primetime shows + if (radio_searchbydate1.Checked) + { + } + // On air now + else if (radio_searchbydate2.Checked) + { + TvBusinessLayer layer = new TvBusinessLayer(); + IList searchresults = layer.GetOnairNow(); + updateContents(searchresults); + } + // Custom time + else if (radio_searchbydate3.Checked) + { + DateTime now = DateTime.Now; + int h = Int32.Parse(customtime_h.Text); + int m = Int32.Parse(customtime_m.Text); + DateTime start = new DateTime(now.Year, now.Month, now.Day, h, m, 0); + DateTime end = new DateTime(now.Year, now.Month, now.Day, h, m, 0); + TvBusinessLayer layer = new TvBusinessLayer(); + IList searchresults = layer.GetPrograms(start, end); + updateContents(searchresults); + } + } + + /// <summary> + /// User chose to search by text and clicked the corresponding button. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void button_searchtext_Click(object sender, EventArgs e) + { + + } + + /// <summary> + /// User chose to search by genre and clicked the corresponding button. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void button_searchbygenre_Click(object sender, EventArgs e) + { + + } } Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2008-01-07 09:18:23 UTC (rev 55) @@ -121,8 +121,8 @@ table.guidetable { - table-layout:fixed; - overflow:hidden + table-layout: fixed; + overflow: hidden; } td.seperatorcell @@ -243,14 +243,19 @@ table.guidetable { - overflow:hidden; - width:90%; + overflow: hidden; + width: 90%; } td.guidecell { - overflow:hidden; - height:50px; - background-color:#D4D3D3; + overflow: hidden; + height: 50px; + background-color: #D4D3D3; border: 1px solid #000000; } + +input.customtime +{ + width: 20px; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |