Modified vesp_SessionBegin to delete inactive owner records and inactive session records for current user after 5 minutes of inactivity and for all other users after 15 minutes of inactivity during start of new session.

Added new stored procedure getOwnersByVersionID.
Added method to OwnerInfoList class named GetByVersionID
Utilized OwnerInfoList.GetByVersionID method
This commit is contained in:
Rich
2014-05-30 01:13:55 +00:00
parent 67638b51bd
commit 9e059a37f5
3 changed files with 108 additions and 5 deletions

View File

@@ -535,7 +535,51 @@ namespace VEPROMS.CSLA.Library
}
this.RaiseListChangedEvents = true;
}
}
public static OwnerInfoList GetByVersionID(int versionID)
{
OwnerInfoList tmp = DataPortal.Fetch<OwnerInfoList>(new GetByVersionIDCriteria(versionID));
return tmp;
}
[Serializable()]
protected class GetByVersionIDCriteria
{
private int _VersionID;
public int VersionID { get { return _VersionID; } }
public GetByVersionIDCriteria(int versionID)
{
_VersionID = versionID;
}
}
private void DataPortal_Fetch(GetByVersionIDCriteria criteria)
{
this.RaiseListChangedEvents = false;
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfoList.DataPortal_Fetch", GetHashCode());
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "getOwnersByVersionID";
cm.Parameters.AddWithValue("@VersionID", criteria.VersionID);
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
{
IsReadOnly = false;
while (dr.Read()) this.Add(new OwnerInfo(dr));
IsReadOnly = true;
}
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex);
throw new DbCslaException("OwberInfoList.DataPortal_Fetch", ex);
}
this.RaiseListChangedEvents = true;
}
}
public partial class OwnerInfo
{
public static OwnerInfo GetBySessionIDandVersionID(int sessionID, int versionID)