/// <summary> /// Delete items. /// </summary> private void DeleteActivities(IWhereCondition whereCondition) { var activitiesToDelete = ActivityInfoProvider.GetActivities() .Columns("ActivityID", "ActivityType", "ActivityTitle") .Where(whereCondition); foreach (var activity in activitiesToDelete) { LogContext.AppendLine(string.Format("{0} - {1}", activity.ActivityTitle, activity.ActivityType)); ActivityInfoProvider.DeleteActivityInfo(activity); } }
/// <summary> /// Delete items. /// </summary> private void DeleteActivities(IWhereCondition whereCondition) { var activitiesToDelete = ActivityInfoProvider.GetActivities() .Columns("ActivityID", "ActivityType", "ActivityTitle") .Where(whereCondition); foreach (var activity in activitiesToDelete) { var safeLog = HTMLHelper.HTMLEncode(string.Format("{0} - {1}", activity.ActivityTitle, activity.ActivityType)); AddLog(safeLog); ActivityInfoProvider.DeleteActivityInfo(activity); } }
/// <summary> /// Delete items. /// </summary> private void DeleteItems(string whereCondition) { DataSet ds = GetData(whereCondition, "ActivityID", "ActivityID, ActivityType, ActivityTitle"); if (!DataHelper.DataSourceIsEmpty(ds)) { foreach (DataRow dr in ds.Tables[0].Rows) { string activityTitle = ValidationHelper.GetString(dr["ActivityTitle"], null); string activityType = ValidationHelper.GetString(dr["ActivityType"], null); int activityId = ValidationHelper.GetInteger(dr["ActivityID"], 0); LogContext.AppendLine(activityTitle + " - " + activityType); ActivityInfoProvider.DeleteActivityInfo(activityId); } } }