public ActionResult TagUntag(int id, bool ischecked, bool isordered)
        {
            var t = DbUtil.Db.FetchOrCreateTag(Util.SessionId, Util.UserPeopleId, DbUtil.TagTypeId_AddSelected);
            var count = t.PersonTags.Count();
            var topid = "";
            var tp = DbUtil.Db.TagPeople.SingleOrDefault(tt => tt.PeopleId == id && tt.Id == t.Id);
            if (ischecked)
            {
				if (tp != null)
					DbUtil.Db.TagPeople.DeleteOnSubmit(tp);
            }
            else if (tp == null)
            {
                if (count == 0 && isordered)
                    topid = id.ToString();
                tp = new TagPerson() {Id = t.Id, PeopleId = id};
                DbUtil.Db.TagPeople.InsertOnSubmit(tp);
            }
            DbUtil.Db.SubmitChanges();
            return Content(topid);
        }
Example #2
0
 private void detach_PersonTags(TagPerson entity)
 {
     this.SendPropertyChanging();
     entity.Tag = null;
 }
Example #3
0
 private void attach_PersonTags(TagPerson entity)
 {
     this.SendPropertyChanging();
     entity.Tag = this;
 }
Example #4
0
		private void detach_PersonTags(TagPerson entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
Example #5
0
		private void attach_PersonTags(TagPerson entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}