CSLA - Generated - Batch - As
This commit is contained in:
@@ -13,8 +13,6 @@ using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using Csla;
|
||||
using Csla.Data;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
namespace VEPROMS.CSLA.Library
|
||||
@@ -28,15 +26,13 @@ namespace VEPROMS.CSLA.Library
|
||||
public partial class AnnotationAuditInfo : ReadOnlyBase<AnnotationAuditInfo>, IDisposable
|
||||
{
|
||||
public event AnnotationAuditInfoEvent Changed;
|
||||
private void OnChange()
|
||||
{
|
||||
if (Changed != null) Changed(this);
|
||||
}
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
#region Collection
|
||||
private static List<AnnotationAuditInfo> _CacheList = new List<AnnotationAuditInfo>();
|
||||
private void OnChange() => Changed?.Invoke(this);
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
#region Collection
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private static List<AnnotationAuditInfo> _CacheList = new List<AnnotationAuditInfo>();
|
||||
protected static void AddToCache(AnnotationAuditInfo annotationAuditInfo)
|
||||
{
|
||||
if (!_CacheList.Contains(annotationAuditInfo)) _CacheList.Add(annotationAuditInfo); // In AddToCache
|
||||
@@ -45,7 +41,8 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
while (_CacheList.Contains(annotationAuditInfo)) _CacheList.Remove(annotationAuditInfo); // In RemoveFromCache
|
||||
}
|
||||
private static Dictionary<string, List<AnnotationAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<AnnotationAuditInfo>>();
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private static Dictionary<string, List<AnnotationAuditInfo>> _CacheByPrimaryKey = new Dictionary<string, List<AnnotationAuditInfo>>();
|
||||
private static void ConvertListToDictionary()
|
||||
{
|
||||
while (_CacheList.Count > 0) // Move AnnotationAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey
|
||||
@@ -74,21 +71,8 @@ namespace VEPROMS.CSLA.Library
|
||||
#endregion
|
||||
#region Business Methods
|
||||
private string _ErrorMessage = string.Empty;
|
||||
public string ErrorMessage
|
||||
{
|
||||
get { return _ErrorMessage; }
|
||||
}
|
||||
protected AnnotationAudit _Editable;
|
||||
private IVEHasBrokenRules HasBrokenRules
|
||||
{
|
||||
get
|
||||
{
|
||||
IVEHasBrokenRules hasBrokenRules = null;
|
||||
if (_Editable != null)
|
||||
hasBrokenRules = _Editable.HasBrokenRules;
|
||||
return hasBrokenRules;
|
||||
}
|
||||
}
|
||||
public string ErrorMessage => _ErrorMessage;
|
||||
protected AnnotationAudit _Editable;
|
||||
private long _AuditID;
|
||||
[System.ComponentModel.DataObjectField(true, true)]
|
||||
public long AuditID
|
||||
@@ -180,50 +164,33 @@ namespace VEPROMS.CSLA.Library
|
||||
return _DeleteStatus;
|
||||
}
|
||||
}
|
||||
// CSLATODO: Replace base AnnotationAuditInfo.ToString function as necessary
|
||||
/// <summary>
|
||||
/// Overrides Base ToString
|
||||
/// </summary>
|
||||
/// <returns>A string representation of current AnnotationAuditInfo</returns>
|
||||
//public override string ToString()
|
||||
//{
|
||||
// return base.ToString();
|
||||
//}
|
||||
// CSLATODO: Check AnnotationAuditInfo.GetIdValue to assure that the ID returned is unique
|
||||
/// <summary>
|
||||
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
|
||||
/// </summary>
|
||||
/// <returns>A Unique ID for the current AnnotationAuditInfo</returns>
|
||||
protected override object GetIdValue()
|
||||
{
|
||||
return MyAnnotationAuditInfoUnique; // Absolutely Unique ID
|
||||
}
|
||||
#endregion
|
||||
#region Factory Methods
|
||||
// CSLATODO: Check AnnotationAuditInfo.GetIdValue to assure that the ID returned is unique
|
||||
/// <summary>
|
||||
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
|
||||
/// </summary>
|
||||
/// <returns>A Unique ID for the current AnnotationAuditInfo</returns>
|
||||
protected override object GetIdValue() => MyAnnotationAuditInfoUnique; // Absolutely Unique ID
|
||||
#endregion
|
||||
#region Factory Methods
|
||||
private static int _AnnotationAuditInfoUnique = 0;
|
||||
private static int AnnotationAuditInfoUnique
|
||||
{ get { return ++_AnnotationAuditInfoUnique; } }
|
||||
private int _MyAnnotationAuditInfoUnique = AnnotationAuditInfoUnique;
|
||||
public int MyAnnotationAuditInfoUnique // Absolutely Unique ID - Info
|
||||
{ get { return _MyAnnotationAuditInfoUnique; } }
|
||||
private static int AnnotationAuditInfoUnique => ++_AnnotationAuditInfoUnique;
|
||||
private readonly int _MyAnnotationAuditInfoUnique = AnnotationAuditInfoUnique;
|
||||
// Absolutely Unique ID - Info
|
||||
public int MyAnnotationAuditInfoUnique => _MyAnnotationAuditInfoUnique;
|
||||
protected AnnotationAuditInfo()
|
||||
{/* require use of factory methods */
|
||||
AddToCache(this);
|
||||
}
|
||||
private bool _Disposed = false;
|
||||
private bool _Disposed = false;
|
||||
private static int _CountCreated = 0;
|
||||
private static int _CountDisposed = 0;
|
||||
private static int _CountFinalized = 0;
|
||||
private static int IncrementCountCreated
|
||||
{ get { return ++_CountCreated; } }
|
||||
private int _CountWhenCreated = IncrementCountCreated;
|
||||
public static int CountCreated
|
||||
{ get { return _CountCreated; } }
|
||||
public static int CountNotDisposed
|
||||
{ get { return _CountCreated - _CountDisposed; } }
|
||||
public static int CountNotFinalized
|
||||
{ get { return _CountCreated - _CountFinalized; } }
|
||||
~AnnotationAuditInfo()
|
||||
private static int IncrementCountCreated => ++_CountCreated;
|
||||
private readonly int _CountWhenCreated = IncrementCountCreated;
|
||||
public static int CountCreated => _CountCreated;
|
||||
public static int CountNotDisposed => _CountCreated - _CountDisposed;
|
||||
public static int CountNotFinalized => _CountCreated - _CountFinalized;
|
||||
~AnnotationAuditInfo()
|
||||
{
|
||||
_CountFinalized++;
|
||||
}
|
||||
@@ -267,8 +234,6 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public static AnnotationAuditInfo Get(long auditID)
|
||||
{
|
||||
//if (!CanGetObject())
|
||||
// throw new System.Security.SecurityException("User not authorized to view a AnnotationAudit");
|
||||
try
|
||||
{
|
||||
AnnotationAuditInfo tmp = GetCachedByPrimaryKey(auditID);
|
||||
@@ -307,14 +272,10 @@ namespace VEPROMS.CSLA.Library
|
||||
[Serializable()]
|
||||
protected class PKCriteria
|
||||
{
|
||||
private long _AuditID;
|
||||
public long AuditID
|
||||
{ get { return _AuditID; } }
|
||||
public PKCriteria(long auditID)
|
||||
{
|
||||
_AuditID = auditID;
|
||||
}
|
||||
}
|
||||
private readonly long _AuditID;
|
||||
public long AuditID => _AuditID;
|
||||
public PKCriteria(long auditID) => _AuditID = auditID;
|
||||
}
|
||||
private void ReadData(SafeDataReader dr)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.ReadData", GetHashCode());
|
||||
@@ -374,10 +335,10 @@ namespace VEPROMS.CSLA.Library
|
||||
throw new DbCslaException("AnnotationAuditInfo.DataPortal_Fetch", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
// Standard Refresh
|
||||
#region extension
|
||||
AnnotationAuditInfoExtension _AnnotationAuditInfoExtension = new AnnotationAuditInfoExtension();
|
||||
#endregion
|
||||
// Standard Refresh
|
||||
#region extension
|
||||
readonly AnnotationAuditInfoExtension _AnnotationAuditInfoExtension = new AnnotationAuditInfoExtension();
|
||||
[Serializable()]
|
||||
partial class AnnotationAuditInfoExtension : extensionBase { }
|
||||
[Serializable()]
|
||||
@@ -393,10 +354,10 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
|
||||
{
|
||||
if (destType == typeof(string) && value is AnnotationAuditInfo)
|
||||
if (destType == typeof(string) && value is AnnotationAuditInfo info)
|
||||
{
|
||||
// Return the ToString value
|
||||
return ((AnnotationAuditInfo)value).ToString();
|
||||
return info.ToString();
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user