/////////////////////////////////////////////////////////// // Bool.cs // Implementation of Class ClientPopUpNotesFetcher // CSLA type: Read-only object // Created on: 1-Nov-2007 // Object design: John // Coded: 1-Nov-2007 /////////////////////////////////////////////////////////// using System; using System.Data; using CSLA.Data; using GZTW.Data; using CSLA; using System.Threading; using CSLA.Security; using System.ComponentModel; namespace GZTW.AyaNova.BLL { /// ///Lightweight method for quickly fetching a object's PopupNotes if present ///Used by UI when opening workorders /// [Serializable, EditorBrowsable(EditorBrowsableState.Never)] public class ClientPopUpNotesFetcher : ReadOnlyBase { #region Attributes private string mNotes; #endregion #region Constructor /// /// Private constructor to prevent direct instantiation /// private ClientPopUpNotesFetcher() { mNotes=""; } #endregion #region Static methods /// /// Fetch the notes for the specified /// /// /// Popup notes public static string GetNotes(Guid ID) { return ((ClientPopUpNotesFetcher)DataPortal.Fetch(new Criteria(ID))).mNotes; } #endregion #region DAL DATA ACCESS /// /// protected override void DataPortal_Fetch(object Criteria) { Criteria crit = (Criteria)Criteria; SafeDataReader dr = null; try { dr = DBUtil.GetReaderFromSQLString( "SELECT ACLIENT.APOPUPNOTES " + "FROM ACLIENT " + "WHERE ACLIENT.AID= @ID", crit.ID); if (dr.Read()) { mNotes = dr.GetString("APOPUPNOTES"); } } finally { if (dr != null) dr.Close(); } } #endregion #region criteria /// /// Criteria for identifying existing object /// [Serializable] private class Criteria { public Guid ID; public Criteria(Guid _ID) { ID = _ID; } } #endregion }//end class }//end namespace GZTW.AyaNova.BLL