From: <mas...@us...> - 2007-04-25 20:29:42
|
Revision: 45 http://svn.sourceforge.net/mp-webinterface/?rev=45&view=rev Author: maschine Date: 2007-04-25 13:29:27 -0700 (Wed, 25 Apr 2007) Log Message: ----------- Adding cleaned version. Added Paths: ----------- trunk/Version2/Web App/MPW/ trunk/Version2/Web App/MPW/App_Code/ trunk/Version2/Web App/MPW/App_Code/Utils.cs trunk/Version2/Web App/MPW/App_Data/ trunk/Version2/Web App/MPW/App_GlobalResources/ 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/ trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll trunk/Version2/Web App/MPW/Bin/Gentle.Common.dll trunk/Version2/Web App/MPW/Bin/Gentle.Framework.dll trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll.refresh trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll.refresh trunk/Version2/Web App/MPW/Bin/MySql.Data.dll trunk/Version2/Web App/MPW/Bin/TVDatabase.dll trunk/Version2/Web App/MPW/Bin/TVDatabase.dll.refresh trunk/Version2/Web App/MPW/Bin/TVLibrary.dll trunk/Version2/Web App/MPW/Bin/TVLibrary.dll.refresh trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll trunk/Version2/Web App/MPW/Bin/TvControl.dll trunk/Version2/Web App/MPW/Bin/TvControl.dll.refresh trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll trunk/Version2/Web App/MPW/Bin/log4net.dll trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/Images/ trunk/Version2/Web App/MPW/Images/bg_channel.jpg trunk/Version2/Web App/MPW/Images/bg_channel_logo.png trunk/Version2/Web App/MPW/Images/bg_channel_name.jpg trunk/Version2/Web App/MPW/Images/bg_channel_program.png trunk/Version2/Web App/MPW/Images/bg_channelgroup.jpg trunk/Version2/Web App/MPW/Images/bg_content.jpg trunk/Version2/Web App/MPW/Images/bg_logo.jpg trunk/Version2/Web App/MPW/Images/bg_navi.jpg trunk/Version2/Web App/MPW/Images/button_selected.png trunk/Version2/Web App/MPW/Images/button_unselected.png trunk/Version2/Web App/MPW/Images/favicon.ico trunk/Version2/Web App/MPW/Images/icon_bg.png trunk/Version2/Web App/MPW/Images/loading.gif trunk/Version2/Web App/MPW/Images/mp_logo_header.png trunk/Version2/Web App/MPW/Images/rec_series.png trunk/Version2/Web App/MPW/Images/rec_single.png trunk/Version2/Web App/MPW/Images/redx.gif trunk/Version2/Web App/MPW/Images/shadow_left.png trunk/Version2/Web App/MPW/Images/shadow_right.png trunk/Version2/Web App/MPW/Images/tvguide_notify_button.png trunk/Version2/Web App/MPW/Images/tvguide_recordconflict_button.png trunk/Version2/Web App/MPW/Images/tvguide_recordserie_conflict_button.png trunk/Version2/Web App/MPW/JS/ trunk/Version2/Web App/MPW/JS/mpw.js trunk/Version2/Web App/MPW/Login.aspx trunk/Version2/Web App/MPW/Login.aspx.cs trunk/Version2/Web App/MPW/MPW.master trunk/Version2/Web App/MPW/MPW.master.cs 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/TVLogos/ trunk/Version2/Web App/MPW/css/ trunk/Version2/Web App/MPW/css/mpw_style.css trunk/Version2/Web App/MPW/web.config trunk/Version2/Web App/MPW.sln Added: trunk/Version2/Web App/MPW/App_Code/Utils.cs =================================================================== --- trunk/Version2/Web App/MPW/App_Code/Utils.cs (rev 0) +++ trunk/Version2/Web App/MPW/App_Code/Utils.cs 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,142 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using TvDatabase; +using TvControl; + +using Gentle.Common; +using Gentle.Framework; + +namespace MPW +{ + public static class MPWUtils + { + private static bool isConnected = false; + + /// <summary> + /// Setup the DB connection. + /// </summary> + public static void SetupConnection() + { + if (!isConnected) + { + RemoteControl.Clear(); + //Set the hostname of the TV Server computer. + RemoteControl.HostName = "localhost"; + + //Retrieve the connection string. + string connStr, provider; + RemoteControl.Instance.GetDatabaseConnectionString(out connStr, out provider); + + //Set the connection string. + Gentle.Framework.ProviderFactory.SetDefaultProviderConnectionString(connStr); + + isConnected = true; + } + } + + /// <summary> + /// Gets the channel logo for a channel. + /// </summary> + /// <param name="path">The physical path of the TVLogos directory</param> + /// <param name="name">The channel's name</param> + /// <returns>URL of the channel logo if there is one</returns> + public static String getChannelLogoPath(String pysicalpath, String name) + { + if (System.IO.File.Exists(pysicalpath + name + ".png")) + { + String channelLogo; + channelLogo = "~/TVLogos/" + name + ".png"; + return channelLogo; + } + else if (System.IO.File.Exists(pysicalpath + name + ".jpg")) + { + String channelLogo; + channelLogo = "~/TVLogos/" + name + ".jpg"; + return channelLogo; + } + else if (System.IO.File.Exists(pysicalpath + name + ".gif")) + { + String channelLogo; + channelLogo = "~/TVLogos/" + name + ".gif"; + return channelLogo; + } + else + return null; + } + + /// <summary> + /// Adds a new recording to the list of schedules. + /// </summary> + /// <param name="idProgram">The program ID</param> + /// <param name="recType">The ScheduleRecordingType</param> + public static bool addSchedule(int idProgram, ScheduleRecordingType recType) + { + try + { + TvBusinessLayer layer = new TvBusinessLayer(); + Program p = Program.Retrieve(idProgram); + int rT = (int)recType; + Schedule newSchedule = new Schedule(p.IdChannel, p.Title, p.StartTime, p.EndTime); + newSchedule.ScheduleType = rT; + newSchedule.Persist(); + //Notify TVserver of new schedule + RemoteControl.Instance.OnNewSchedule(); + return true; + } + catch + { + return false; + } + } + + /// <summary> + /// Deletes a schedule from the database. + /// </summary> + /// <param name="idProgram">The schedule ID</param> + public static bool deleteSchedule(int idSchedule) + { + try + { + Schedule s = Schedule.Retrieve(idSchedule); + s.Delete(); + //Notify TVserver of new schedule + RemoteControl.Instance.OnNewSchedule(); + return true; + } + catch + { + return false; + } + } + + /// <summary> + /// Prepares a DropDownList with all possible recording schedule types MP offers + /// </summary> + /// <param name="ScheduleType">The DropDownlist to fill</param> + public static void prepareScheduleTypeDropDown(DropDownList ScheduleType) + { + ScheduleType.Items.Clear(); + ScheduleType.Items.Add(new ListItem(Resources.Resource.Once, + ((int)ScheduleRecordingType.Once).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.Daily, + ((int)ScheduleRecordingType.Daily).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.Weekly, + ((int)ScheduleRecordingType.Weekly).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.EveryTimeOnThisChannel, + ((int)ScheduleRecordingType.EveryTimeOnThisChannel).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.EveryTimeOnEveryChannel, + ((int)ScheduleRecordingType.EveryTimeOnEveryChannel).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.Weekends, + ((int)ScheduleRecordingType.Weekends).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.WorkingDays, + ((int)ScheduleRecordingType.WorkingDays).ToString())); + } + } +} \ No newline at end of file Added: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx (rev 0) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,194 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="Daily" xml:space="preserve"> + <value>Täglich</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnEveryChannel" xml:space="preserve"> + <value>Immer auf jedem Sender</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnThisChannel" xml:space="preserve"> + <value>Immer auf diesem Sender</value> + <comment>ScheduleType</comment> + </data> + <data name="Guide" xml:space="preserve"> + <value>Programmführer</value> + <comment>Navigation</comment> + </data> + <data name="LiveTV" xml:space="preserve"> + <value>Live TV</value> + <comment>Navigation</comment> + </data> + <data name="Next" xml:space="preserve"> + <value>Gleich</value> + </data> + <data name="NoEPGInfo" xml:space="preserve"> + <value>Leider keine Informationen verfügbar...</value> + <comment>Guide</comment> + </data> + <data name="Now" xml:space="preserve"> + <value>Jetzt</value> + </data> + <data name="NowNext" xml:space="preserve"> + <value>Jetzt & Gleich</value> + <comment>Navigation</comment> + </data> + <data name="Once" xml:space="preserve"> + <value>Einmalig</value> + <comment>ScheduleType</comment> + </data> + <data name="Record" xml:space="preserve"> + <value>Aufnehmen!</value> + </data> + <data name="Recordings" xml:space="preserve"> + <value>Aufnahmen</value> + <comment>Navigation</comment> + </data> + <data name="RecordThis" xml:space="preserve"> + <value>Diese Sendung aufnehmen</value> + </data> + <data name="RecSeries" xml:space="preserve"> + <value>Serienaufnahmen</value> + </data> + <data name="RecSingle" xml:space="preserve"> + <value>Einfache Aufnahmen</value> + </data> + <data name="Schedules" xml:space="preserve"> + <value>Timer</value> + <comment>Navigation</comment> + </data> + <data name="Search" xml:space="preserve"> + <value>Suchen</value> + <comment>Navigation</comment> + </data> + <data name="Weekends" xml:space="preserve"> + <value>Weekends</value> + <comment>ScheduleType</comment> + </data> + <data name="Weekly" xml:space="preserve"> + <value>Wöchentlich</value> + <comment>ScheduleType</comment> + </data> + <data name="WorkingDays" xml:space="preserve"> + <value>Workingdays</value> + <comment>ScheduleType</comment> + </data> +</root> \ No newline at end of file Added: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx (rev 0) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,200 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="Daily" xml:space="preserve"> + <value>Daily</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnEveryChannel" xml:space="preserve"> + <value>Everytime on every channel</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnThisChannel" xml:space="preserve"> + <value>Everytime on this channel</value> + <comment>ScheduleType</comment> + </data> + <data name="Guide" xml:space="preserve"> + <value>Guide</value> + <comment>Navigation</comment> + </data> + <data name="LiveTV" xml:space="preserve"> + <value>Live TV</value> + <comment>Navigation</comment> + </data> + <data name="Login" xml:space="preserve"> + <value>Login</value> + </data> + <data name="Next" xml:space="preserve"> + <value>Next</value> + </data> + <data name="NoEPGInfo" xml:space="preserve"> + <value>Sorry, no information available...</value> + <comment>Guide</comment> + </data> + <data name="Now" xml:space="preserve"> + <value>Now</value> + </data> + <data name="NowNext" xml:space="preserve"> + <value>Now & Next</value> + <comment>Navigation</comment> + </data> + <data name="Once" xml:space="preserve"> + <value>Once</value> + <comment>ScheduleType</comment> + </data> + <data name="PageTitle" xml:space="preserve"> + <value>MPW - The MediaPortal Webinterface</value> + </data> + <data name="Record" xml:space="preserve"> + <value>Record!</value> + </data> + <data name="Recordings" xml:space="preserve"> + <value>Recordings</value> + <comment>Navigation</comment> + </data> + <data name="RecordThis" xml:space="preserve"> + <value>Record this program</value> + </data> + <data name="RecSeries" xml:space="preserve"> + <value>Series recordings</value> + </data> + <data name="RecSingle" xml:space="preserve"> + <value>Single recordings</value> + </data> + <data name="Schedules" xml:space="preserve"> + <value>Schedules</value> + <comment>Navigation</comment> + </data> + <data name="Search" xml:space="preserve"> + <value>Search</value> + <comment>Navigation</comment> + </data> + <data name="Weekends" xml:space="preserve"> + <value>Weekends</value> + <comment>ScheduleType</comment> + </data> + <data name="Weekly" xml:space="preserve"> + <value>Weekly</value> + <comment>ScheduleType</comment> + </data> + <data name="WorkingDays" xml:space="preserve"> + <value>Workingdays</value> + <comment>ScheduleType</comment> + </data> +</root> \ No newline at end of file Added: trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Common.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Common.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Framework.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Framework.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll.refresh =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll.refresh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll.refresh =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll.refresh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/MySql.Data.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/MySql.Data.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll.refresh =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll.refresh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll.refresh =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll.refresh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TvControl.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TvControl.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TvControl.dll.refresh =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TvControl.dll.refresh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/log4net.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/log4net.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx (rev 0) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +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 /> + <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> + <ContentTemplate> + <asp:Table ID="Guide" runat="server" Width="90%"> + </asp:Table> + </ContentTemplate> + <Triggers> + </Triggers> + </asp:UpdatePanel> +</asp:Content> + Added: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,124 @@ +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 _Default : System.Web.UI.Page +{ + private DateTime guideStart = DateTime.Now; + private DateTime guideEnd; + + protected void Page_Load(object sender, EventArgs e) + { + 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(); + 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>"; + + cell_channel.Controls.Add(lbl_channel); + cell_channel.CssClass = "guideChannel"; + + 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); + + Guide.Rows.Add(r); + } + } + } Added: trunk/Version2/Web App/MPW/Images/bg_channel.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channel_logo.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel_logo.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channel_name.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel_name.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channel_program.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel_program.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channelgroup.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channelgroup.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_content.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_content.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_logo.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_logo.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_navi.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_navi.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/button_selected.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/button_selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/button_unselected.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/button_unselected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/favicon.ico =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/favicon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/icon_bg.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/icon_bg.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/loading.gif =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/loading.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/mp_logo_header.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/mp_logo_header.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/rec_series.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/rec_series.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/rec_single.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/rec_single.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/redx.gif =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/redx.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/shadow_left.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/shadow_left.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/shadow_right.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/shadow_right.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/tvguide_notify_button.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/tvguide_notify_button.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/tvguide_recordconflict_button.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/tvguide_recordconflict_button.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/tvguide_recordserie_conflict_button.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/tvguide_recordserie_conflict_button.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/JS/mpw.js =================================================================== --- trunk/Version2/Web App/MPW/JS/mpw.js (rev 0) +++ trunk/Version2/Web App/MPW/JS/mpw.js 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,13 @@ +function showProgramDetails(IdProgram) { +document.getElementById("showDetails").value = "true"; +document.getElementById("idDetails").value = IdProgram; +document.getElementById("programInfo").style.display = "block"; +document.getElementById("programInfo").style.visibility = "visible"; +document.aspnetForm.submit(); +} + +function hideProgramDetails() { +$(showDetail).value = "false"; +$(idDetail).value = ""; +MPW_main.submit(); +} \ No newline at end of file Added: trunk/Version2/Web App/MPW/Login.aspx =================================================================== --- trunk/Version2/Web App/MPW/Login.aspx (rev 0) +++ trunk/Version2/Web App/MPW/Login.aspx 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,10 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" + Inherits="Default2" Title="Untitled Page" %> + +<asp:Content ID="Login" ContentPlaceHolderID="MPWContent" runat="Server"> + <br /> + <br /> + <asp:Login ID="MPWLogin" runat="server" Height="185px" OnAuthenticate="MPWLogin_Authenticate" + Width="359px"> + </asp:Login> +</asp:Content> Added: trunk/Version2/Web App/MPW/Login.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Login.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/Login.aspx.cs 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,29 @@ +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; + +public partial class Default2 : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.Login; + } + + protected void MPWLogin_Authenticate(object sender, AuthenticateEventArgs e) + { + //ToDo: Add authentication Logic here! + if (MPWLogin.Password == "mpw" && MPWLogin.UserName == "mpw") + e.Authenticated = true; + else + e.Authenticated = false; + } + +} Added: trunk/Version2/Web App/MPW/MPW.master =================================================================== --- trunk/Version2/Web App/MPW/MPW.master (rev 0) +++ trunk/Version2/Web App/MPW/MPW.master 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,80 @@ +<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MPW.master.cs" Inherits="MPWMaster" %> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head id="Head1" runat="server"> + <title>MPW - The MediaPortal Webinterface</title> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> + <link rel="shortcut icon" href="Images/favicon.ico" /> + <link href="css/mpw_style.css" rel="stylesheet" type="text/css" /> + + <script src="JS/mpw.js" type="text/javascript"></script> + +</head> +<body> + <form id="MPW_main" runat="server"> + <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> + <div style="width: 200px; float: right;"> + <asp:UpdateProgress ID="GlobalUpdateProgress" runat="server" DisplayAfter="10"> + <ProgressTemplate> + <img src="../Images/loading.gif" alt="Loading..." /> + <br /> + <!-- Getting data... Please wait! --> + </ProgressTemplate> + </asp:UpdateProgress> + </div> + </div> + <div class="navidiv"> + <table class="navBar"> + <tr> + <td id="nav_guide" class="navcell"> + <asp:HyperLink ID="LinkGuide" runat="server" Text="<%$ Resources:Resource, Guide %>" + NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_now" class="navcell"> + <asp:HyperLink ID="LinkNowNext" runat="server" Text="<%$ Resources:Resource, NowNext %>" + NavigateUrl="~/NowNext.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_search" class="navcell"> + <asp:HyperLink ID="LinkSearch" runat="server" Text="<%$ Resources:Resource, Search %>" + NavigateUrl="~/Search.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_sched" class="navcell"> + <asp:HyperLink ID="LinkSchedules" runat="server" Text="<%$ Resources:Resource, Schedules %>" + NavigateUrl="~/Schedules.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_rec" class="navcell"> + <asp:HyperLink ID="LinkRecordings" runat="server" Text="<%$ Resources:Resource, Recordings %>" + NavigateUrl="~/Recordings.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> + </td> + </tr> + </table> + <div class="datediv"> + <asp:Label ID="dateLabel" runat="server" Text=""></asp:Label> + </div> + </div> + <div class="contentdiv"> + <table class="content"> + <tr> + <td class="leftcontent"> + </td> + <td class="maincontent"> + <asp:ContentPlaceHolder ID="MPWContent" runat="server"> + </asp:ContentPlaceHolder> + </td> + <td class="rightcontent"> + </td> + </tr> + </table> + </div> + </form> +</body> +</html> Added: trunk/Version2/Web App/MPW/MPW.master.cs =================================================================== --- trunk/Version2/Web App/MPW/MPW.master.cs (rev 0) +++ trunk/Version2/Web App/MPW/MPW.master.cs 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,42 @@ +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; + +public partial class MPWMaster : System.Web.UI.MasterPage +{ + String sectiontitle; + + public string Sectiontitle + { + get + { + return sectiontitle; + } + + set + { + sectiontitle = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + dateLabel.Text = DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToShortTimeString(); + } + + protected override void OnLoad(EventArgs e) + { + string title = String.Format(@"{0} > {1}", Resources.Resource.PageTitle, sectiontitle); + + Page.Header.Title = title; + + base.OnLoad(e); + } +} Added: trunk/Version2/Web App/MPW/NowNext.aspx =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx (rev 0) +++ trunk/Version2/Web App/MPW/NowNext.aspx 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,38 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="NowNext.aspx.cs" Inherits="Default2" Title="Untitled Page" %> + +<asp:Content ID="NowNext" ContentPlaceHolderID="MPWContent" runat="Server"> + <asp:UpdatePanel ID="ContentUpdatePanel" runat="server" UpdateMode="Always"> + <ContentTemplate> + <div> + <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> + Added: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,263 @@ +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; + + /// <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> + /// 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> + /// Updates the now and next program rows. + /// </summary> + protected void updateContents() + { + //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(); + + foreach (ChannelGroup group in groups) + { + 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); + + // 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); + } + + //Iterate through all the channels + foreach (Channel channel in channelstv) + { + TableRow channelNameRow = new TableRow(); + + TableCell spacer = new TableCell(); + spacer.CssClass = "spacer"; + channelNameRow.Controls.Add(spacer); + + TableCell channelNameCell = new TableCell(); + channelNameCell.CssClass = "namecell"; + channelNameCell.ColumnSpan = 2; + Label channelName = new Label(); + channelName.Tex... [truncated message content] |