This commit is contained in:
@@ -42,14 +42,14 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
foreach (RoleAssignment tmp in _RoleAssignments)
|
||||
{
|
||||
if(tmp.IsDirty)refreshRoleAssignments.Add(tmp);
|
||||
if (tmp.IsDirty) refreshRoleAssignments.Add(tmp);
|
||||
}
|
||||
}
|
||||
if (_RolePermissions != null && _RolePermissions.IsDirty)
|
||||
{
|
||||
foreach (RolePermission tmp in _RolePermissions)
|
||||
{
|
||||
if(tmp.IsDirty)refreshRolePermissions.Add(tmp);
|
||||
if (tmp.IsDirty) refreshRolePermissions.Add(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,15 +78,20 @@ namespace VEPROMS.CSLA.Library
|
||||
#endregion
|
||||
#region Collection
|
||||
protected static List<Role> _AllList = new List<Role>();
|
||||
private static Dictionary<string, Role> _AllByPrimaryKey = new Dictionary<string, Role>();
|
||||
private static Dictionary<string, Role> _AllByName = new Dictionary<string, Role>();
|
||||
private static Dictionary<string, List<Role>> _AllByPrimaryKey = new Dictionary<string, List<Role>>();
|
||||
private static Dictionary<string, List<Role>> _AllByName = new Dictionary<string, List<Role>>();
|
||||
private static void ConvertListToDictionary()
|
||||
{
|
||||
List<Role> remove = new List<Role>();
|
||||
foreach (Role tmp in _AllList)
|
||||
{
|
||||
_AllByPrimaryKey[tmp.RID.ToString()]=tmp; // Primary Key
|
||||
_AllByName[tmp.Name.ToString()] = tmp; // Unique Index
|
||||
if (!_AllByPrimaryKey.ContainsKey(tmp.RID.ToString()))
|
||||
{
|
||||
_AllByPrimaryKey[tmp.RID.ToString()] = new List<Role>(); // Add new list for PrimaryKey
|
||||
_AllByName[tmp.Name.ToString()] = new List<Role>(); // Add new list for Name
|
||||
}
|
||||
_AllByPrimaryKey[tmp.RID.ToString()].Add(tmp); // Add to Primary Key list
|
||||
_AllByName[tmp.Name.ToString()].Add(tmp); // Unique Index
|
||||
remove.Add(tmp);
|
||||
}
|
||||
foreach (Role tmp in remove)
|
||||
@@ -96,14 +101,14 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
ConvertListToDictionary();
|
||||
string key = rid.ToString();
|
||||
if (_AllByPrimaryKey.ContainsKey(key)) return _AllByPrimaryKey[key];
|
||||
if (_AllByPrimaryKey.ContainsKey(key)) return _AllByPrimaryKey[key][0];
|
||||
return null;
|
||||
}
|
||||
public static Role GetExistingByName(string name)
|
||||
{
|
||||
ConvertListToDictionary();
|
||||
string key = name.ToString();
|
||||
if (_AllByName.ContainsKey(key)) return _AllByName[key];
|
||||
if (_AllByName.ContainsKey(key)) return _AllByName[key][0];
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
@@ -125,7 +130,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("RID",true);
|
||||
CanReadProperty("RID", true);
|
||||
return _RID;
|
||||
}
|
||||
}
|
||||
@@ -135,13 +140,13 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("Name",true);
|
||||
CanReadProperty("Name", true);
|
||||
return _Name;
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
set
|
||||
{
|
||||
CanWriteProperty("Name",true);
|
||||
CanWriteProperty("Name", true);
|
||||
if (value == null) value = string.Empty;
|
||||
if (_Name != value)
|
||||
{
|
||||
@@ -156,13 +161,13 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("Title",true);
|
||||
CanReadProperty("Title", true);
|
||||
return _Title;
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
set
|
||||
{
|
||||
CanWriteProperty("Title",true);
|
||||
CanWriteProperty("Title", true);
|
||||
if (value == null) value = string.Empty;
|
||||
if (_Title != value)
|
||||
{
|
||||
@@ -177,13 +182,13 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("DTS",true);
|
||||
CanReadProperty("DTS", true);
|
||||
return _DTS;
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
set
|
||||
{
|
||||
CanWriteProperty("DTS",true);
|
||||
CanWriteProperty("DTS", true);
|
||||
if (_DTS != value)
|
||||
{
|
||||
_DTS = value;
|
||||
@@ -197,13 +202,13 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("UsrID",true);
|
||||
CanReadProperty("UsrID", true);
|
||||
return _UsrID;
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
set
|
||||
{
|
||||
CanWriteProperty("UsrID",true);
|
||||
CanWriteProperty("UsrID", true);
|
||||
if (value == null) value = string.Empty;
|
||||
if (_UsrID != value)
|
||||
{
|
||||
@@ -222,7 +227,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("RoleAssignmentCount",true);
|
||||
CanReadProperty("RoleAssignmentCount", true);
|
||||
return _RoleAssignmentCount;
|
||||
}
|
||||
}
|
||||
@@ -236,10 +241,10 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("RoleAssignments",true);
|
||||
if(_RoleAssignmentCount > 0 && _RoleAssignments == null)
|
||||
CanReadProperty("RoleAssignments", true);
|
||||
if (_RoleAssignmentCount > 0 && _RoleAssignments == null)
|
||||
_RoleAssignments = RoleAssignments.GetByRID(RID);
|
||||
else if(_RoleAssignments == null)
|
||||
else if (_RoleAssignments == null)
|
||||
_RoleAssignments = RoleAssignments.New();
|
||||
return _RoleAssignments;
|
||||
}
|
||||
@@ -253,7 +258,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("RolePermissionCount",true);
|
||||
CanReadProperty("RolePermissionCount", true);
|
||||
return _RolePermissionCount;
|
||||
}
|
||||
}
|
||||
@@ -267,21 +272,21 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("RolePermissions",true);
|
||||
if(_RolePermissionCount > 0 && _RolePermissions == null)
|
||||
CanReadProperty("RolePermissions", true);
|
||||
if (_RolePermissionCount > 0 && _RolePermissions == null)
|
||||
_RolePermissions = RolePermissions.GetByRID(RID);
|
||||
else if(_RolePermissions == null)
|
||||
else if (_RolePermissions == null)
|
||||
_RolePermissions = RolePermissions.New();
|
||||
return _RolePermissions;
|
||||
}
|
||||
}
|
||||
public override bool IsDirty
|
||||
{
|
||||
get { return base.IsDirty || (_RoleAssignments == null? false : _RoleAssignments.IsDirty) || (_RolePermissions == null? false : _RolePermissions.IsDirty); }
|
||||
get { return base.IsDirty || (_RoleAssignments == null ? false : _RoleAssignments.IsDirty) || (_RolePermissions == null ? false : _RolePermissions.IsDirty); }
|
||||
}
|
||||
public override bool IsValid
|
||||
{
|
||||
get { return (IsNew && !IsDirty ? true : base.IsValid) && (_RoleAssignments == null? true : _RoleAssignments.IsValid) && (_RolePermissions == null? true : _RolePermissions.IsValid); }
|
||||
get { return (IsNew && !IsDirty ? true : base.IsValid) && (_RoleAssignments == null ? true : _RoleAssignments.IsValid) && (_RolePermissions == null ? true : _RolePermissions.IsValid); }
|
||||
}
|
||||
// TODO: Replace base Role.ToString function as necessary
|
||||
/// <summary>
|
||||
@@ -304,23 +309,24 @@ namespace VEPROMS.CSLA.Library
|
||||
#endregion
|
||||
#region ValidationRules
|
||||
[NonSerialized]
|
||||
private bool _CheckingBrokenRules=false;
|
||||
private bool _CheckingBrokenRules = false;
|
||||
public IVEHasBrokenRules HasBrokenRules
|
||||
{
|
||||
get {
|
||||
if(_CheckingBrokenRules)return null;
|
||||
get
|
||||
{
|
||||
if (_CheckingBrokenRules) return null;
|
||||
if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this;
|
||||
try
|
||||
{
|
||||
_CheckingBrokenRules=true;
|
||||
_CheckingBrokenRules = true;
|
||||
IVEHasBrokenRules hasBrokenRules = null;
|
||||
if (_RoleAssignments != null && (hasBrokenRules = _RoleAssignments.HasBrokenRules) != null) return hasBrokenRules;
|
||||
if (_RolePermissions != null && (hasBrokenRules = _RolePermissions.HasBrokenRules) != null) return hasBrokenRules;
|
||||
if (_RoleAssignments != null && (hasBrokenRules = _RoleAssignments.HasBrokenRules) != null) return hasBrokenRules;
|
||||
if (_RolePermissions != null && (hasBrokenRules = _RolePermissions.HasBrokenRules) != null) return hasBrokenRules;
|
||||
return hasBrokenRules;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_CheckingBrokenRules=false;
|
||||
_CheckingBrokenRules = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,15 +441,29 @@ namespace VEPROMS.CSLA.Library
|
||||
#region Factory Methods
|
||||
public int CurrentEditLevel
|
||||
{ get { return EditLevel; } }
|
||||
private static int _RoleUnique = 0;
|
||||
private int _MyRoleUnique;
|
||||
public int MyRoleUnique
|
||||
{
|
||||
get { return _MyRoleUnique; }
|
||||
}
|
||||
protected Role()
|
||||
{/* require use of factory methods */
|
||||
_MyRoleUnique = ++_RoleUnique;
|
||||
_AllList.Add(this);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_AllList.Remove(this);
|
||||
_AllByPrimaryKey.Remove(RID.ToString());
|
||||
_AllByName.Remove(Name.ToString());
|
||||
if (!_AllByPrimaryKey.ContainsKey(RID.ToString())) return;
|
||||
List<Role> listRole = _AllByPrimaryKey[RID.ToString()]; // Get the list of items
|
||||
listRole.Remove(this); // Remove the item from the list
|
||||
if (listRole.Count == 0) //If there are no items left in the list
|
||||
_AllByPrimaryKey.Remove(RID.ToString()); // remove the list
|
||||
listRole = _AllByName[RID.ToString()]; // Get the list of items
|
||||
listRole.Remove(this); // Remove the item from the list
|
||||
if (listRole.Count == 0) //If there are no items left in the list
|
||||
_AllByName.Remove(RID.ToString()); // remove the list
|
||||
}
|
||||
public static Role New()
|
||||
{
|
||||
@@ -500,7 +520,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (tmp == null)
|
||||
{
|
||||
tmp = DataPortal.Fetch<Role>(new PKCriteria(rid));
|
||||
_AllList.Add(tmp);
|
||||
if (!_AllList.Contains(tmp)) _AllList.Add(tmp);
|
||||
}
|
||||
if (tmp.ErrorMessage == "No Record Found") tmp = null;
|
||||
return tmp;
|
||||
@@ -519,8 +539,8 @@ namespace VEPROMS.CSLA.Library
|
||||
Role tmp = GetExistingByName(name);
|
||||
if (tmp == null)
|
||||
{
|
||||
tmp=DataPortal.Fetch<Role>(new NameCriteria(name));
|
||||
_AllList.Add(tmp);
|
||||
tmp = DataPortal.Fetch<Role>(new NameCriteria(name));
|
||||
if (!_AllList.Contains(tmp)) _AllList.Add(tmp);
|
||||
}
|
||||
if (tmp.ErrorMessage == "No Record Found") tmp = null;
|
||||
return tmp;
|
||||
@@ -610,7 +630,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
private void ReadData(SafeDataReader dr)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.ReadData", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.ReadData", GetHashCode());
|
||||
try
|
||||
{
|
||||
_RID = dr.GetInt32("RID");
|
||||
@@ -625,14 +645,14 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.ReadData", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.ReadData", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Role.ReadData", ex);
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(PKCriteria criteria)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.DataPortal_Fetch", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Fetch", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -666,14 +686,14 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.DataPortal_Fetch", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Fetch", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Role.DataPortal_Fetch", ex);
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(NameCriteria criteria)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.DataPortal_Fetch", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Fetch", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -701,7 +721,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.DataPortal_Fetch", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Fetch", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Role.DataPortal_Fetch", ex);
|
||||
}
|
||||
@@ -722,13 +742,13 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.DataPortal_Insert", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Insert", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Role.DataPortal_Insert", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.DataPortal_Insert", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Insert", GetHashCode());
|
||||
}
|
||||
}
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
@@ -764,11 +784,11 @@ namespace VEPROMS.CSLA.Library
|
||||
// update child objects
|
||||
if (_RoleAssignments != null) _RoleAssignments.Update(this);
|
||||
if (_RolePermissions != null) _RolePermissions.Update(this);
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.SQLInsert", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.SQLInsert", GetHashCode());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.SQLInsert", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.SQLInsert", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Role.SQLInsert", ex);
|
||||
}
|
||||
@@ -776,7 +796,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
public static byte[] Add(SqlConnection cn, ref int rid, string name, string title, DateTime dts, string usrID)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.Add", 0);
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.Add", 0);
|
||||
try
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -804,7 +824,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.Add", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.Add", ex);
|
||||
throw new DbCslaException("Role.Add", ex);
|
||||
}
|
||||
}
|
||||
@@ -812,7 +832,7 @@ namespace VEPROMS.CSLA.Library
|
||||
protected override void DataPortal_Update()
|
||||
{
|
||||
if (!IsDirty) return; // If not dirty - nothing to do
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.DataPortal_Update", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Update", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -826,7 +846,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.DataPortal_Update", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Update", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
if (!ex.Message.EndsWith("has been edited by another user.")) throw ex;
|
||||
}
|
||||
@@ -835,7 +855,7 @@ namespace VEPROMS.CSLA.Library
|
||||
internal void SQLUpdate()
|
||||
{
|
||||
if (!IsDirty) return; // If not dirty - nothing to do
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.SQLUpdate", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.SQLUpdate", GetHashCode());
|
||||
try
|
||||
{
|
||||
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
|
||||
@@ -869,7 +889,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.SQLUpdate", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.SQLUpdate", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
if (!ex.Message.EndsWith("has been edited by another user.")) throw ex;
|
||||
}
|
||||
@@ -892,7 +912,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
public static byte[] Update(SqlConnection cn, ref int rid, string name, string title, DateTime dts, string usrID, ref byte[] lastChanged)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.Update", 0);
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.Update", 0);
|
||||
try
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -918,7 +938,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.Update", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.Update", ex);
|
||||
throw new DbCslaException("Role.Update", ex);
|
||||
}
|
||||
}
|
||||
@@ -930,7 +950,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
private void DataPortal_Delete(PKCriteria criteria)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.DataPortal_Delete", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Delete", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -946,7 +966,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.DataPortal_Delete", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Delete", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Role.DataPortal_Delete", ex);
|
||||
}
|
||||
@@ -954,7 +974,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
public static void Remove(SqlConnection cn, int rid)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.Remove", 0);
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.Remove", 0);
|
||||
try
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -969,7 +989,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.Remove", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.Remove", ex);
|
||||
throw new DbCslaException("Role.Remove", ex);
|
||||
}
|
||||
}
|
||||
@@ -1003,7 +1023,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
protected override void DataPortal_Execute()
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Role.DataPortal_Execute", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Execute", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -1021,7 +1041,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Role.DataPortal_Execute", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Execute", ex);
|
||||
throw new DbCslaException("Role.DataPortal_Execute", ex);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user