/// <summary> /// Deletes the item. /// </summary> /// <param name="type">The type.</param> /// <param name="path">The path.</param> /// <param name="folderName">Name of the folder.</param> /// <returns></returns> public bool DeleteItem(ItemTypeEnum type, string path, string folderName) { path = path.Substring(path.Length - 1, 1) == @"\" ? path.Substring(0, path.Length - 1).Replace(@"\", @"/") : path.Replace(@"\", @"/"); bool resVal = false; if (CheckItemExist(type, path, folderName)) { _reportsServerInstance2005.DeleteItem(path + "/" + folderName); resVal = true; } return(resVal); }
/// <summary> /// Checks the item exist. /// </summary> /// <param name="type">The type.</param> /// <param name="path">The path.</param> /// <param name="folderName">Name of the folder.</param> /// <returns></returns> public bool CheckItemExist(ItemTypeEnum type, string path, string folderName) { var conditions = new SearchCondition[1]; conditions[0] = new SearchCondition { Condition = ConditionEnum.Contains, ConditionSpecified = true, Name = "Name", Value = folderName }; _returnedItems = _reportsServerInstance2005.FindItems(path, BooleanOperatorEnum.Or, conditions); return((_returnedItems.Where(item => item.Type == type)).Any(item => item.Path == path + "/" + folderName)); }