///////////////////////////////////////////////////////////
// IntegrationLogList.cs
// Implementation of Class IntegrationLogList
// CSLA type: Read only collection
// Created on: 31-Dec-2018
// Object design: John
// Coded: 31-Dec-2018
///////////////////////////////////////////////////////////
//case 3664
using System;
using System.Data;
using GZTW.Data;
using CSLA.Data;
using CSLA;
using System.Threading;
using CSLA.Security;
namespace GZTW.AyaNova.BLL
{
#pragma warning disable 1591
///
/// Lightweight read only list of objects representing log entries regarding integration log events
///
[Serializable]
public class IntegrationLogList : ReadOnlyCollectionBase
{
#region Data structure
///
/// Log fields
///
[Serializable]
public struct IntegrationLogListInfo
{
internal string mLogEntry;
public string LogEntry
{
get
{
return mLogEntry;
}
}
}//end IntegrationLogListInfo
#endregion
#region Constructor
protected IntegrationLogList()
{
}
#endregion
#region Business properties and methods
///
/// Get item by index
///
///
public IntegrationLogListInfo this[int Item]
{
get
{
return (IntegrationLogListInfo) List[Item];
}
}
#endregion
#region Reporting
///
/// Returns the report key which is a property of
/// reports used to link all reports that can be used
/// with a particular data source.
///
public static string ReportKey
{
get
{
return "IntegrationLogList";
}
}
#endregion
#region Static methods
///
/// Get all NotifyDeliveryLog entries
///
/// list of objects
public static IntegrationLogList GetList()
{
return (IntegrationLogList) DataPortal.Fetch(new Criteria());
}
///
/// Return an empty list
/// used for initializing grid
///
///
public static IntegrationLogList GetEmptyList()
{
return new IntegrationLogList();
}
#endregion
#region DAL DATA ACCESS
///
///
protected override void DataPortal_Fetch(object Criteria)
{
//Get a user list to use for displaying in grid
UserPickList upl=UserPickList.GetList(false);
Criteria crit = (Criteria)Criteria;
SafeDataReader dr = null;
try
{
dr=DBUtil.GetReaderFromSQLString(
//************************************************************
"SELECT * FROM aIntegrationLog ORDER BY acreated"
//************************************************************
);
while(dr.Read())
{
//*******************************************
IntegrationLogListInfo info=new IntegrationLogListInfo();
info.mLogEntry = DBUtil.ToLocal(dr.GetSmartDate("ACREATED")).ToString();
info.mLogEntry += "|";
info.mLogEntry += dr.GetGuid("AINTEGRATIONID").ToString();
info.mLogEntry += "|";
info.mLogEntry += dr.GetString("AMESSAGE");
InnerList.Add(info);
//*******************************************
}
}
finally
{
if(dr!=null) dr.Close();
}
}
#endregion
#region criteria
///
/// Criteria for identifying existing object
///
[Serializable]
private class Criteria
{
public Criteria()
{
}
}
#endregion
}//end IntegrationLogList
#pragma warning restore 1591
}//end namespace GZTW.AyaNova.BLL