public void ReloadTags(Int32 idCommunity, Int32 idOrganization, Int32 idCommunityType, List <long> selectedTags) { View.IdOrganizations = new List <int>() { idOrganization }; View.LoadTags(ServiceTags.GetTags(TagType.Community, idCommunity, new List <int>() { idOrganization }, idCommunityType, selectedTags)); }
private void InitializeView(Int32 idCommunity, List <Int32> idOrganizations, Int32 idCommunityType = -1) { Person p = CurrentManager.GetPerson(UserContext.CurrentUserID); if (UserContext.isAnonymous || p == null) { View.DisplaySessionTimeout(); } else { View.IdCommunityToApply = idCommunity; View.IdOrganizations = idOrganizations; View.LoadTags(ServiceTags.GetTags(TagType.Community, idCommunity, idOrganizations, idCommunityType)); } }
private List <lm.Comol.Core.BaseModules.Dashboard.Domain.dtoCommunityForTags> GenerateItems(lm.Comol.Core.BaseModules.CommunityManagement.dtoCommunitiesFilters filters, List <lm.Comol.Core.BaseModules.Dashboard.Domain.dtoCommunityForTags> items, Boolean hasMultiPage) { List <Int32> idOrganizations = (filters.IdOrganization > 0) ? new List <Int32>() { filters.IdOrganization } : new List <Int32>(); List <dtoTagSelectItem> defaultTags = ServiceTags.GetTags(TagType.Community, 0, idOrganizations); View.LoadDefaultTags(defaultTags, hasMultiPage); foreach (lm.Comol.Core.BaseModules.Dashboard.Domain.dtoCommunityForTags item in items.Where(i => i.IdOrganization == filters.IdOrganization)) { item.AvailableTags = defaultTags.Select(d => d.Copy(item.IdTags.Contains(d.Id))).ToList(); } foreach (lm.Comol.Core.BaseModules.Dashboard.Domain.dtoCommunityForTags item in items.Where(i => !i.AvailableTags.Any())) { item.AvailableTags = ServiceTags.GetTags(TagType.Community, item.Id, new List <Int32>() { item.IdOrganization }, -1, item.IdTags); } return(items); }
public void LoadTags(dtoFilters filters, Int32 idCommunity, Int32 pageIndex, Int32 pageSize) { if (UserContext.isAnonymous) { View.DisplaySessionTimeout(); } else { SetTagsInfo(filters, idCommunity); List <dtoTagItem> items = ServiceTags.GetTags(UserContext.CurrentUserID, TagType.Community, filters, idCommunity, View.GetUnknownUserName()); if (items == null) { View.DisplayErrorLoadingFromDB(); } else { Int32 itemsCount = items.Count(); PagerBase pager = new PagerBase(); pager.PageSize = pageSize; pager.Count = (itemsCount > 0) ? itemsCount - 1 : 0; pager.PageIndex = pageIndex; View.Pager = pager; String dCode = View.GetDefaultLanguageCode(); String dLanguage = View.GetDefaultLanguageName(); items = items.Skip(pager.PageIndex * pageSize).Take(pageSize).ToList(); View.AllowApplyFilters(!(View.FirstLoad && !items.Any())); items.ForEach(i => i.Translations.Insert(0, new lm.Comol.Core.DomainModel.Languages.dtoLanguageItem() { IdLanguage = -1, IsMultiLanguage = true, LanguageCode = dCode, LanguageName = dLanguage })); View.LoadTags(items, filters.IdSelectedLanguage); View.SendUserAction((filters.ForOrganization) ? idCommunity : 0, CurrentIdModule, (filters.IdOrganization > -3) ? ModuleTags.ActionType.OrganizationListTags : ModuleTags.ActionType.PortalListTags); View.FirstLoad = false; View.FirstLoadForLanguages[filters.IdSelectedLanguage] = false; } } }
public void ReloadTags(Int32 idCommunity, List <Int32> idOrganizations, Int32 idCommunityType, List <long> selectedTags) { View.LoadTags(ServiceTags.GetTags(TagType.Community, idCommunity, idOrganizations, idCommunityType, selectedTags)); }