Beispiel #1
0
        protected List<CY.CSTS.Core.Business.Control.Tag> Initial(CY.Utility.Common.CodeInterface.TagType TagType)
        {
            List<CY.CSTS.Core.Business.Tag> RTag = new List<CY.CSTS.Core.Business.Tag>();
            List<CY.CSTS.Core.Business.Control.Tag> NTag = new List<CY.CSTS.Core.Business.Control.Tag>();
            try
            {
                List<CY.CSTS.Core.Business.Tag> Tags = CY.CSTS.Core.Business.Tag.SelectTagDynamic(WhereCondition(TagType), OrderExpression()).Take(20).ToList();

                if (Tags != null)
                {
                    string[] tagname = null;
                    foreach (CY.CSTS.Core.Business.Tag tag in Tags)
                    {
                        tagname = tag.TagName.Split(',');
                        foreach (string s in tagname)
                        {
                            RTag.Add(new CY.CSTS.Core.Business.Tag() { Id = tag.Id, TagName = s, ContentID = tag.ContentID, ContentType = tag.ContentType });
                        }
                    }
                    if (RTag != null)
                    {
                        List<string> TagName = (from p in RTag select p.TagName).Distinct().ToList();
                        if (TagName != null)
                        {
                            foreach (string s in TagName)
                            {
                                int count = (from p in RTag where p.TagName == s select p.ContentID).Distinct().Count();
                                NTag.Add(new CY.CSTS.Core.Business.Control.Tag() { Count = count, Name = s });
                            }
                        }
                    }
                }
                return NTag;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (TagType == null)
     {
         TagType = CY.Utility.Common.CodeInterface.TagType.Equip;
     }
     Tags = Initial(TagType);
 }