Example #1
0
        public static void Create(string name, string slug, long tenantId, EntityContext context)
        {
            var tag = new Tag();

            tag.Name = name;
            tag.Slug = slug;
            tag.TenantId = tenantId;
            context.AddObject(tag);

            NotificationUtil.SendAdminEmail(string.Format("New Tag - Name:{0} Slug:{1}", name, slug), "");
        }
Example #2
0
        public static Tag Create(string name, long tenantId, EntityContext context)
        {
            var tag = new Tag();

            name = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(name.Trim().ToLowerInvariant());
            var slug = new Regex("[a-zA-Z_]*").Match(name.Replace(" ", "_")).Value;

            tag.Name = name.Trim();
            tag.Slug = slug;
            tag.TenantId = tenantId;
            context.AddObject(tag);

            NotificationUtil.SendAdminEmail(string.Format("New Tag - Name:{0} Slug:{1}", name, slug), "");
            return tag;
        }
Example #3
0
 public static string GetHTMLDisplayTag(Tag tag, string type)
 {
     return "<span class='skill'>" + MvcHtmlString.Create(tag.Name) + "</span>";
     //return string.Format("<a class='skill' href='/Search/Tags/{0}/{1}'>{2}</a>", type, tag.Slug, tag.Name);
 }