public GroupTags_TagViewModel(Tag tag) { Id = tag.Id; Title = tag.Title; IsRecomended = tag.IsRecommended; Weight = tag.Weight; }
public GroupTopics_TopicViewModel(Tag tag) { Id = tag.Id; Title = tag.Title; Description = tag.Description; GroupId = tag.GroupId; ContentCount = tag.Contents.Count(x=>x.State == (byte)ContentState.Approved); ExpertCount = tag.Experts.Count(); }
public TagViewModel(Tag tag) { if (tag != null) { Id = tag.Id; Title = tag.Title; IsRecomended = tag.IsRecommended; Description = tag.Description; Weight = tag.Weight; } }
public static Tag CreateTag(string tagTitle, string description, Guid? groupId) { Guid tmp; if (Guid.TryParse(tagTitle, out tmp)) throw new BusinessLogicException("Некорректное название тэга"); var tag = new Tag(tagTitle) { Description = description, GroupId = groupId, }; DataService.PerThread.TagSet.AddObject(tag); return tag; }
private void FixupTag(Tag previousValue) { if (previousValue != null && previousValue.ExpertVotes.Contains(this)) { previousValue.ExpertVotes.Remove(this); } if (Tag != null) { if (!Tag.ExpertVotes.Contains(this)) { Tag.ExpertVotes.Add(this); } if (TagId != Tag.Id) { TagId = Tag.Id; } } }
public GroupIndex_TopicViewModel(Tag topic) { Id = topic.Id; Title = topic.Title; }
public static bool UpdateTag(Tag tag, string title, string description) { var suchtag = GetTag(title, tag.Group); if (suchtag == null) { tag.Description = description; tag.ChangeTitle(title); return true; } return false; }
public static void SetTagRecomendation(Tag tag, bool recomended) { if (tag.TopicState == (byte)TopicState.GroupTopic) throw new BusinessLogicException("Нельзя сменить настройки рекомендации у темы группы"); tag.IsRecommended = recomended; }