Esempio n. 1
0
//		public ThreadSet Threads
//		{
//			get
//			{
//				// TODO:  Add Brand.Threads getter implementation
//				return null;
//			}
//			set
//			{
//				// TODO:  Add Brand.Threads setter implementation
//			}
//		}

		#region UpdateTotalComments()
		public void UpdateTotalComments(Transaction transaction)
		{
			Query q = new Query();
			q.TableElement = new Join(
				new TableElement(TablesEnum.Thread),
				new TableElement(TablesEnum.EventBrand),
				QueryJoinType.Left,
				Thread.Columns.EventK,
				EventBrand.Columns.EventK);
			q.QueryCondition = Brand.ThreadsQEvents(this);
			q.ExtraSelectElements = ForumStats.ExtraSelectElements;
			q.Columns = new ColumnSet();
			ForumStats cs = new ForumStats(q);

			this.TotalComments=cs.TotalComments;
			this.AverageCommentDateTime=cs.AverageCommentDateTime;
			this.LastPost=cs.LastPost;

			Update(transaction);
		}
Esempio n. 2
0
		public void UpdateTotalComments(Transaction transaction)
		{
			Query q = new Query();
			q.QueryCondition = new And(
				new Q(Thread.Columns.PhotoK, this.K),
				new Q(Thread.Columns.Private, false),
				new Q(Thread.Columns.GroupPrivate, false),
				new Q(Thread.Columns.PrivateGroup, false)
			);
			q.ExtraSelectElements = ForumStats.ExtraSelectElements;
			q.Columns = new ColumnSet();
			ForumStats cs = new ForumStats(q);
			this.TotalComments = cs.TotalComments;
			this.AverageCommentDateTime = cs.AverageCommentDateTime;
			this.LastPost = cs.LastPost;

			this.UpdateStats(transaction);
			this.Update(transaction);
			if (this.Event != null)
				this.Event.UpdateTotalComments(transaction);
			if (this.Article != null)
				this.Article.UpdateTotalComments(transaction);
		}
Esempio n. 3
0
		public void UpdateTotalComments(Transaction transaction)
		{
			Query q = new Query();
			q.QueryCondition = new Q(Thread.Columns.ArticleK,this.K);
			q.ExtraSelectElements = ForumStats.ExtraSelectElements;
			q.Columns = new ColumnSet();
			ForumStats cs = new ForumStats(q);
			this.TotalComments=cs.TotalComments;
			this.AverageCommentDateTime=cs.AverageCommentDateTime;
			this.LastPost=cs.LastPost;

			Update(transaction);
			if (ParentObjectK>0 && ParentObject!=null && ParentObject is IDiscussable)
				((IDiscussable)ParentObject).UpdateTotalComments(transaction);

		}
Esempio n. 4
0
		public void UpdateTotalComments(Transaction transaction)
		{

			Query q = new Query();
			q.QueryCondition = new Q(Thread.Columns.VenueK,this.K);
			q.ExtraSelectElements = ForumStats.ExtraSelectElements;
			q.Columns = new ColumnSet();
			ForumStats cs = new ForumStats(q);
			this.TotalComments=cs.TotalComments;
			this.AverageCommentDateTime=cs.AverageCommentDateTime;
			this.LastPost=cs.LastPost;

			Update(transaction);
			this.Place.UpdateTotalComments(transaction);
		}
Esempio n. 5
0
//		public ThreadSet Threads
//		{
//			get
//			{
//				// TODO:  Add Group.Threads getter implementation
//				return null;
//			}
//			set
//			{
//				// TODO:  Add Group.Threads setter implementation
//			}
//		}

		public void UpdateTotalComments(Transaction transaction)
		{
			Query q = new Query();
			q.QueryCondition = new Q(Thread.Columns.GroupK,this.K);
			q.ExtraSelectElements = ForumStats.ExtraSelectElements;
			q.Columns = new ColumnSet();
			ForumStats cs = new ForumStats(q);
			this.TotalComments=cs.TotalComments;
			this.AverageCommentDateTime=cs.AverageCommentDateTime;
			this.LastPost=cs.LastPost;

			this.Update(transaction);
			
			if (this.BrandK>0)
				this.Brand.UpdateTotalComments(transaction);

			if (this.PlaceK>0)
				this.Place.UpdateTotalComments(transaction);
			else if (this.CountryK>0)
				this.Country.UpdateTotalComments(transaction);

		}