//---------------------------------------------------------- public void AddCategories(ItemsModulesOptions ItemsModule, int ParentID, ModuleBaseTypes ModuleBaseType) { //------------------------------------------------------------- InitialCategory.ParentID = ParentID; InitialCategory.ModuleTypeID = ItemsModule.ModuleTypeID; //------------------------------------------------------------- for (int i = 0; i < 3; i++) { if (SiteSettings.Languages_HasArabicLanguages) { InitialCategory.Details[Languages.Ar] = InitialCategoryArDetails; } if (SiteSettings.Languages_HasEnglishLanguages) { InitialCategory.Details[Languages.En] = InitialCategoryEnDetails; } ExecuteCommandStatus status = ItemCategoriesFactory.Create(InitialCategory, ItemsModule); if (status == ExecuteCommandStatus.Done) { if (ModuleBaseType == ModuleBaseTypes.Items) { AddItems(ItemsModule, InitialCategory.CategoryID); } else if (ModuleBaseType == ModuleBaseTypes.Messages) { AddMessages(ItemsModule.ModuleTypeID, InitialCategory.CategoryID); } } } }
//---------------------------------------------------------- #endregion public void AddParentCategories(ItemsModulesOptions itemsModule, ModuleBaseTypes ModuleBaseType) { //------------------------------------------------------------- InitialCategoryParent.ParentID = 0; InitialCategoryParent.ModuleTypeID = itemsModule.ModuleTypeID; //------------------------------------------------------------- for (int i = 0; i < 3; i++) { if (SiteSettings.Languages_HasArabicLanguages) { InitialCategoryParent.Details[Languages.Ar] = InitialCategoryArDetails; } if (SiteSettings.Languages_HasEnglishLanguages) { InitialCategoryParent.Details[Languages.En] = InitialCategoryEnDetails; } ExecuteCommandStatus status = ItemCategoriesFactory.Create(InitialCategoryParent, itemsModule); if (status == ExecuteCommandStatus.Done) { AddCategories(itemsModule, InitialCategoryParent.CategoryID, ModuleBaseType); } } }