Example #1
0
 public static void UnTag(CMSDataContext db, int PeopleId, string TagName, int? OwnerId, int TagTypeId)
 {
     var tag = db.FetchOrCreateTag(TagName, OwnerId, TagTypeId);
     var tp = db.TagPeople.SingleOrDefault(t => t.Id == tag.Id && t.PeopleId == PeopleId);
     if (tp != null)
         db.TagPeople.DeleteOnSubmit(tp);
 }
Example #2
0
 public static void Tag(CMSDataContext db, int PeopleId, string TagName, int? OwnerId, int TagTypeId)
 {
     var tag = db.FetchOrCreateTag(TagName, OwnerId, TagTypeId);
     var tp = db.TagPeople.SingleOrDefault(t => t.Id == tag.Id && t.PeopleId == PeopleId);
     var isperson = db.People.Count(p => p.PeopleId == PeopleId) > 0;
     if (tp == null && isperson)
         tag.PersonTags.Add(new TagPerson { PeopleId = PeopleId });
 }