Added code to support conversion to text of invalid referenced objects and invalid transitions
Added command line switch NOUPDATERO to prevent updating referenced objects Added code to support conversion to text of invalid transitions
This commit is contained in:
@@ -468,6 +468,124 @@ namespace VEPROMS.CSLA.Library
|
||||
this.RaiseListChangedEvents = true;
|
||||
}
|
||||
#endregion
|
||||
#region TransitionsToDisconnected
|
||||
private class TransitionsToDisconnectedCriteria
|
||||
{
|
||||
public TransitionsToDisconnectedCriteria(string docVersionList)
|
||||
{
|
||||
_DocVersionList = docVersionList;
|
||||
}
|
||||
private string _DocVersionList;
|
||||
public string DocVersionList
|
||||
{
|
||||
get { return _DocVersionList; }
|
||||
set { _DocVersionList = value; }
|
||||
}
|
||||
}
|
||||
public static TransitionInfoList GetTransitionsToDisconnected(string docVersionList)
|
||||
{
|
||||
try
|
||||
{
|
||||
TransitionInfoList tmp = DataPortal.Fetch<TransitionInfoList>(new TransitionsToDisconnectedCriteria(docVersionList));
|
||||
TransitionInfo.AddList(tmp);
|
||||
tmp.AddEvents();
|
||||
return tmp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on TransitionInfoList.GetTransitionsToDisconnected", ex);
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(TransitionsToDisconnectedCriteria criteria)
|
||||
{
|
||||
this.RaiseListChangedEvents = false;
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_FetchTransitionsToDisconnected", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getTransitionsToDisconnected";
|
||||
cm.Parameters.AddWithValue("@DocVersionList", criteria.DocVersionList);
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
IsReadOnly = false;
|
||||
while (dr.Read()) this.Add(new TransitionInfo(dr));
|
||||
IsReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_FetchTransitionsToDisconnected", ex);
|
||||
throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex);
|
||||
}
|
||||
this.RaiseListChangedEvents = true;
|
||||
}
|
||||
#endregion
|
||||
#region TransitionsToNonEditable
|
||||
private class TransitionsToNonEditableCriteria
|
||||
{
|
||||
public TransitionsToNonEditableCriteria(string docVersionList)
|
||||
{
|
||||
_DocVersionList = docVersionList;
|
||||
}
|
||||
private string _DocVersionList;
|
||||
public string DocVersionList
|
||||
{
|
||||
get { return _DocVersionList; }
|
||||
set { _DocVersionList = value; }
|
||||
}
|
||||
}
|
||||
public static TransitionInfoList GetTransitionsToNonEditable(string docVersionList)
|
||||
{
|
||||
try
|
||||
{
|
||||
TransitionInfoList tmp = DataPortal.Fetch<TransitionInfoList>(new TransitionsToNonEditableCriteria(docVersionList));
|
||||
TransitionInfo.AddList(tmp);
|
||||
tmp.AddEvents();
|
||||
return tmp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on TransitionInfoList.GetTransitionsToNonEditable", ex);
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(TransitionsToNonEditableCriteria criteria)
|
||||
{
|
||||
this.RaiseListChangedEvents = false;
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_FetchTransitionsToNonEditable", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getTransitionsToNonEditable";
|
||||
cm.Parameters.AddWithValue("@DocVersionList", criteria.DocVersionList);
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
IsReadOnly = false;
|
||||
while (dr.Read()) this.Add(new TransitionInfo(dr));
|
||||
IsReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_FetchTransitionsToNonEditable", ex);
|
||||
throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex);
|
||||
}
|
||||
this.RaiseListChangedEvents = true;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class TransitionBuilder
|
||||
{
|
||||
@@ -672,6 +790,8 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
if(_AppendMethods==null)
|
||||
SetupMethods();
|
||||
if (toItem.MyDocVersion == null)
|
||||
return "?";
|
||||
string retval = BuildString(tb);
|
||||
// Added for transitions to un-numbered steps
|
||||
if (retval == string.Empty)
|
||||
|
Reference in New Issue
Block a user