Added getDRoUsagesByROIDsAndVersions and getRoUsagesByROIDsAndVersions to speed-up RO Value Update process.
Added logic to speed up RO Value Update Process. Added logic to keep SvgImages from failing if the ImagePath is null.
This commit is contained in:
@@ -174,6 +174,73 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
this.RaiseListChangedEvents = true;
|
||||
}
|
||||
[Serializable]
|
||||
private class GetROUsagesByROIDsAndVersionsCriteria
|
||||
{
|
||||
public GetROUsagesByROIDsAndVersionsCriteria(string roids, string versions)
|
||||
{
|
||||
_ROIDS = roids;
|
||||
_Versions = versions;
|
||||
}
|
||||
private string _ROIDS;
|
||||
public string ROIDS
|
||||
{
|
||||
get { return _ROIDS; }
|
||||
set { _ROIDS = value; }
|
||||
}
|
||||
private string _Versions;
|
||||
public string Versions
|
||||
{
|
||||
get { return _Versions; }
|
||||
set { _Versions = value; }
|
||||
}
|
||||
}
|
||||
public static RoUsageInfoList GetROUSagesByROIDsAndVersions(string roids,string versions)
|
||||
{
|
||||
try
|
||||
{
|
||||
RoUsageInfoList tmp = DataPortal.Fetch<RoUsageInfoList>(new GetROUsagesByROIDsAndVersionsCriteria(roids,versions));
|
||||
RoUsageInfo.AddList(tmp);
|
||||
tmp.AddEvents();
|
||||
return tmp;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on ROUsageInfoList.FindROUSagesByROIDs", ex);
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(GetROUsagesByROIDsAndVersionsCriteria criteria)
|
||||
{
|
||||
this.RaiseListChangedEvents = false;
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROUsageInfoList.DataPortal_FetchFindByRoids", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getRoUsagesByRoidsAndVersions";
|
||||
cm.Parameters.AddWithValue("@ROIDS", criteria.ROIDS);
|
||||
cm.Parameters.AddWithValue("@Versions", criteria.Versions);
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
IsReadOnly = false;
|
||||
while (dr.Read())
|
||||
this.Add(new RoUsageInfo(dr));
|
||||
IsReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("ROUsageInfoList.DataPortal_FetchFindByRoidsAndVersions", ex);
|
||||
throw new DbCslaException("ROUsageInfoList.DataPortal_Fetch", ex);
|
||||
}
|
||||
this.RaiseListChangedEvents = true;
|
||||
}
|
||||
}
|
||||
public partial class RoUsageInfo
|
||||
{
|
||||
|
Reference in New Issue
Block a user