Improve ROFst Update Performance

Add RoFstLookup Dicitonary Entries for Multiple Return Values
AddByROFstIDImageIDs - Add a list of figures based upon a List of ImageIDs
Fix regular expression to find RO Text to replace
GetDROUsagesByROIDs - get a list of ROUSages for a list of ROIDs
GetJustRODB - Get Just RODB object without children
GetJustROFst - Get Just ROFst or ROFstInfo object without children
Reduce duplicate gets of RODB and ROFst
Improve ROFst Update Performance
GetByRODbIDNoData - Get RoImageInfo objects without graphic data for ROFst Update comparison
GetROUSagesByROIDs - Get a list of ROUSages by ROIDs.  This reduces the number of ROIDs to be checked when updating ROFst.
Use GetJustRoFst and GetJustRoDB to improve the performance to see if the "Update ROFst" button should be active.
This commit is contained in:
Rich
2011-07-18 14:57:47 +00:00
parent 248c1679bc
commit be814b9743
9 changed files with 652 additions and 85 deletions

View File

@@ -106,5 +106,64 @@ namespace VEPROMS.CSLA.Library
}
this.RaiseListChangedEvents = true;
}
[Serializable()]
private class GetDROUsagesByROIDsCriteria
{
public GetDROUsagesByROIDsCriteria(string roids)
{
_ROIDs = roids;
}
private string _ROIDs;
public string ROIDs
{
get { return _ROIDs; }
set { _ROIDs = value; }
}
}
public static DROUsageInfoList GetDROUsagesByROIDs(string roids)
{
try
{
DROUsageInfoList tmp = DataPortal.Fetch<DROUsageInfoList>(new GetDROUsagesByROIDsCriteria(roids));
DROUsageInfo.AddList(tmp);
tmp.AddEvents();
return tmp;
}
catch (Exception ex)
{
throw new DbCslaException("Error on DROUsageInfoList.GetAffected", ex);
}
}
private void DataPortal_Fetch(GetDROUsagesByROIDsCriteria criteria)
{
this.RaiseListChangedEvents = false;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfoList.DataPortal_FetchByROIDs", GetHashCode());
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "getDRoUsagesByROIDs";
cm.Parameters.AddWithValue("@ROIDs", criteria.ROIDs);
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
{
IsReadOnly = false;
while (dr.Read())
this.Add(new DROUsageInfo(dr));
IsReadOnly = true;
}
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfoList.DataPortal_FetchByROIDs", ex);
throw new DbCslaException("DROUsageInfoList.DataPortal_FetchByROIDs", ex);
}
this.RaiseListChangedEvents = true;
}
}
}