// 19/09/2012 private void ExecGroupsLocalDistant(Model.Prestashop.PsCategory Category) { try { // We need to update CategoryGroup too Model.Local.ConfigRepository ConfigRepository = new Model.Local.ConfigRepository(); Model.Local.GroupRepository GroupRepository = new Model.Local.GroupRepository(); Model.Prestashop.PsGroupRepository PsGroupRepository = new Model.Prestashop.PsGroupRepository(); foreach (var group in GroupRepository.List()) { if (group.Grp_ShowCatalog && PsGroupRepository.ExistGroup(Convert.ToInt32(group.Grp_Pre_Id))) { Model.Prestashop.PsGroup Group = PsGroupRepository.ReadGroup(Convert.ToInt32(group.Grp_Pre_Id)); Model.Prestashop.PsCategoryGroupRepository CategoryGroupRepository = new Model.Prestashop.PsCategoryGroupRepository(); if (CategoryGroupRepository.ExistCategoryGroup((Int32)Category.IDCategory, (Int32)Group.IDGroup) == false) { Model.Prestashop.PsCategoryGroup CategoryGroup = new Model.Prestashop.PsCategoryGroup(); CategoryGroup.IDCategory = Category.IDCategory; CategoryGroup.IDGroup = Group.IDGroup; CategoryGroupRepository.Add(CategoryGroup); Core.Temp.SyncCatalogue_ClearSmartyCache = true; Core.Temp.SyncCatalogue_RegenerateTree = true; } } } } catch (Exception ex) { Core.Error.SendMailError(ex.ToString()); } }
public ConfigurationGroup(Model.Local.Group local, Model.Prestashop.PsGroup prestashop) { Source = local; PsSource = prestashop; }