This commit is contained in:
@@ -163,6 +163,28 @@ namespace VEPROMS.CSLA.Library
|
||||
return _UserID;
|
||||
}
|
||||
}
|
||||
private int _RODbID;
|
||||
public int RODbID
|
||||
{
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("RODbID", true);
|
||||
if (_MyRODb != null) _RODbID = _MyRODb.RODbID;
|
||||
return _RODbID;
|
||||
}
|
||||
}
|
||||
private RODbInfo _MyRODb;
|
||||
public RODbInfo MyRODb
|
||||
{
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("MyRODb", true);
|
||||
if (_MyRODb == null && _RODbID != 0) _MyRODb = RODbInfo.Get(_RODbID);
|
||||
return _MyRODb;
|
||||
}
|
||||
}
|
||||
// TODO: Replace base RoUsageInfo.ToString function as necessary
|
||||
/// <summary>
|
||||
/// Overrides Base ToString
|
||||
@@ -227,12 +249,24 @@ namespace VEPROMS.CSLA.Library
|
||||
_Config = tmp.Config;
|
||||
_DTS = tmp.DTS;
|
||||
_UserID = tmp.UserID;
|
||||
if (_RODbID != tmp.RODbID)
|
||||
{
|
||||
if (MyRODb != null) MyRODb.RefreshRODbRoUsages(); // Update List for old value
|
||||
_RODbID = tmp.RODbID; // Update the value
|
||||
}
|
||||
_MyRODb = null; // Reset list so that the next line gets a new list
|
||||
if (MyRODb != null) MyRODb.RefreshRODbRoUsages(); // Update List for new value
|
||||
_RoUsageInfoExtension.Refresh(this);
|
||||
if(_MyContent != null)
|
||||
{
|
||||
_MyContent.Dispose();// Dispose related value
|
||||
_MyContent = null;// Reset related value
|
||||
}
|
||||
if(_MyRODb != null)
|
||||
{
|
||||
_MyRODb.Dispose();// Dispose related value
|
||||
_MyRODb = null;// Reset related value
|
||||
}
|
||||
OnChange();// raise an event
|
||||
}
|
||||
public static void Refresh(ContentRoUsage tmp)
|
||||
@@ -249,12 +283,58 @@ namespace VEPROMS.CSLA.Library
|
||||
_Config = tmp.Config;
|
||||
_DTS = tmp.DTS;
|
||||
_UserID = tmp.UserID;
|
||||
if (_RODbID != tmp.RODbID)
|
||||
{
|
||||
if (MyRODb != null) MyRODb.RefreshRODbRoUsages(); // Update List for old value
|
||||
_RODbID = tmp.RODbID; // Update the value
|
||||
}
|
||||
_MyRODb = null; // Reset list so that the next line gets a new list
|
||||
if (MyRODb != null) MyRODb.RefreshRODbRoUsages(); // Update List for new value
|
||||
_RoUsageInfoExtension.Refresh(this);
|
||||
if(_MyContent != null)
|
||||
{
|
||||
_MyContent.Dispose();// Dispose related value
|
||||
_MyContent = null;// Reset related value
|
||||
}
|
||||
if(_MyRODb != null)
|
||||
{
|
||||
_MyRODb.Dispose();// Dispose related value
|
||||
_MyRODb = null;// Reset related value
|
||||
}
|
||||
OnChange();// raise an event
|
||||
}
|
||||
public static void Refresh(RODbRoUsage tmp)
|
||||
{
|
||||
string key = tmp.ROUsageID.ToString();
|
||||
ConvertListToDictionary();
|
||||
if (_CacheByPrimaryKey.ContainsKey(key))
|
||||
foreach (RoUsageInfo tmpInfo in _CacheByPrimaryKey[key])
|
||||
tmpInfo.RefreshFields(tmp);
|
||||
}
|
||||
protected virtual void RefreshFields(RODbRoUsage tmp)
|
||||
{
|
||||
if (_ContentID != tmp.ContentID)
|
||||
{
|
||||
if (MyContent != null) MyContent.RefreshContentRoUsages(); // Update List for old value
|
||||
_ContentID = tmp.ContentID; // Update the value
|
||||
}
|
||||
_MyContent = null; // Reset list so that the next line gets a new list
|
||||
if (MyContent != null) MyContent.RefreshContentRoUsages(); // Update List for new value
|
||||
_ROID = tmp.ROID;
|
||||
_Config = tmp.Config;
|
||||
_DTS = tmp.DTS;
|
||||
_UserID = tmp.UserID;
|
||||
_RoUsageInfoExtension.Refresh(this);
|
||||
if(_MyContent != null)
|
||||
{
|
||||
_MyContent.Dispose();// Dispose related value
|
||||
_MyContent = null;// Reset related value
|
||||
}
|
||||
if(_MyRODb != null)
|
||||
{
|
||||
_MyRODb.Dispose();// Dispose related value
|
||||
_MyRODb = null;// Reset related value
|
||||
}
|
||||
OnChange();// raise an event
|
||||
}
|
||||
public static RoUsageInfo Get(int rOUsageID)
|
||||
@@ -318,6 +398,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_Config = dr.GetString("Config");
|
||||
_DTS = dr.GetDateTime("DTS");
|
||||
_UserID = dr.GetString("UserID");
|
||||
_RODbID = dr.GetInt32("RODbID");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Reference in New Issue
Block a user