diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 6854c997..4e02ffa1 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -99,6 +99,7 @@ + @@ -121,6 +122,8 @@ + + CampusMapPage.xaml diff --git a/CampusAppWP8/CampusAppWP8/Feed/StudentCouncil/StudentCouncilFeed.cs b/CampusAppWP8/CampusAppWP8/Feed/StudentCouncil/StudentCouncilFeed.cs new file mode 100644 index 00000000..9925ac05 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Feed/StudentCouncil/StudentCouncilFeed.cs @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 02.07.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Feed.StudentCouncil +{ + using System; + using CampusAppWP8.Model.StudentCouncil; + using CampusAppWP8.Resources; + using CampusAppWP8.Utility; + + /// + /// This Class is for StudentCouncilFeed + /// + public class StudentCouncilFeed : XmlFeed + { + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public StudentCouncilFeed() + : base(new Uri(Constants.UrlStudentCouncil_StudentCouncils, UriKind.Absolute), Constants.FileStudentCouncil_StudentCouncils) + { + } + + #endregion + + #region Method + + #region Protected + + /// + /// Method implement CheckIsModelUpToDate()-Method . + /// + /// true, if model is up-to-date, otherwise false + protected override bool CheckIsModelUpToDate() + { + DateTime lastModified = this.Model.CreateTime; + return this.CheckIsUpToDate(lastModified); + } + + /// + /// Method implement CheckIsFileUpToDate()-Method . + /// + /// true, if file is up-to-date, otherwise false + protected override bool CheckIsFileUpToDate() + { + DateTime lastModified = FileManager.GetFileInfo(FileName).LastWriteTime; + return this.CheckIsUpToDate(lastModified); + } + + #endregion + + #region Private + + /// + /// Check if the model or file is up-to-date. + /// + /// Date of the last modification + /// true, if is up-to-date, otherwise false + private bool CheckIsUpToDate(DateTime lastModified) + { + DateTime temp = lastModified.AddDays(1); + + int diff = temp.CompareTo(DateTime.Now); + + if (diff < 0) + { + return false; + } + + return true; + } + + #endregion + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Link/LinkModel.cs b/CampusAppWP8/CampusAppWP8/Model/Link/LinkModel.cs index fd36f338..d25e347d 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Link/LinkModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Link/LinkModel.cs @@ -21,22 +21,22 @@ namespace CampusAppWP8.Model.Link /// /// German version of the link title. /// - private string titleDE = string.Empty; + private string titleDE; /// /// English version of the link title. /// - private string titleEN = string.Empty; + private string titleEN; /// /// German version of the link. /// - private string linkDE = string.Empty; + private string linkDE; /// /// English version of the link. /// - private string linkEN = string.Empty; + private string linkEN; #endregion diff --git a/CampusAppWP8/CampusAppWP8/Model/StudentCouncil/StudentCouncilListModel.cs b/CampusAppWP8/CampusAppWP8/Model/StudentCouncil/StudentCouncilListModel.cs new file mode 100644 index 00000000..23aad7bd --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/StudentCouncil/StudentCouncilListModel.cs @@ -0,0 +1,59 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 02.07.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Model.StudentCouncil +{ + using System; + using System.Collections.ObjectModel; + using System.Xml.Serialization; + + /// + /// Model for menus in one week + /// + [XmlRoot("root")] + public class StudentCouncilListModel + { + #region Members + /// + /// Time when the model was created + /// + private readonly DateTime createTime; + + #endregion + #region Constructor + /// + /// Initializes a new instance of the class. + /// + public StudentCouncilListModel() + { + this.createTime = DateTime.Now; + } + + #endregion + + #region Proberty + /// + /// Gets or sets the StudentCouncils + /// + [XmlArray("data")] + [XmlArrayItem("studentcouncil")] + public ObservableCollection StudentCouncils { get; set; } + + /// + /// Gets the creation time of the model + /// + public DateTime CreateTime + { + get + { + return this.createTime; + } + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/StudentCouncil/StudentCouncilModel.cs b/CampusAppWP8/CampusAppWP8/Model/StudentCouncil/StudentCouncilModel.cs new file mode 100644 index 00000000..5058b293 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/StudentCouncil/StudentCouncilModel.cs @@ -0,0 +1,82 @@ +//----------------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 02.07.2013 +//----------------------------------------------------------------------------- + +namespace CampusAppWP8.Model.StudentCouncil +{ + using System.Globalization; + using System.Xml.Serialization; + + /// + /// Model for menu + /// + public class StudentCouncilModel + { + #region Member + + /// + /// German version of the link title. + /// + private string titleDE = string.Empty; + + /// + /// English version of the link title. + /// + private string titleEN = string.Empty; + + /// + /// German version of the link. + /// + private string linkDE = string.Empty; + + /// + /// English version of the link. + /// + private string linkEN = string.Empty; + + #endregion + + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public StudentCouncilModel() + { + } + + #endregion + + #region Property + + /// + /// Gets or sets the faculty of the StudentCouncil. + /// + [XmlAttribute("faculty")] + public string Faculty { get; set; } + + /// + /// Gets or sets the name of the StudentCouncil. + /// + [XmlAttribute("name")] + public string Name { get; set; } + + /// + /// Gets or sets the webpage-url of the StudentCouncil. + /// + [XmlAttribute("url")] + public string Url { get; set; } + + /// + /// Gets or sets the email-address of the StudentCouncil. + /// + [XmlAttribute("email")] + public string Email { get; set; } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs index d3783dd3..b2b37f4e 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs @@ -78,6 +78,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die StudentCouncils.xml ähnelt. + /// + internal static string FileStudentCouncil_StudentCouncils { + get { + return ResourceManager.GetString("FileStudentCouncil_StudentCouncils", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die LectureModel ähnelt. /// @@ -303,6 +312,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=studentcouncils&app=2&appversion=1 ähnelt. + /// + internal static string UrlStudentCouncil_StudentCouncils { + get { + return ResourceManager.GetString("UrlStudentCouncil_StudentCouncils", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die https://webmail.tu-cottbus.de ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index 1703b66c..17118a23 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -204,4 +204,10 @@ /Pages/Links/LinkPage.xaml + + StudentCouncils.xml + + + http://www.tu-cottbus.de/campusapp-data/getdata.php?db=studentcouncils&app=2&appversion=1 + \ No newline at end of file