242 lines
6.3 KiB
C#
242 lines
6.3 KiB
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="LectureActivity.cs" company="BTU/IIT">
|
|
// Company copyright tag.
|
|
// </copyright>
|
|
// <author>stubbfel</author>
|
|
// <sience>13.06.2013</sience>
|
|
//----------------------------------------------------------------------
|
|
namespace CampusAppWPortalLib8.Model.Lecture
|
|
{
|
|
using System.Collections.ObjectModel;
|
|
using System.Xml.Serialization;
|
|
using CampusAppWPortalLib8.Resources;
|
|
using CampusAppWPortalLib8.Utility;
|
|
|
|
/// <summary>
|
|
/// Model for a Activity
|
|
/// </summary>
|
|
public class LectureActivity
|
|
{
|
|
#region Members
|
|
|
|
/// <summary>The activity icon name lecture.</summary>
|
|
public const string ActivityTypeLecture = "Vorlesung";
|
|
|
|
/// <summary>The activity icon name seminar.</summary>
|
|
public const string ActivityTypeSeminar = "Seminar";
|
|
|
|
/// <summary>The activity icon name practice.</summary>
|
|
public const string ActivityTypePract = "Übung";
|
|
|
|
/// <summary>The activity icon name lab.</summary>
|
|
public const string ActivityTypeLab = "Labor";
|
|
|
|
/// <summary>The activity icon name exam.</summary>
|
|
public const string ActivityTypeExam = "Prüfung";
|
|
|
|
/// <summary>
|
|
/// List of lecturer
|
|
/// </summary>
|
|
private ObservableCollection<LectureLecturer> lecturer;
|
|
|
|
/// <summary>
|
|
/// a formatted string for the names of the lecturers
|
|
/// </summary>
|
|
private string lecturerString;
|
|
|
|
/// <summary>
|
|
/// a formatted string for the names of the courses
|
|
/// </summary>
|
|
private string courseString;
|
|
|
|
/// <summary>
|
|
/// a formatted string for the topic of the lecture
|
|
/// </summary>
|
|
private string topic;
|
|
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="LectureActivity" /> class.
|
|
/// </summary>
|
|
public LectureActivity()
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Proberty
|
|
|
|
/// <summary>
|
|
/// Gets or sets the type of the activity
|
|
/// </summary>
|
|
[XmlElement("art")]
|
|
public string Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the id of the activity
|
|
/// </summary>
|
|
[XmlAttribute("id")]
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets semester of the activity
|
|
/// </summary>
|
|
[XmlElement("semester")]
|
|
public int Semester { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the contact hour
|
|
/// </summary>
|
|
[XmlElement("sws")]
|
|
public string SWS { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets LectureModule
|
|
/// </summary>
|
|
[XmlElement("modul")]
|
|
public LectureModule Modul { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets LectureTitle
|
|
/// </summary>
|
|
[XmlElement("titel")]
|
|
public string Title { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the lecturers
|
|
/// </summary>
|
|
[XmlElement("lehrperson")]
|
|
public ObservableCollection<LectureLecturer> Lecturer
|
|
{
|
|
get
|
|
{
|
|
return this.lecturer;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (value != this.lecturer)
|
|
{
|
|
this.lecturer = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or sets the formatted string of the lecturers
|
|
/// </summary>
|
|
public string LecturerString
|
|
{
|
|
get
|
|
{
|
|
return this.lecturerString;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (value != this.lecturerString)
|
|
{
|
|
this.lecturerString = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or sets formatted string of the courses
|
|
/// </summary>
|
|
public string CourseString
|
|
{
|
|
get
|
|
{
|
|
return this.courseString;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (value != this.courseString)
|
|
{
|
|
this.courseString = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or sets the courses
|
|
/// </summary>
|
|
[XmlElement("studiengang")]
|
|
public ObservableCollection<LectureCourse> Course { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the dates of the activity
|
|
/// </summary>
|
|
[XmlElement("termin")]
|
|
public ObservableCollection<LectureDate> Dates { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Department
|
|
/// </summary>
|
|
[XmlElement("zugeordnete_einrichtung")]
|
|
public string Department { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the topic of the Lecture
|
|
/// </summary>
|
|
[XmlElement("lehrinhalt")]
|
|
public string Topic
|
|
{
|
|
get
|
|
{
|
|
return this.topic;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (value != this.topic)
|
|
{
|
|
this.topic = value;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region Methods
|
|
|
|
#region public
|
|
|
|
/// <summary>
|
|
/// Method create a formatted string of the LecturerList
|
|
/// </summary>
|
|
public void CreateLectureString()
|
|
{
|
|
string result = string.Empty;
|
|
foreach (LectureLecturer tmpLecturer in this.Lecturer)
|
|
{
|
|
result += DefaultStringManager.AddNewLine(tmpLecturer.ToString());
|
|
}
|
|
|
|
this.LecturerString = DefaultStringManager.RemoveNewLine(result);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Method create a formatted string of the CourseList
|
|
/// </summary>
|
|
public void CreateCourseString()
|
|
{
|
|
string result = string.Empty;
|
|
foreach (LectureCourse course in this.Course)
|
|
{
|
|
result += DefaultStringManager.AddNewLine(course.Title);
|
|
}
|
|
|
|
this.CourseString = DefaultStringManager.RemoveNewLine(result);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
}
|
|
}
|