This commit is contained in:
@@ -41,7 +41,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
foreach (ConnectionFolder tmp in _ConnectionFolders)
|
||||
{
|
||||
if(tmp.IsDirty)refreshConnectionFolders.Add(tmp);
|
||||
if (tmp.IsDirty) refreshConnectionFolders.Add(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,15 +65,20 @@ namespace VEPROMS.CSLA.Library
|
||||
#endregion
|
||||
#region Collection
|
||||
protected static List<Connection> _AllList = new List<Connection>();
|
||||
private static Dictionary<string, Connection> _AllByPrimaryKey = new Dictionary<string, Connection>();
|
||||
private static Dictionary<string, Connection> _AllByName = new Dictionary<string, Connection>();
|
||||
private static Dictionary<string, List<Connection>> _AllByPrimaryKey = new Dictionary<string, List<Connection>>();
|
||||
private static Dictionary<string, List<Connection>> _AllByName = new Dictionary<string, List<Connection>>();
|
||||
private static void ConvertListToDictionary()
|
||||
{
|
||||
List<Connection> remove = new List<Connection>();
|
||||
foreach (Connection tmp in _AllList)
|
||||
{
|
||||
_AllByPrimaryKey[tmp.DBID.ToString()]=tmp; // Primary Key
|
||||
_AllByName[tmp.Name.ToString()] = tmp; // Unique Index
|
||||
if (!_AllByPrimaryKey.ContainsKey(tmp.DBID.ToString()))
|
||||
{
|
||||
_AllByPrimaryKey[tmp.DBID.ToString()] = new List<Connection>(); // Add new list for PrimaryKey
|
||||
_AllByName[tmp.Name.ToString()] = new List<Connection>(); // Add new list for Name
|
||||
}
|
||||
_AllByPrimaryKey[tmp.DBID.ToString()].Add(tmp); // Add to Primary Key list
|
||||
_AllByName[tmp.Name.ToString()].Add(tmp); // Unique Index
|
||||
remove.Add(tmp);
|
||||
}
|
||||
foreach (Connection tmp in remove)
|
||||
@@ -83,14 +88,14 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
ConvertListToDictionary();
|
||||
string key = dbid.ToString();
|
||||
if (_AllByPrimaryKey.ContainsKey(key)) return _AllByPrimaryKey[key];
|
||||
if (_AllByPrimaryKey.ContainsKey(key)) return _AllByPrimaryKey[key][0];
|
||||
return null;
|
||||
}
|
||||
public static Connection 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
|
||||
@@ -112,7 +117,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("DBID",true);
|
||||
CanReadProperty("DBID", true);
|
||||
return _DBID;
|
||||
}
|
||||
}
|
||||
@@ -122,13 +127,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)
|
||||
{
|
||||
@@ -143,13 +148,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)
|
||||
{
|
||||
@@ -164,13 +169,13 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("ConnectionString",true);
|
||||
CanReadProperty("ConnectionString", true);
|
||||
return _ConnectionString;
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
set
|
||||
{
|
||||
CanWriteProperty("ConnectionString",true);
|
||||
CanWriteProperty("ConnectionString", true);
|
||||
if (value == null) value = string.Empty;
|
||||
if (_ConnectionString != value)
|
||||
{
|
||||
@@ -188,13 +193,13 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("ServerType",true);
|
||||
CanReadProperty("ServerType", true);
|
||||
return _ServerType;
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
set
|
||||
{
|
||||
CanWriteProperty("ServerType",true);
|
||||
CanWriteProperty("ServerType", true);
|
||||
if (_ServerType != value)
|
||||
{
|
||||
_ServerType = value;
|
||||
@@ -208,13 +213,13 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("Config",true);
|
||||
CanReadProperty("Config", true);
|
||||
return _Config;
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
set
|
||||
{
|
||||
CanWriteProperty("Config",true);
|
||||
CanWriteProperty("Config", true);
|
||||
if (value == null) value = string.Empty;
|
||||
if (_Config != value)
|
||||
{
|
||||
@@ -229,13 +234,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;
|
||||
@@ -249,13 +254,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)
|
||||
{
|
||||
@@ -274,7 +279,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("ConnectionFolderCount",true);
|
||||
CanReadProperty("ConnectionFolderCount", true);
|
||||
return _ConnectionFolderCount;
|
||||
}
|
||||
}
|
||||
@@ -288,21 +293,21 @@ namespace VEPROMS.CSLA.Library
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
get
|
||||
{
|
||||
CanReadProperty("ConnectionFolders",true);
|
||||
if(_ConnectionFolderCount > 0 && _ConnectionFolders == null)
|
||||
CanReadProperty("ConnectionFolders", true);
|
||||
if (_ConnectionFolderCount > 0 && _ConnectionFolders == null)
|
||||
_ConnectionFolders = ConnectionFolders.GetByDBID(DBID);
|
||||
else if(_ConnectionFolders == null)
|
||||
else if (_ConnectionFolders == null)
|
||||
_ConnectionFolders = ConnectionFolders.New();
|
||||
return _ConnectionFolders;
|
||||
}
|
||||
}
|
||||
public override bool IsDirty
|
||||
{
|
||||
get { return base.IsDirty || (_ConnectionFolders == null? false : _ConnectionFolders.IsDirty); }
|
||||
get { return base.IsDirty || (_ConnectionFolders == null ? false : _ConnectionFolders.IsDirty); }
|
||||
}
|
||||
public override bool IsValid
|
||||
{
|
||||
get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ConnectionFolders == null? true : _ConnectionFolders.IsValid); }
|
||||
get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ConnectionFolders == null ? true : _ConnectionFolders.IsValid); }
|
||||
}
|
||||
// TODO: Replace base Connection.ToString function as necessary
|
||||
/// <summary>
|
||||
@@ -325,22 +330,23 @@ 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 (_ConnectionFolders != null && (hasBrokenRules = _ConnectionFolders.HasBrokenRules) != null) return hasBrokenRules;
|
||||
if (_ConnectionFolders != null && (hasBrokenRules = _ConnectionFolders.HasBrokenRules) != null) return hasBrokenRules;
|
||||
return hasBrokenRules;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_CheckingBrokenRules=false;
|
||||
_CheckingBrokenRules = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -462,15 +468,29 @@ namespace VEPROMS.CSLA.Library
|
||||
#region Factory Methods
|
||||
public int CurrentEditLevel
|
||||
{ get { return EditLevel; } }
|
||||
private static int _ConnectionUnique = 0;
|
||||
private int _MyConnectionUnique;
|
||||
public int MyConnectionUnique
|
||||
{
|
||||
get { return _MyConnectionUnique; }
|
||||
}
|
||||
protected Connection()
|
||||
{/* require use of factory methods */
|
||||
_MyConnectionUnique = ++_ConnectionUnique;
|
||||
_AllList.Add(this);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
_AllList.Remove(this);
|
||||
_AllByPrimaryKey.Remove(DBID.ToString());
|
||||
_AllByName.Remove(Name.ToString());
|
||||
if (!_AllByPrimaryKey.ContainsKey(DBID.ToString())) return;
|
||||
List<Connection> listConnection = _AllByPrimaryKey[DBID.ToString()]; // Get the list of items
|
||||
listConnection.Remove(this); // Remove the item from the list
|
||||
if (listConnection.Count == 0) //If there are no items left in the list
|
||||
_AllByPrimaryKey.Remove(DBID.ToString()); // remove the list
|
||||
listConnection = _AllByName[DBID.ToString()]; // Get the list of items
|
||||
listConnection.Remove(this); // Remove the item from the list
|
||||
if (listConnection.Count == 0) //If there are no items left in the list
|
||||
_AllByName.Remove(DBID.ToString()); // remove the list
|
||||
}
|
||||
public static Connection New()
|
||||
{
|
||||
@@ -548,7 +568,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (tmp == null)
|
||||
{
|
||||
tmp = DataPortal.Fetch<Connection>(new PKCriteria(dbid));
|
||||
_AllList.Add(tmp);
|
||||
if (!_AllList.Contains(tmp)) _AllList.Add(tmp);
|
||||
}
|
||||
if (tmp.ErrorMessage == "No Record Found") tmp = null;
|
||||
return tmp;
|
||||
@@ -567,8 +587,8 @@ namespace VEPROMS.CSLA.Library
|
||||
Connection tmp = GetExistingByName(name);
|
||||
if (tmp == null)
|
||||
{
|
||||
tmp=DataPortal.Fetch<Connection>(new NameCriteria(name));
|
||||
_AllList.Add(tmp);
|
||||
tmp = DataPortal.Fetch<Connection>(new NameCriteria(name));
|
||||
if (!_AllList.Contains(tmp)) _AllList.Add(tmp);
|
||||
}
|
||||
if (tmp.ErrorMessage == "No Record Found") tmp = null;
|
||||
return tmp;
|
||||
@@ -659,7 +679,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
private void ReadData(SafeDataReader dr)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.ReadData", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.ReadData", GetHashCode());
|
||||
try
|
||||
{
|
||||
_DBID = dr.GetInt32("DBID");
|
||||
@@ -676,14 +696,14 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.ReadData", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.ReadData", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Connection.ReadData", ex);
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(PKCriteria criteria)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.DataPortal_Fetch", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Fetch", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -714,14 +734,14 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.DataPortal_Fetch", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Fetch", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Connection.DataPortal_Fetch", ex);
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(NameCriteria criteria)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.DataPortal_Fetch", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Fetch", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -749,7 +769,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.DataPortal_Fetch", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Fetch", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Connection.DataPortal_Fetch", ex);
|
||||
}
|
||||
@@ -770,13 +790,13 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.DataPortal_Insert", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Insert", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Connection.DataPortal_Insert", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.DataPortal_Insert", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Insert", GetHashCode());
|
||||
}
|
||||
}
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
@@ -814,11 +834,11 @@ namespace VEPROMS.CSLA.Library
|
||||
MarkOld();
|
||||
// update child objects
|
||||
if (_ConnectionFolders != null) _ConnectionFolders.Update(this);
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.SQLInsert", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.SQLInsert", GetHashCode());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.SQLInsert", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.SQLInsert", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Connection.SQLInsert", ex);
|
||||
}
|
||||
@@ -826,7 +846,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
public static byte[] Add(SqlConnection cn, ref int dbid, string name, string title, string connectionString, int serverType, string config, DateTime dts, string usrID)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.Add", 0);
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.Add", 0);
|
||||
try
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -857,7 +877,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.Add", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.Add", ex);
|
||||
throw new DbCslaException("Connection.Add", ex);
|
||||
}
|
||||
}
|
||||
@@ -865,7 +885,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}] Connection.DataPortal_Update", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Update", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -879,7 +899,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.DataPortal_Update", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Update", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
if (!ex.Message.EndsWith("has been edited by another user.")) throw ex;
|
||||
}
|
||||
@@ -888,7 +908,7 @@ namespace VEPROMS.CSLA.Library
|
||||
internal void SQLUpdate()
|
||||
{
|
||||
if (!IsDirty) return; // If not dirty - nothing to do
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.SQLUpdate", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.SQLUpdate", GetHashCode());
|
||||
try
|
||||
{
|
||||
SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];
|
||||
@@ -924,7 +944,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.SQLUpdate", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.SQLUpdate", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
if (!ex.Message.EndsWith("has been edited by another user.")) throw ex;
|
||||
}
|
||||
@@ -946,7 +966,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
public static byte[] Update(SqlConnection cn, ref int dbid, string name, string title, string connectionString, int serverType, string config, DateTime dts, string usrID, ref byte[] lastChanged)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.Update", 0);
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.Update", 0);
|
||||
try
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -975,7 +995,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.Update", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.Update", ex);
|
||||
throw new DbCslaException("Connection.Update", ex);
|
||||
}
|
||||
}
|
||||
@@ -987,7 +1007,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
private void DataPortal_Delete(PKCriteria criteria)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.DataPortal_Delete", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Delete", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -1003,7 +1023,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.DataPortal_Delete", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Delete", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Connection.DataPortal_Delete", ex);
|
||||
}
|
||||
@@ -1011,7 +1031,7 @@ namespace VEPROMS.CSLA.Library
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
public static void Remove(SqlConnection cn, int dbid)
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.Remove", 0);
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.Remove", 0);
|
||||
try
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -1026,7 +1046,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.Remove", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.Remove", ex);
|
||||
throw new DbCslaException("Connection.Remove", ex);
|
||||
}
|
||||
}
|
||||
@@ -1060,7 +1080,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
protected override void DataPortal_Execute()
|
||||
{
|
||||
if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("[{0}] Connection.DataPortal_Execute", GetHashCode());
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Execute", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -1078,7 +1098,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if(_MyLog.IsErrorEnabled)_MyLog.Error("Connection.DataPortal_Execute", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Execute", ex);
|
||||
throw new DbCslaException("Connection.DataPortal_Execute", ex);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user