Enhanced: CSLA interface for Unlinking enhanced
This commit is contained in:
parent
fea63966fb
commit
973180d8d6
@ -1134,5 +1134,64 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
#region Enhanced_Unlink
|
||||||
|
[Serializable()]
|
||||||
|
private class EnhancedUnlinkCriteria
|
||||||
|
{
|
||||||
|
public EnhancedUnlinkCriteria(int? enhancedID)
|
||||||
|
{
|
||||||
|
_EnhancedID = enhancedID;
|
||||||
|
}
|
||||||
|
private int? _EnhancedID;
|
||||||
|
public int? EnhancedID
|
||||||
|
{
|
||||||
|
get { return _EnhancedID; }
|
||||||
|
set { _EnhancedID = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void DataPortal_Fetch(EnhancedUnlinkCriteria criteria)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
{
|
||||||
|
cm.CommandType = CommandType.StoredProcedure;
|
||||||
|
cm.CommandText = "vesp_PurgeEnhancedItemsAndChildren";
|
||||||
|
cm.Parameters.AddWithValue("@EnhanceID", criteria.EnhancedID); // note query had 'EnhanceID', not 'EnhancedID'
|
||||||
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
|
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||||
|
{
|
||||||
|
IsReadOnly = false;
|
||||||
|
while (dr.Read())
|
||||||
|
{
|
||||||
|
ContentInfo contentInfo = new ContentInfo(dr);
|
||||||
|
this.Add(contentInfo);
|
||||||
|
}
|
||||||
|
IsReadOnly = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Database.LogException("EnhancedUnlinkCriteria.DataPortal_Fetch", ex);
|
||||||
|
throw new DbCslaException("EnhancedUnlinkCriteria.DataPortal_Fetch", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static ContentInfoList DoEnhancedUnlink(int enhancedID)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ContentInfoList tmp = DataPortal.Fetch<ContentInfoList>(new EnhancedUnlinkCriteria(enhancedID));
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new DbCslaException("Error on ContentInfoList.DoEnhancedUnlink", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion Enhanced_Unlink
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user