Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 private void detach_PersonTags(TagPerson entity)
 {
     this.SendPropertyChanging();
     entity.Tag = null;
 }
Esempio n. 3
0
 private void attach_PersonTags(TagPerson entity)
 {
     this.SendPropertyChanging();
     entity.Tag = this;
 }
Esempio n. 4
0
		private void detach_PersonTags(TagPerson entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
Esempio n. 5
0
		private void attach_PersonTags(TagPerson entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}