This commit is contained in:
parent
89679e57f1
commit
e8c3a7347a
@ -207,6 +207,29 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private int _IsRange;
|
||||||
|
/// <summary>
|
||||||
|
/// 0 - Not a Range Transition, 1 - Range Transition, 2 - Range Transition - Extends to last Sibling
|
||||||
|
/// </summary>
|
||||||
|
public int IsRange
|
||||||
|
{
|
||||||
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||||
|
get
|
||||||
|
{
|
||||||
|
CanReadProperty("IsRange", true);
|
||||||
|
return _IsRange;
|
||||||
|
}
|
||||||
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||||
|
set
|
||||||
|
{
|
||||||
|
CanWriteProperty("IsRange", true);
|
||||||
|
if (_IsRange != value)
|
||||||
|
{
|
||||||
|
_IsRange = value;
|
||||||
|
PropertyHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
private int _TranType;
|
private int _TranType;
|
||||||
public int TranType
|
public int TranType
|
||||||
{
|
{
|
||||||
@ -467,6 +490,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
//AuthorizationRules.AllowRead(FromID, "<Role(s)>");
|
//AuthorizationRules.AllowRead(FromID, "<Role(s)>");
|
||||||
//AuthorizationRules.AllowRead(ToID, "<Role(s)>");
|
//AuthorizationRules.AllowRead(ToID, "<Role(s)>");
|
||||||
//AuthorizationRules.AllowRead(RangeID, "<Role(s)>");
|
//AuthorizationRules.AllowRead(RangeID, "<Role(s)>");
|
||||||
|
//AuthorizationRules.AllowRead(IsRange, "<Role(s)>");
|
||||||
//AuthorizationRules.AllowRead(TranType, "<Role(s)>");
|
//AuthorizationRules.AllowRead(TranType, "<Role(s)>");
|
||||||
//AuthorizationRules.AllowRead(Config, "<Role(s)>");
|
//AuthorizationRules.AllowRead(Config, "<Role(s)>");
|
||||||
//AuthorizationRules.AllowRead(DTS, "<Role(s)>");
|
//AuthorizationRules.AllowRead(DTS, "<Role(s)>");
|
||||||
@ -474,6 +498,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
//AuthorizationRules.AllowWrite(FromID, "<Role(s)>");
|
//AuthorizationRules.AllowWrite(FromID, "<Role(s)>");
|
||||||
//AuthorizationRules.AllowWrite(ToID, "<Role(s)>");
|
//AuthorizationRules.AllowWrite(ToID, "<Role(s)>");
|
||||||
//AuthorizationRules.AllowWrite(RangeID, "<Role(s)>");
|
//AuthorizationRules.AllowWrite(RangeID, "<Role(s)>");
|
||||||
|
//AuthorizationRules.AllowWrite(IsRange, "<Role(s)>");
|
||||||
//AuthorizationRules.AllowWrite(TranType, "<Role(s)>");
|
//AuthorizationRules.AllowWrite(TranType, "<Role(s)>");
|
||||||
//AuthorizationRules.AllowWrite(Config, "<Role(s)>");
|
//AuthorizationRules.AllowWrite(Config, "<Role(s)>");
|
||||||
//AuthorizationRules.AllowWrite(DTS, "<Role(s)>");
|
//AuthorizationRules.AllowWrite(DTS, "<Role(s)>");
|
||||||
@ -574,21 +599,22 @@ namespace VEPROMS.CSLA.Library
|
|||||||
tmp.MyItemRangeID = myItemRangeID;
|
tmp.MyItemRangeID = myItemRangeID;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
public static Transition New(Content myContent, Item myItemToID, Item myItemRangeID, int tranType, string config, DateTime dts, string userID)
|
public static Transition New(Content myContent, Item myItemToID, Item myItemRangeID, int isRange, int tranType, string config, DateTime dts, string userID)
|
||||||
{
|
{
|
||||||
Transition tmp = Transition.New();
|
Transition tmp = Transition.New();
|
||||||
tmp.MyContent = myContent;
|
tmp.MyContent = myContent;
|
||||||
tmp.MyItemToID = myItemToID;
|
tmp.MyItemToID = myItemToID;
|
||||||
tmp.MyItemRangeID = myItemRangeID;
|
tmp.MyItemRangeID = myItemRangeID;
|
||||||
|
tmp.IsRange = isRange;
|
||||||
tmp.TranType = tranType;
|
tmp.TranType = tranType;
|
||||||
tmp.Config = config;
|
tmp.Config = config;
|
||||||
tmp.DTS = dts;
|
tmp.DTS = dts;
|
||||||
tmp.UserID = userID;
|
tmp.UserID = userID;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
public static Transition MakeTransition(Content myContent, Item myItemToID, Item myItemRangeID, int tranType, string config, DateTime dts, string userID)
|
public static Transition MakeTransition(Content myContent, Item myItemToID, Item myItemRangeID, int isRange, int tranType, string config, DateTime dts, string userID)
|
||||||
{
|
{
|
||||||
Transition tmp = Transition.New(myContent, myItemToID, myItemRangeID, tranType, config, dts, userID);
|
Transition tmp = Transition.New(myContent, myItemToID, myItemRangeID, isRange, tranType, config, dts, userID);
|
||||||
if (tmp.IsSavable)
|
if (tmp.IsSavable)
|
||||||
{
|
{
|
||||||
Transition tmp2 = tmp;
|
Transition tmp2 = tmp;
|
||||||
@ -722,6 +748,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
_TransitionID = NextTransitionID;
|
_TransitionID = NextTransitionID;
|
||||||
// Database Defaults
|
// Database Defaults
|
||||||
|
_IsRange = _TransitionExtension.DefaultIsRange;
|
||||||
_TranType = _TransitionExtension.DefaultTranType;
|
_TranType = _TransitionExtension.DefaultTranType;
|
||||||
_DTS = _TransitionExtension.DefaultDTS;
|
_DTS = _TransitionExtension.DefaultDTS;
|
||||||
_UserID = _TransitionExtension.DefaultUserID;
|
_UserID = _TransitionExtension.DefaultUserID;
|
||||||
@ -737,6 +764,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_FromID = dr.GetInt32("FromID");
|
_FromID = dr.GetInt32("FromID");
|
||||||
_ToID = dr.GetInt32("ToID");
|
_ToID = dr.GetInt32("ToID");
|
||||||
_RangeID = dr.GetInt32("RangeID");
|
_RangeID = dr.GetInt32("RangeID");
|
||||||
|
_IsRange = dr.GetInt32("IsRange");
|
||||||
_TranType = dr.GetInt32("TranType");
|
_TranType = dr.GetInt32("TranType");
|
||||||
_Config = dr.GetString("Config");
|
_Config = dr.GetString("Config");
|
||||||
_DTS = dr.GetDateTime("DTS");
|
_DTS = dr.GetDateTime("DTS");
|
||||||
@ -833,6 +861,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cm.Parameters.AddWithValue("@FromID", FromID);
|
cm.Parameters.AddWithValue("@FromID", FromID);
|
||||||
cm.Parameters.AddWithValue("@ToID", ToID);
|
cm.Parameters.AddWithValue("@ToID", ToID);
|
||||||
cm.Parameters.AddWithValue("@RangeID", RangeID);
|
cm.Parameters.AddWithValue("@RangeID", RangeID);
|
||||||
|
cm.Parameters.AddWithValue("@IsRange", _IsRange);
|
||||||
cm.Parameters.AddWithValue("@TranType", _TranType);
|
cm.Parameters.AddWithValue("@TranType", _TranType);
|
||||||
cm.Parameters.AddWithValue("@Config", _Config);
|
cm.Parameters.AddWithValue("@Config", _Config);
|
||||||
if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS);
|
if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS);
|
||||||
@ -863,7 +892,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
[Transactional(TransactionalTypes.TransactionScope)]
|
[Transactional(TransactionalTypes.TransactionScope)]
|
||||||
public static byte[] Add(SqlConnection cn, ref int transitionID, Content myContent, Item myItemToID, Item myItemRangeID, int tranType, string config, DateTime dts, string userID)
|
public static byte[] Add(SqlConnection cn, ref int transitionID, Content myContent, Item myItemToID, Item myItemRangeID, int isRange, int tranType, string config, DateTime dts, string userID)
|
||||||
{
|
{
|
||||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.Add", 0);
|
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.Add", 0);
|
||||||
try
|
try
|
||||||
@ -876,6 +905,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cm.Parameters.AddWithValue("@FromID", myContent.ContentID);
|
cm.Parameters.AddWithValue("@FromID", myContent.ContentID);
|
||||||
cm.Parameters.AddWithValue("@ToID", myItemToID.ItemID);
|
cm.Parameters.AddWithValue("@ToID", myItemToID.ItemID);
|
||||||
cm.Parameters.AddWithValue("@RangeID", myItemRangeID.ItemID);
|
cm.Parameters.AddWithValue("@RangeID", myItemRangeID.ItemID);
|
||||||
|
cm.Parameters.AddWithValue("@IsRange", isRange);
|
||||||
cm.Parameters.AddWithValue("@TranType", tranType);
|
cm.Parameters.AddWithValue("@TranType", tranType);
|
||||||
cm.Parameters.AddWithValue("@Config", config);
|
cm.Parameters.AddWithValue("@Config", config);
|
||||||
if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts);
|
if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts);
|
||||||
@ -945,6 +975,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cm.Parameters.AddWithValue("@FromID", FromID);
|
cm.Parameters.AddWithValue("@FromID", FromID);
|
||||||
cm.Parameters.AddWithValue("@ToID", ToID);
|
cm.Parameters.AddWithValue("@ToID", ToID);
|
||||||
cm.Parameters.AddWithValue("@RangeID", RangeID);
|
cm.Parameters.AddWithValue("@RangeID", RangeID);
|
||||||
|
cm.Parameters.AddWithValue("@IsRange", _IsRange);
|
||||||
cm.Parameters.AddWithValue("@TranType", _TranType);
|
cm.Parameters.AddWithValue("@TranType", _TranType);
|
||||||
cm.Parameters.AddWithValue("@Config", _Config);
|
cm.Parameters.AddWithValue("@Config", _Config);
|
||||||
if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS);
|
if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS);
|
||||||
@ -978,15 +1009,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
|
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
|
||||||
if (IsNew)
|
if (IsNew)
|
||||||
_LastChanged = Transition.Add(cn, ref _TransitionID, _MyContent, _MyItemToID, _MyItemRangeID, _TranType, _Config, _DTS, _UserID);
|
_LastChanged = Transition.Add(cn, ref _TransitionID, _MyContent, _MyItemToID, _MyItemRangeID, _IsRange, _TranType, _Config, _DTS, _UserID);
|
||||||
else
|
else
|
||||||
_LastChanged = Transition.Update(cn, ref _TransitionID, _MyContent, _MyItemToID, _MyItemRangeID, _TranType, _Config, _DTS, _UserID, ref _LastChanged);
|
_LastChanged = Transition.Update(cn, ref _TransitionID, _MyContent, _MyItemToID, _MyItemRangeID, _IsRange, _TranType, _Config, _DTS, _UserID, ref _LastChanged);
|
||||||
MarkOld();
|
MarkOld();
|
||||||
}
|
}
|
||||||
if (_MyZTransition != null) _MyZTransition.Update(this);
|
if (_MyZTransition != null) _MyZTransition.Update(this);
|
||||||
}
|
}
|
||||||
[Transactional(TransactionalTypes.TransactionScope)]
|
[Transactional(TransactionalTypes.TransactionScope)]
|
||||||
public static byte[] Update(SqlConnection cn, ref int transitionID, Content myContent, Item myItemToID, Item myItemRangeID, int tranType, string config, DateTime dts, string userID, ref byte[] lastChanged)
|
public static byte[] Update(SqlConnection cn, ref int transitionID, Content myContent, Item myItemToID, Item myItemRangeID, int isRange, int tranType, string config, DateTime dts, string userID, ref byte[] lastChanged)
|
||||||
{
|
{
|
||||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.Update", 0);
|
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.Update", 0);
|
||||||
try
|
try
|
||||||
@ -1000,6 +1031,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cm.Parameters.AddWithValue("@FromID", myContent.ContentID);
|
cm.Parameters.AddWithValue("@FromID", myContent.ContentID);
|
||||||
cm.Parameters.AddWithValue("@ToID", myItemToID.ItemID);
|
cm.Parameters.AddWithValue("@ToID", myItemToID.ItemID);
|
||||||
cm.Parameters.AddWithValue("@RangeID", myItemRangeID.ItemID);
|
cm.Parameters.AddWithValue("@RangeID", myItemRangeID.ItemID);
|
||||||
|
cm.Parameters.AddWithValue("@IsRange", isRange);
|
||||||
cm.Parameters.AddWithValue("@TranType", tranType);
|
cm.Parameters.AddWithValue("@TranType", tranType);
|
||||||
cm.Parameters.AddWithValue("@Config", config);
|
cm.Parameters.AddWithValue("@Config", config);
|
||||||
if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts);
|
if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts);
|
||||||
@ -1137,6 +1169,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
class extensionBase
|
class extensionBase
|
||||||
{
|
{
|
||||||
// Default Values
|
// Default Values
|
||||||
|
public virtual int DefaultIsRange
|
||||||
|
{
|
||||||
|
get { return 0; }
|
||||||
|
}
|
||||||
public virtual int DefaultTranType
|
public virtual int DefaultTranType
|
||||||
{
|
{
|
||||||
get { return 0; }
|
get { return 0; }
|
||||||
@ -1202,6 +1238,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// partial class TransitionExtension : extensionBase
|
// partial class TransitionExtension : extensionBase
|
||||||
// {
|
// {
|
||||||
// // CSLATODO: Override automatic defaults
|
// // CSLATODO: Override automatic defaults
|
||||||
|
// public virtual int DefaultIsRange
|
||||||
|
// {
|
||||||
|
// get { return 0; }
|
||||||
|
// }
|
||||||
// public virtual int DefaultTranType
|
// public virtual int DefaultTranType
|
||||||
// {
|
// {
|
||||||
// get { return 0; }
|
// get { return 0; }
|
||||||
|
@ -169,6 +169,19 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return _MyItemRangeID;
|
return _MyItemRangeID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private int _IsRange;
|
||||||
|
/// <summary>
|
||||||
|
/// 0 - Not a Range Transition, 1 - Range Transition, 2 - Range Transition - Extends to last Sibling
|
||||||
|
/// </summary>
|
||||||
|
public int IsRange
|
||||||
|
{
|
||||||
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||||
|
get
|
||||||
|
{
|
||||||
|
CanReadProperty("IsRange", true);
|
||||||
|
return _IsRange;
|
||||||
|
}
|
||||||
|
}
|
||||||
private int _TranType;
|
private int _TranType;
|
||||||
public int TranType
|
public int TranType
|
||||||
{
|
{
|
||||||
@ -312,6 +325,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
_MyItemRangeID = null; // Reset list so that the next line gets a new list
|
_MyItemRangeID = null; // Reset list so that the next line gets a new list
|
||||||
if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for new value
|
if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for new value
|
||||||
|
_IsRange = tmp.IsRange;
|
||||||
_TranType = tmp.TranType;
|
_TranType = tmp.TranType;
|
||||||
_Config = tmp.Config;
|
_Config = tmp.Config;
|
||||||
_DTS = tmp.DTS;
|
_DTS = tmp.DTS;
|
||||||
@ -376,6 +390,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
_MyItemRangeID = null; // Reset list so that the next line gets a new list
|
_MyItemRangeID = null; // Reset list so that the next line gets a new list
|
||||||
if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for new value
|
if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for new value
|
||||||
|
_IsRange = tmp.IsRange;
|
||||||
_TranType = tmp.TranType;
|
_TranType = tmp.TranType;
|
||||||
_Config = tmp.Config;
|
_Config = tmp.Config;
|
||||||
_DTS = tmp.DTS;
|
_DTS = tmp.DTS;
|
||||||
@ -440,6 +455,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
_MyItemToID = null; // Reset list so that the next line gets a new list
|
_MyItemToID = null; // Reset list so that the next line gets a new list
|
||||||
if (MyItemToID != null) MyItemToID.RefreshItemTransitions_ToID(); // Update List for new value
|
if (MyItemToID != null) MyItemToID.RefreshItemTransitions_ToID(); // Update List for new value
|
||||||
|
_IsRange = tmp.IsRange;
|
||||||
_TranType = tmp.TranType;
|
_TranType = tmp.TranType;
|
||||||
_Config = tmp.Config;
|
_Config = tmp.Config;
|
||||||
_DTS = tmp.DTS;
|
_DTS = tmp.DTS;
|
||||||
@ -504,6 +520,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
_MyItemRangeID = null; // Reset list so that the next line gets a new list
|
_MyItemRangeID = null; // Reset list so that the next line gets a new list
|
||||||
if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for new value
|
if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for new value
|
||||||
|
_IsRange = tmp.IsRange;
|
||||||
_TranType = tmp.TranType;
|
_TranType = tmp.TranType;
|
||||||
_Config = tmp.Config;
|
_Config = tmp.Config;
|
||||||
_DTS = tmp.DTS;
|
_DTS = tmp.DTS;
|
||||||
@ -603,6 +620,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_FromID = dr.GetInt32("FromID");
|
_FromID = dr.GetInt32("FromID");
|
||||||
_ToID = dr.GetInt32("ToID");
|
_ToID = dr.GetInt32("ToID");
|
||||||
_RangeID = dr.GetInt32("RangeID");
|
_RangeID = dr.GetInt32("RangeID");
|
||||||
|
_IsRange = dr.GetInt32("IsRange");
|
||||||
_TranType = dr.GetInt32("TranType");
|
_TranType = dr.GetInt32("TranType");
|
||||||
_Config = dr.GetString("Config");
|
_Config = dr.GetString("Config");
|
||||||
_DTS = dr.GetDateTime("DTS");
|
_DTS = dr.GetDateTime("DTS");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user