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. |