98 lines
2.5 KiB
C#
98 lines
2.5 KiB
C#
// Copyright (c) 2017 schick Informatik
|
|
// Description: Container-Klasse für die Status-Informationen des NSW (zur Deserialisierung)
|
|
|
|
using System;
|
|
using System.IO;
|
|
using System.Xml.Serialization;
|
|
|
|
using log4net;
|
|
|
|
namespace bsmd.status
|
|
{
|
|
[Serializable]
|
|
public class dataset
|
|
{
|
|
private static ILog _log = LogManager.GetLogger(typeof(bsmd.status.dataset));
|
|
|
|
/// <summary>
|
|
/// this class needs a public empty constructor for deserialization
|
|
/// </summary>
|
|
public dataset() {}
|
|
|
|
#region Properties
|
|
|
|
public DateTime SendAt { get; set; }
|
|
|
|
public string VisitIdTransitId { get; set; }
|
|
|
|
#endregion
|
|
|
|
#region Deserialization
|
|
|
|
public static dataset ReadStatus(string statusString)
|
|
{
|
|
dataset aStatus = null;
|
|
try
|
|
{
|
|
XmlSerializer serializer = new XmlSerializer(typeof(bsmd.status.dataset));
|
|
using (TextReader reader = new StringReader(statusString))
|
|
{
|
|
aStatus = serializer.Deserialize(reader) as dataset;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
_log.ErrorFormat("Exception occurred during deserialization: {0}", ex.Message);
|
|
}
|
|
|
|
return aStatus;
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
[Serializable]
|
|
public class NswResponse
|
|
{
|
|
#region Properties
|
|
|
|
public string Cancelled { get; set; }
|
|
|
|
[XmlIgnore]
|
|
public bool IsCancelled
|
|
{
|
|
get
|
|
{
|
|
if ((this.Cancelled != null) && (this.Cancelled == "Y")) return true;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public string VisitIdOrTransitIdCancellable { get; set; }
|
|
|
|
[XmlIgnore]
|
|
public bool IsVisitIdOrTransitIdCancellable
|
|
{
|
|
get
|
|
{
|
|
if ((this.VisitIdOrTransitIdCancellable != null) && (this.VisitIdOrTransitIdCancellable == "Y")) return true;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public string BlockedNotificationClasses { get; set; }
|
|
|
|
public string OwnNotificationClasses { get; set; }
|
|
|
|
public string FreeNotificationClasses { get; set; }
|
|
|
|
public string ErrorCode { get; set; }
|
|
|
|
public string ErrorMessage { get; set; }
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|