164 lines
3.1 KiB
C#
164 lines
3.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
using CSLA.Data;
|
|
using CSLA;
|
|
|
|
namespace GZTW.AyaNova.BLL
|
|
{
|
|
#pragma warning disable 1591
|
|
/// <summary>
|
|
/// Summary description for NotifySubscriptionList.
|
|
/// </summary>
|
|
[Serializable]
|
|
public class NotifySubscriptionList : CollectionBase
|
|
{
|
|
#region Subscription list info data structure
|
|
/// <summary>
|
|
/// Contains a subscription record
|
|
/// </summary>
|
|
[Serializable]
|
|
public struct SubscriptionListInfo
|
|
{
|
|
internal Guid mID;
|
|
internal SmartDate mCreated;
|
|
internal string mEventDescription;
|
|
internal Guid mGuidValue;
|
|
|
|
|
|
//ID Not localized as it's an invisible field
|
|
public Guid ID
|
|
{
|
|
get
|
|
{
|
|
return mID;
|
|
}
|
|
}
|
|
|
|
|
|
public object LT_NotifySubscription_Label_Created
|
|
{
|
|
get
|
|
{
|
|
return mCreated.DBValue;
|
|
}
|
|
}
|
|
|
|
public string LT_NotifySubscription_Label_EventDescription
|
|
{
|
|
get
|
|
{
|
|
return mEventDescription;
|
|
}
|
|
}
|
|
|
|
public Guid GuidValue
|
|
{
|
|
get
|
|
{
|
|
return mGuidValue;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
public bool Equals(SubscriptionListInfo obj)
|
|
{
|
|
return this.ID.Equals(obj.ID);
|
|
}
|
|
|
|
}//end MemoListInfo
|
|
#endregion
|
|
|
|
public NotifySubscriptionList()
|
|
{
|
|
//
|
|
// TODO: Add constructor logic here
|
|
//
|
|
}
|
|
|
|
|
|
public SubscriptionListInfo this[int index]
|
|
{
|
|
get
|
|
{
|
|
|
|
return (SubscriptionListInfo) this.List[index];
|
|
}
|
|
set
|
|
{
|
|
|
|
this.List[index] = value;
|
|
}
|
|
}
|
|
|
|
//add a subscriptionListInfo to the collection
|
|
public void Add(SubscriptionListInfo subscriptionListInfo)
|
|
{
|
|
this.List.Add(subscriptionListInfo);
|
|
}
|
|
|
|
#region Reporting
|
|
|
|
/// <summary>
|
|
/// Returns the report key which is a property of
|
|
/// reports used to link all reports that can be used
|
|
/// with a particular data source.
|
|
/// </summary>
|
|
public static string ReportKey
|
|
{
|
|
get
|
|
{
|
|
return "NotifySubscriptionList";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region Static methods
|
|
|
|
/// <summary>
|
|
/// Get bindable list of notification subscriptions for display (only) in grid
|
|
/// </summary>
|
|
/// <param name="ns"></param>
|
|
/// <returns></returns>
|
|
public static NotifySubscriptionList GetList(NotifySubscriber ns)
|
|
{
|
|
NotifySubscriptionList nsl=new NotifySubscriptionList();
|
|
foreach(NotifySubscription n in ns.Subscriptions)
|
|
{
|
|
SubscriptionListInfo info=new SubscriptionListInfo();
|
|
info.mID=n.ID;
|
|
info.mCreated=n.CreatedSD;
|
|
info.mEventDescription=NotifyEventUIHelper.GetEventLocalizedTextKey(n.RootObjectType,n.EventType);
|
|
info.mGuidValue=n.GuidValue;
|
|
nsl.Add(info);
|
|
|
|
|
|
}
|
|
|
|
return nsl;
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Return an empty list
|
|
/// used for initializing grid
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static NotifySubscriptionList GetEmptyList()
|
|
{
|
|
return new NotifySubscriptionList();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
#pragma warning restore 1591
|
|
}
|