/// <summary> /// Gets the customization item. /// </summary> /// <param name="fullId">The full id.</param> /// <param name="profileId">The profile id.</param> /// <returns></returns> private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId) { return GetCustomizationItem(fullId, structureType, commandType, profileId, null); }
/// <summary> /// Gets the customization item. /// </summary> /// <param name="fullId">The full id.</param> /// <param name="profileId">The profile id.</param> /// <param name="principalId">The principal id.</param> /// <returns></returns> private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId, PrimaryKeyId? principalId) { CustomizationItemEntity result = null; FilterElementCollection filters = new FilterElementCollection(); filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldXmlFullId, fullId)); filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldStructureType, (int)structureType)); filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldCommandType, (int)commandType)); // Filter by profile if (profileId.HasValue) filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldProfileId, profileId.Value)); else filters.Add(FilterElement.IsNullElement(CustomizationItemEntity.FieldProfileId)); // Filter by principal if (principalId.HasValue) filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldPrincipalId, principalId.Value)); else filters.Add(FilterElement.IsNullElement(CustomizationItemEntity.FieldPrincipalId)); EntityObject[] items = BusinessManager.List(CustomizationItemEntity.ClassName, filters.ToArray()); if (items != null && items.Length > 0) { result = items[0] as CustomizationItemEntity; } return result; }
/// <summary> /// Creates the navigation item by parent. /// </summary> /// <param name="structureType">Type of the structure.</param> /// <param name="parentFullId">The parent full id.</param> /// <param name="commandType">Type of the command.</param> /// <param name="profileId">The profile id.</param> /// <param name="principalId">The principal id.</param> /// <returns></returns> private static CustomizationItemEntity CreateCustomizationItemByParent(string parentFullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId, PrimaryKeyId? principalId) { string fullId = string.Concat(parentFullId, "/", Guid.NewGuid().ToString("D")); return CreateCustomizationItem(fullId, structureType, commandType, profileId, principalId); }
/// <summary> /// Gets the customization item. /// </summary> /// <param name="fullId">The full id.</param> /// <returns></returns> private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType) { return GetCustomizationItem(fullId, structureType, commandType, null, null); }
/// <summary> /// Gets the customization item arguments. /// </summary> /// <param name="fullId">The full id.</param> /// <param name="structureType">Type of the structure.</param> /// <param name="commandType">Type of the command.</param> /// <param name="profileId">The profile id.</param> /// <param name="principalId">The principal id.</param> /// <returns></returns> public static Dictionary<string, CustomizationItemArgumentEntity> GetCustomizationItemArguments(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId, PrimaryKeyId? principalId) { CustomizationItemEntity item = GetCustomizationItem(fullId, structureType, commandType, profileId, principalId); if (item != null && item.PrimaryKeyId.HasValue) { return GetCustomizationItemArguments(item.PrimaryKeyId.Value); } return null; }
/// <summary> /// Creates the navigation item. /// </summary> /// <param name="structureType">Type of the structure.</param> /// <param name="fullId">The full id.</param> /// <param name="commandType">Type of the command.</param> /// <param name="profileId">The profile id.</param> /// <param name="principalId">The principal id.</param> /// <returns></returns> private static CustomizationItemEntity CreateCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId, PrimaryKeyId? principalId) { CustomizationItemEntity item = BusinessManager.InitializeEntity<CustomizationItemEntity>(CustomizationItemEntity.ClassName); if (structureType != CustomizationStructureType.Undefined) { item.StructureType = (int)structureType; } item.XmlFullId = fullId; if (profileId.HasValue) item.Properties["ProfileId"].Value = profileId; if (principalId.HasValue) item.Properties["PrincipalId"].Value = principalId; item.CommandType = (int)commandType; item.PrimaryKeyId = BusinessManager.Create(item); return item; }
/// <summary> /// Gets the customization item arguments. /// </summary> /// <param name="fullId">The full id.</param> /// <param name="structureType">Type of the structure.</param> /// <param name="commandType">Type of the command.</param> /// <returns></returns> public static Dictionary<string, CustomizationItemArgumentEntity> GetCustomizationItemArguments(string fullId, CustomizationStructureType structureType, ItemCommandType commandType) { return GetCustomizationItemArguments(fullId, structureType, commandType, null, null); }
/// <summary> /// Gets the customization item arguments. /// </summary> /// <param name="fullId">The full id.</param> /// <param name="structureType">Type of the structure.</param> /// <param name="commandType">Type of the command.</param> /// <param name="profileId">The profile id.</param> /// <returns></returns> public static Dictionary<string, CustomizationItemArgumentEntity> GetCustomizationItemArguments(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId) { return GetCustomizationItemArguments(fullId, structureType, commandType, profileId, null); }
/// <summary> /// Gets the customization item. /// </summary> /// <param name="fullId">The full id.</param> /// <param name="profileId">The profile id.</param> /// <returns></returns> private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId) { return(GetCustomizationItem(fullId, structureType, commandType, profileId, null)); }
/// <summary> /// Gets the customization item. /// </summary> /// <param name="fullId">The full id.</param> /// <param name="profileId">The profile id.</param> /// <param name="principalId">The principal id.</param> /// <returns></returns> private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId, PrimaryKeyId?principalId) { CustomizationItemEntity result = null; FilterElementCollection filters = new FilterElementCollection(); filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldXmlFullId, fullId)); filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldStructureType, (int)structureType)); filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldCommandType, (int)commandType)); // Filter by profile if (profileId.HasValue) { filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldProfileId, profileId.Value)); } else { filters.Add(FilterElement.IsNullElement(CustomizationItemEntity.FieldProfileId)); } // Filter by principal if (principalId.HasValue) { filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldPrincipalId, principalId.Value)); } else { filters.Add(FilterElement.IsNullElement(CustomizationItemEntity.FieldPrincipalId)); } EntityObject[] items = BusinessManager.List(CustomizationItemEntity.ClassName, filters.ToArray()); if (items != null && items.Length > 0) { result = items[0] as CustomizationItemEntity; } return(result); }
/// <summary> /// Gets the customization item. /// </summary> /// <param name="fullId">The full id.</param> /// <returns></returns> private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType) { return(GetCustomizationItem(fullId, structureType, commandType, null, null)); }
/// <summary> /// Creates the navigation item. /// </summary> /// <param name="structureType">Type of the structure.</param> /// <param name="fullId">The full id.</param> /// <param name="commandType">Type of the command.</param> /// <param name="profileId">The profile id.</param> /// <param name="principalId">The principal id.</param> /// <returns></returns> private static CustomizationItemEntity CreateCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId, PrimaryKeyId?principalId) { CustomizationItemEntity item = BusinessManager.InitializeEntity <CustomizationItemEntity>(CustomizationItemEntity.ClassName); if (structureType != CustomizationStructureType.Undefined) { item.StructureType = (int)structureType; } item.XmlFullId = fullId; if (profileId.HasValue) { item.Properties["ProfileId"].Value = profileId; } if (principalId.HasValue) { item.Properties["PrincipalId"].Value = principalId; } item.CommandType = (int)commandType; item.PrimaryKeyId = BusinessManager.Create(item); return(item); }
// ------------------- Private methods ------------------- #region CreateCustomizationItemByParent(string parentFullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId, PrimaryKeyId? principalId) /// <summary> /// Creates the navigation item by parent. /// </summary> /// <param name="structureType">Type of the structure.</param> /// <param name="parentFullId">The parent full id.</param> /// <param name="commandType">Type of the command.</param> /// <param name="profileId">The profile id.</param> /// <param name="principalId">The principal id.</param> /// <returns></returns> private static CustomizationItemEntity CreateCustomizationItemByParent(string parentFullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId, PrimaryKeyId?principalId) { string fullId = string.Concat(parentFullId, "/", Guid.NewGuid().ToString("D")); return(CreateCustomizationItem(fullId, structureType, commandType, profileId, principalId)); }
/// <summary> /// Gets the customization item arguments. /// </summary> /// <param name="fullId">The full id.</param> /// <param name="structureType">Type of the structure.</param> /// <param name="commandType">Type of the command.</param> /// <param name="profileId">The profile id.</param> /// <param name="principalId">The principal id.</param> /// <returns></returns> public static Dictionary <string, CustomizationItemArgumentEntity> GetCustomizationItemArguments(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId, PrimaryKeyId?principalId) { CustomizationItemEntity item = GetCustomizationItem(fullId, structureType, commandType, profileId, principalId); if (item != null && item.PrimaryKeyId.HasValue) { return(GetCustomizationItemArguments(item.PrimaryKeyId.Value)); } return(null); }
/// <summary> /// Gets the customization item arguments. /// </summary> /// <param name="fullId">The full id.</param> /// <param name="structureType">Type of the structure.</param> /// <param name="commandType">Type of the command.</param> /// <param name="profileId">The profile id.</param> /// <returns></returns> public static Dictionary <string, CustomizationItemArgumentEntity> GetCustomizationItemArguments(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId) { return(GetCustomizationItemArguments(fullId, structureType, commandType, profileId, null)); }