This commit is contained in:
192
source/bizobjects/AyaLib/GZTW.AyaNova.BLL/IntegrationLogList.cs
Normal file
192
source/bizobjects/AyaLib/GZTW.AyaNova.BLL/IntegrationLogList.cs
Normal file
@@ -0,0 +1,192 @@
|
||||
///////////////////////////////////////////////////////////
|
||||
// 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
|
||||
/// <summary>
|
||||
/// Lightweight read only list of <see cref="IntegrationLogList.IntegrationLogListInfo"/> objects representing log entries regarding integration log events
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class IntegrationLogList : ReadOnlyCollectionBase
|
||||
{
|
||||
|
||||
|
||||
#region Data structure
|
||||
/// <summary>
|
||||
/// Log fields
|
||||
/// </summary>
|
||||
[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
|
||||
|
||||
/// <summary>
|
||||
/// Get item by index
|
||||
/// </summary>
|
||||
/// <param name="Item"></param>
|
||||
public IntegrationLogListInfo this[int Item]
|
||||
{
|
||||
|
||||
get
|
||||
{
|
||||
return (IntegrationLogListInfo) List[Item];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#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 "IntegrationLogList";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static methods
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get all NotifyDeliveryLog entries
|
||||
/// </summary>
|
||||
/// <returns>list of <see cref="IntegrationLogList.IntegrationLogListInfo"/> objects</returns>
|
||||
public static IntegrationLogList GetList()
|
||||
{
|
||||
return (IntegrationLogList) DataPortal.Fetch(new Criteria());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return an empty list
|
||||
/// used for initializing grid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IntegrationLogList GetEmptyList()
|
||||
{
|
||||
return new IntegrationLogList();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region DAL DATA ACCESS
|
||||
///
|
||||
/// <param name="Criteria"></param>
|
||||
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
|
||||
/// <summary>
|
||||
/// Criteria for identifying existing object
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
private class Criteria
|
||||
{
|
||||
public Criteria()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
}//end IntegrationLogList
|
||||
#pragma warning restore 1591
|
||||
}//end namespace GZTW.AyaNova.BLL
|
||||
Reference in New Issue
Block a user