示例#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);
        }
示例#2
0
文件: Tag.cs 项目: thewruck/bvcms
 private void detach_PersonTags(TagPerson entity)
 {
     this.SendPropertyChanging();
     entity.Tag = null;
 }
示例#3
0
文件: Tag.cs 项目: thewruck/bvcms
 private void attach_PersonTags(TagPerson entity)
 {
     this.SendPropertyChanging();
     entity.Tag = this;
 }
示例#4
0
文件: Tag.cs 项目: stevesloka/bvcms
		private void detach_PersonTags(TagPerson entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
示例#5
0
文件: Tag.cs 项目: stevesloka/bvcms
		private void attach_PersonTags(TagPerson entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}