From 15475dd7d5b7c671b1b9a85e9be21cf631ff1c22 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 14 Mar 2019 22:35:02 +0000 Subject: [PATCH] --- .../GZTW.AyaNova.BLL/IntegrationLogList.cs | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 source/bizobjects/AyaLib/GZTW.AyaNova.BLL/IntegrationLogList.cs diff --git a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/IntegrationLogList.cs b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/IntegrationLogList.cs new file mode 100644 index 0000000..7839a44 --- /dev/null +++ b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/IntegrationLogList.cs @@ -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 + /// + /// 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 \ No newline at end of file