Added methods to support transition report functionality
This commit is contained in:
@@ -11,6 +11,14 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
public partial class TransitionInfo
|
||||
{
|
||||
//for transition search
|
||||
private int _Level = 0;
|
||||
public int Level
|
||||
{
|
||||
get { return _Level; }
|
||||
set { _Level = value; }
|
||||
}
|
||||
//end for transition search
|
||||
private bool _NewTransToUnNumberedItem = false;
|
||||
public bool NewTransToUnNumberedItem
|
||||
{
|
||||
@@ -144,6 +152,75 @@ namespace VEPROMS.CSLA.Library
|
||||
#region AffectedTransitons
|
||||
public partial class TransitionInfoList
|
||||
{
|
||||
//transition report stuff
|
||||
public static TransitionInfoList GetTransitionReportData(int versionID, int procedureID)
|
||||
{
|
||||
try
|
||||
{
|
||||
TransitionInfoList tmp = DataPortal.Fetch<TransitionInfoList>(new TransitionReportDataCriteria(versionID, procedureID));
|
||||
return tmp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on TransitionInfoList.GetTransitionReportData", ex);
|
||||
}
|
||||
}
|
||||
[Serializable()]
|
||||
protected class TransitionReportDataCriteria
|
||||
{
|
||||
private int _VersionID;
|
||||
public int VersionID
|
||||
{
|
||||
get { return _VersionID; }
|
||||
}
|
||||
private int _ProcedureID;
|
||||
public int ProcedureID
|
||||
{
|
||||
get { return _ProcedureID; }
|
||||
}
|
||||
public TransitionReportDataCriteria(int versionID, int procedureID)
|
||||
{
|
||||
_VersionID = versionID;
|
||||
_ProcedureID = procedureID;
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(TransitionReportDataCriteria criteria)
|
||||
{
|
||||
this.RaiseListChangedEvents = false;
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_Fetch", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "vesp_GetTransitionReportData";
|
||||
cm.Parameters.AddWithValue("@VersionID", criteria.VersionID);
|
||||
cm.Parameters.AddWithValue("@ProcedureID", criteria.ProcedureID);
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
IsReadOnly = false;
|
||||
while (dr.Read())
|
||||
{
|
||||
TransitionInfo ti = new TransitionInfo(dr);
|
||||
ti.Level = dr.GetInt32("level");
|
||||
this.Add(ti);
|
||||
}
|
||||
IsReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_Fetch", ex);
|
||||
throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex);
|
||||
}
|
||||
this.RaiseListChangedEvents = true;
|
||||
}
|
||||
//end transition report stuff
|
||||
[Serializable()]
|
||||
private class AffectedTransitonsCriteria
|
||||
{
|
||||
|
Reference in New Issue
Block a user