Esempio n. 1
0
		public void MergeAndDelete(Event merge)
		{
			if (this.K == merge.K)
				throw new DsiUserFriendlyException("Can't merge event into itself!");

			Cambro.Web.Helpers.WriteAlertHeader();

			//throw new Exception("This function isn't finished yet!");

			Cambro.Web.Helpers.WriteAlert("Starting merge...", 1);

			#region Articles
			if (true)
			{

				Query q = new Query();
				q.QueryCondition = new Q(Article.Columns.EventK, merge.K);
				ArticleSet ars = new ArticleSet(q);
				foreach (Article a in ars)
				{
					Cambro.Web.Helpers.WriteAlert("Merging article " + a.K + "...", 2);
					a.ParentObjectK = this.K;
					a.EventK = this.K;

					if (a.Relevance <= Model.Entities.Article.RelevanceEnum.Venue)
						a.VenueK = this.VenueK;
					else
						a.VenueK = 0;

					if (a.Relevance <= Model.Entities.Article.RelevanceEnum.Place)
						a.PlaceK = this.Venue.PlaceK;
					else
						a.PlaceK = 0;

					if (a.Relevance <= Model.Entities.Article.RelevanceEnum.Country)
						a.CountryK = this.Venue.Place.CountryK;
					else
						a.CountryK = 0;

					a.UrlFragment = this.UrlFilterPartVenueDate;
					a.Update();


					#region Threads
					if (true)
					{
						Update u = new Update();
						u.Table = TablesEnum.Thread;
						u.Where = new Q(Thread.Columns.ArticleK, a.K);
						u.Changes.Add(new Assign(Thread.Columns.UrlFragment, a.UrlFilterPart));
						u.Changes.Add(new Assign(Thread.Columns.EventK, this.K));
						u.Changes.Add(new Assign(Thread.Columns.VenueK, this.VenueK));
						u.Changes.Add(new Assign(Thread.Columns.PlaceK, this.Venue.PlaceK));
						u.Changes.Add(new Assign(Thread.Columns.CountryK, this.Venue.Place.CountryK));
						u.Run();
					}
					#endregion
					#region Galleries
					if (true)
					{
						Update u = new Update();
						u.Table = TablesEnum.Gallery;
						u.Where = new Q(Gallery.Columns.ArticleK, a.K);
						u.Changes.Add(new Assign(Gallery.Columns.UrlFragment, a.UrlFilterPart));
						u.Run();
					}
					#endregion
					#region Photos
					if (true)
					{
						Update u = new Update();
						u.Table = TablesEnum.Photo;
						u.Where = new Q(Photo.Columns.ArticleK, a.K);
						u.Changes.Add(new Assign(Photo.Columns.UrlFragment, a.UrlFilterPart));
						u.Run();
					}
					#endregion
				}
				Cambro.Web.Helpers.WriteAlert("Done merging articles...", 2);
			}
			#endregion
			#region Banners
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging banners...", 4);
				Update u = new Update();
				u.Table = TablesEnum.Banner;
				u.Where = new Q(Banner.Columns.EventK, merge.K);
				u.Changes.Add(new Assign(Banner.Columns.EventK, this.K));
				u.Run();
				Cambro.Web.Helpers.WriteAlert("Done merging banners...", 4);
			}
			#endregion
			#region Comp
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging competitions...", 5);
				Update u = new Update();
				u.Table = TablesEnum.Comp;
				u.Where = new Q(Comp.Columns.EventK, merge.K);
				u.Changes.Add(new Assign(Comp.Columns.EventK, this.K));
				u.Run();
				Cambro.Web.Helpers.WriteAlert("Done merging competitions...", 5);
			}
			#endregion
			#region EventMusicType
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging music types...", 6);
				Query q1 = new Query();
				q1.TableElement = MusicType.EventJoin;
				q1.QueryCondition = new Q(Event.Columns.K, merge.K);
				MusicTypeSet ems1 = new MusicTypeSet(q1);

				Query q2 = new Query();
				q2.TableElement = MusicType.EventJoin;
				q2.QueryCondition = new Q(Event.Columns.K, this.K);
				MusicTypeSet ems2 = new MusicTypeSet(q2);

				bool hasAllMuisc = false;
				ArrayList majorTypes = new ArrayList();
				ArrayList relevantTypes = new ArrayList();

				#region find major types
				foreach (MusicType mt in ems1)
				{
					if (mt.K == 1)
					{
						hasAllMuisc = true;
						break;
					}
					if (mt.ParentK == 1 && !majorTypes.Contains(mt.K))
						majorTypes.Add(mt.K);
				}
				if (!hasAllMuisc)
				{
					foreach (MusicType mt in ems2)
					{
						if (mt.K == 1)
						{
							hasAllMuisc = true;
							break;
						}
						if (mt.ParentK == 1 && !majorTypes.Contains(mt.K))
							majorTypes.Add(mt.K);
					}
				}
				#endregion
				if (!hasAllMuisc)
				{
					foreach (MusicType mt in ems1)
					{
						if (!majorTypes.Contains(mt.ParentK) && !relevantTypes.Contains(mt.K))
							relevantTypes.Add(mt.K);
					}
					foreach (MusicType mt in ems2)
					{
						if (!majorTypes.Contains(mt.ParentK) && !relevantTypes.Contains(mt.K))
							relevantTypes.Add(mt.K);
					}
				}
				if (hasAllMuisc || relevantTypes.Count == 0)
				{
					Delete d = new Delete(TablesEnum.EventMusicType, new Q(EventMusicType.Columns.EventK, this.K));
					d.Run();
					EventMusicType emt = new EventMusicType();
					emt.EventK = this.K;
					emt.MusicTypeK = 1;
					emt.Update();
				}
				else
				{
					Delete d = new Delete(TablesEnum.EventMusicType, new Q(EventMusicType.Columns.EventK, this.K));
					d.Run();
					foreach (int mtK in relevantTypes)
					{
						EventMusicType emt = new EventMusicType();
						emt.EventK = this.K;
						emt.MusicTypeK = mtK;
						emt.Update();
					}
				}
				Cambro.Web.Helpers.WriteAlert("Done merging music types...", 6);
			}
			#endregion
			#region EventBrand
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging brands...", 7);
				EventBrandSet ebs = new EventBrandSet(new Query(new Q(EventBrand.Columns.EventK, merge.K)));
				foreach (EventBrand eb in ebs)
				{
					try
					{
						EventBrand ebThis = new EventBrand(this.K, eb.BrandK);
					}
					catch
					{
						EventBrand ebThis = new EventBrand();
						ebThis.EventK = this.K;
						ebThis.BrandK = eb.BrandK;
						ebThis.Update();
					}
				}
				Cambro.Web.Helpers.WriteAlert("Done merging brands...", 7);
			}
			#endregion
			 
			#region Gallery
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging galleries...", 9);
				Update u = new Update();
				u.Table = TablesEnum.Gallery;
				u.Where = new Q(Gallery.Columns.EventK, merge.K);
				u.Changes.Add(new Assign(Gallery.Columns.EventK, this.K));
				u.Changes.Add(new Assign(Gallery.Columns.UrlFragment, this.UrlFilterPartVenueDate));
				u.Run();
				Cambro.Web.Helpers.WriteAlert("Done merging galleries...", 9);
			}
			#endregion
			#region Photo
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging photos...", 10);
				Update u = new Update();
				u.Table = TablesEnum.Photo;
				u.Where = new Q(Photo.Columns.EventK, merge.K);
				u.Changes.Add(new Assign(Photo.Columns.EventK, this.K));
				u.Changes.Add(new Assign(Photo.Columns.UrlFragment, this.UrlFilterPartVenueDate));
				u.Run();
				Cambro.Web.Helpers.WriteAlert("Done merging photos...", 10);
			}
			#endregion
			#region GroupEvent
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging group-event links...", 11);
				GroupEventSet ges = new GroupEventSet(new Query(new Q(GroupEvent.Columns.EventK, merge.K)));
				foreach (GroupEvent ge in ges)
				{
					try
					{
						GroupEvent geThis = new GroupEvent(ge.GroupK, this.K);
					}
					catch
					{
						GroupEvent geThis = new GroupEvent();
						geThis.EventK = this.K;
						geThis.GroupK = ge.GroupK;
						geThis.Update();
					}
				}
				Cambro.Web.Helpers.WriteAlert("Done merging group-event links...", 11);
			}
			#endregion
			#region Thread ParentObjects
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging topics (1/2)...", 12);
				Update u = new Update();
				u.Table = TablesEnum.Thread;
				u.Where = new And(
					new Q(Thread.Columns.ParentObjectType, Model.Entities.ObjectType.Event),
					new Q(Thread.Columns.ParentObjectK, merge.K));
				u.Changes.Add(new Assign(Thread.Columns.ParentObjectK, this.K));
				u.Run();
				Cambro.Web.Helpers.WriteAlert("Done merging topics (1/2)...", 12);
			}
			#endregion
			#region Thread
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging topics (2/2)...", 13);
				Update u = new Update();
				u.Table = TablesEnum.Thread;
				u.Where = new And(
					new Q(Thread.Columns.EventK, merge.K),
					new Q(Thread.Columns.ArticleK, 0));
				u.Changes.Add(new Assign(Thread.Columns.EventK, this.K));
				u.Changes.Add(new Assign(Thread.Columns.UrlFragment, this.UrlFilterPartVenueDate));
				u.Run();
				Cambro.Web.Helpers.WriteAlert("Done merging topics (2/2)...", 13);
			}
			#endregion
			#region UsrEventAttended
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging members...", 14);
				UsrEventAttendedSet ueas = new UsrEventAttendedSet(new Query(new Q(UsrEventAttended.Columns.EventK, merge.K)));
				foreach (UsrEventAttended uea in ueas)
				{
					try
					{
						UsrEventAttended ueaThis = new UsrEventAttended(uea.UsrK, this.K);
						bool changed = false;
						if (!uea.SendUpdate && ueaThis.SendUpdate)
						{
							ueaThis.SendUpdate = false;
							changed = true;
						}
						if (uea.Spotter && !ueaThis.Spotter)
						{
							ueaThis.Spotter = true;
							changed = true;
						}
						if (changed)
							ueaThis.Update();
					}
					catch
					{
						UsrEventAttended ueaThis = new UsrEventAttended();
						ueaThis.EventK = this.K;
						ueaThis.UsrK = uea.UsrK;
						ueaThis.SendUpdate = uea.SendUpdate;
						ueaThis.Spotter = uea.Spotter;
						ueaThis.Update();
					}
				}
				Cambro.Web.Helpers.WriteAlert("Done merging members...", 14);
			}
			#endregion

			if (!this.HasPic)
			{
				Cambro.Web.Helpers.WriteAlert("Merging picture...", 15);
				this.Pic = merge.Pic;
				this.PicMiscK = merge.PicMiscK;
				this.PicPhotoK = merge.PicPhotoK;
				this.PicState = merge.PicState;
				merge.Pic = Guid.Empty;
				merge.PicMiscK = 0;
				merge.PicPhotoK = 0;
				merge.PicState = "";
				merge.Update();
				Cambro.Web.Helpers.WriteAlert("Done merging picture...", 15);
			}

			this.AdminNote += "Event " + merge.K + " was merged with this one " + DateTime.Now.ToString() + ". The admin note from event " + merge.K + " is:\n********************\n" + merge.AdminNote + "\n********************\n";

			if (!this.HasGuestlist && merge.HasGuestlist)
			{
				Cambro.Web.Helpers.WriteAlert("Merging guestlist...", 16);
				this.HasGuestlist = true;
				this.GuestlistOpen = merge.GuestlistOpen;
				this.GuestlistFinished = merge.GuestlistOpen;
				this.GuestlistLimit = merge.GuestlistLimit;
				this.GuestlistCount = merge.GuestlistCount;
				this.GuestlistDetails = merge.GuestlistDetails;
				this.GuestlistPromoterK = merge.GuestlistPromoterK;
				this.GuestlistRegularPrice = merge.GuestlistRegularPrice;
				this.GuestlistPrice = merge.GuestlistPrice;
				this.GuestlistPromotion = merge.GuestlistPromotion;

				Delete d = new Delete(TablesEnum.UsrEventGuestlist, new Q(UsrEventGuestlist.Columns.EventK, this.K));
				d.Run();

				Update u = new Update();
				u.Table = TablesEnum.UsrEventGuestlist;
				u.Where = new Q(UsrEventGuestlist.Columns.EventK, merge.K);
				u.Changes.Add(new Assign(UsrEventGuestlist.Columns.EventK, this.K));
				u.Run();
				Cambro.Web.Helpers.WriteAlert("Done merging guestlist...", 16);
			}

			if (merge.Donated)
				this.Donated = true;

			if (merge.HasHilight)
				this.HasHilight = true;

			this.UpdateUsrAttendCount(false);

			this.Update();

			int mergeVenueK = merge.VenueK;

			Cambro.Web.Helpers.WriteAlert("Deleting old event...", 17);
			merge.DeleteAll(null);
			Cambro.Web.Helpers.WriteAlert("Done deleting old event...", 17);

			if (mergeVenueK != this.VenueK)
			{
				Venue mergeVenue = new Venue(mergeVenueK);
				Cambro.Web.Helpers.WriteAlert("Updating stats for old venue...", 18);
				mergeVenue.UpdateTotalComments(null);
				mergeVenue.UpdateTotalEvents(null);
				Cambro.Web.Helpers.WriteAlert("Done updating stats for old venue...", 18);
			}

			Cambro.Web.Helpers.WriteAlert("Updating stats for new event...", 19);
			this.UpdateMusicTypesStringNoUpdate();
			this.UpdateTotalComments(null);
			this.UpdateHasSpotter(null);
			this.UpdateTotalPhotos(null);
			this.Venue.UpdateTotalEvents(null);
			Cambro.Web.Helpers.WriteAlert("Done updating stats for new event...", 19);

			this.Update();
			Cambro.Web.Helpers.WriteAlert("Done merging events!", 20);


		}
Esempio n. 2
0
		public void ModeratorRecommendedAdd_Click(object o, System.EventArgs e)
		{
			if (ShowModerator)
			{
				if (CurrentGroup.BrandK > 0)
					throw new Exception("Not brand groups!!!");
				try
				{
					Event ev = this.uiEventPicker.Event;

					try
					{
						GroupEvent ge = new GroupEvent(CurrentGroup.K, ev.K);
					}
					catch
					{
						GroupEvent ge = new GroupEvent();
						ge.EventK = ev.K;
						ge.GroupK = CurrentGroup.K;
						ge.Update();
					}
				}
				catch
				{
					ModeratorRecommendedAddErrorP.Visible = true;
					return;
				}
				ModeratorRecommendedAddDoneP.Visible = true;
			}
		}
Esempio n. 3
0
		public void MergeAndDelete(Group merge)
		{
			if (this.K==merge.K)
				throw new DsiUserFriendlyException("Can't merge group into itself!");

			Cambro.Web.Helpers.WriteAlertHeader();

			Cambro.Web.Helpers.WriteAlert("Starting group merge...", true);

			Cambro.Web.Helpers.WriteAlert("Merging group members...", true);
			//members
			Query qGu = new Query();
			qGu.QueryCondition=new Q(GroupUsr.Columns.GroupK,merge.K);
			GroupUsrSet gus = new GroupUsrSet(qGu);
			int count = 0;
			foreach (GroupUsr guMerge in gus)
			{
				if (count%10==0)
					Cambro.Web.Helpers.WriteAlert("Merging usr " + guMerge.UsrK + " ("+count+" / "+gus.Count+")...");

				try
				{

					count++;
					GroupUsr guMaster = this.GetGroupUsr(guMerge.Usr);
					if (guMaster == null)
					{
						guMaster = new GroupUsr();
						guMaster.UsrK = guMerge.UsrK;
						guMaster.GroupK = this.K;
						guMaster.Status = guMerge.Status;
						guMaster.StatusChangeDateTime = guMerge.StatusChangeDateTime;
						guMaster.StatusChangeUsrK = guMerge.StatusChangeUsrK;
						guMaster.Owner = guMerge.Owner;
						guMaster.Moderator = guMerge.Moderator;
						guMaster.NewsAdmin = guMerge.NewsAdmin;
						guMaster.MemberAdmin = guMerge.MemberAdmin;
						guMaster.MemberAdminNewUserEmails = guMerge.MemberAdminNewUserEmails;
						guMaster.Favourite = guMerge.Favourite;
						guMaster.InviteMessage = guMerge.InviteMessage;
						guMaster.InviteUsrK = guMerge.InviteUsrK;
						guMaster.Update();

						guMaster.Usr.UpdateIsGroupModerator();

					}
					else
					{
						if (guMaster.StatusPermissionLevel < guMerge.StatusPermissionLevel)
						{
							guMaster.Status = guMerge.Status;
							guMaster.StatusChangeDateTime = guMerge.StatusChangeDateTime;
							guMaster.StatusChangeUsrK = guMerge.StatusChangeUsrK;
							guMaster.InviteMessage = guMerge.InviteMessage;
							guMaster.InviteUsrK = guMerge.InviteUsrK;
						}
						if (this.BrandK == 0 || merge.BrandK > 0)
						{
							if (guMerge.Owner)
								guMaster.Owner = true;
							if (guMerge.Moderator)
								guMaster.Moderator = true;
							if (guMerge.NewsAdmin)
								guMaster.NewsAdmin = true;
							if (guMerge.MemberAdmin)
							{
								guMaster.MemberAdmin = true;
								guMaster.MemberAdminNewUserEmails = guMerge.MemberAdminNewUserEmails;
							}
						}
						if (guMerge.Favourite)
							guMaster.Favourite = true;

						guMaster.Update();

						guMaster.Usr.UpdateIsGroupModerator();
					}

					if (guMaster.IsMember)
					{
						Mailer m = new Mailer();
						m.UsrRecipient = guMerge.Usr;
						m.Subject = "A group you were in has been merged";
						m.Body = "<p><i>" + merge.FriendlyName + "</i> has been merged with <i>" + this.FriendlyName + "</i>. " +
							"Your membership details have been moved across. If you ever want to exit the group, click the button " +
							"on the <a href=\"[LOGIN(" + this.Url() + ")]\">group homepage</a>.</p>";
						m.RedirectUrl = this.Url();
						m.Bulk = true;
						m.Send();
					}

					if (guMaster.IsMember && CommentAlert.IsEnabled(guMerge.UsrK, guMerge.GroupK, Model.Entities.ObjectType.Group))
						CommentAlert.Enable(guMaster.Usr, guMaster.GroupK, Model.Entities.ObjectType.Group);
				}
				catch 
				{
					Cambro.Web.Helpers.WriteAlert("Exception! ... deleting membership for usr " + guMerge.UsrK + " (" + count + " / " + gus.Count + ")...");
					guMerge.Delete();
				}
			}
			Cambro.Web.Helpers.WriteAlert("Done merging usrs...");

			//picture
			if (merge.HasPic && !this.HasPic)
			{
				Cambro.Web.Helpers.WriteAlert("Copying picture...", true);
				try
				{
					Utilities.CopyPic(merge, this);
				}
				catch
				{
					Cambro.Web.Helpers.WriteAlert("Exception while copying picture...", true);
				}
				Cambro.Web.Helpers.WriteAlert("Done copying picture...", true);
			}
			
			//recommended events
			if (this.BrandK == 0)
			{
				Cambro.Web.Helpers.WriteAlert("Merging recommended events...", true);
				Query qEv = new Query();
				qEv.QueryCondition = new Q(GroupEvent.Columns.GroupK, merge.K);
				GroupEventSet ges = new GroupEventSet(qEv);
				foreach (GroupEvent geMerge in ges)
				{
					try
					{
						GroupEvent geMaster = new GroupEvent(this.K, geMerge.EventK);
					}
					catch (BobNotFound)
					{
						GroupEvent geMaster = new GroupEvent();
						geMaster.GroupK = this.K;
						geMaster.EventK = geMerge.EventK;
						geMaster.Update();
					}
				}
				Cambro.Web.Helpers.WriteAlert("Done merging recommended events...");
			}

			Cambro.Web.Helpers.WriteAlert("Merging top photos...", true);
			//top photos
			Query qPh = new Query();
			qPh.QueryCondition=new Q(GroupPhoto.Columns.GroupK,merge.K);
			GroupPhotoSet gps = new GroupPhotoSet(qPh);
			foreach (GroupPhoto gpMerge in gps)
			{
				try
				{
					GroupPhoto gpMaster = new GroupPhoto(this.K,gpMerge.PhotoK);
					if (!gpMaster.ShowOnFrontPage && gpMerge.ShowOnFrontPage)
					{
						gpMaster.Caption=gpMerge.Caption;
						gpMaster.DateTime=gpMerge.DateTime;
						gpMaster.AddedByUsrK=gpMerge.AddedByUsrK;
						gpMaster.ShowOnFrontPage=gpMerge.ShowOnFrontPage;
						gpMaster.Update();
					}
				}
				catch (BobNotFound)
				{
					GroupPhoto gpMaster = new GroupPhoto();
					gpMaster.GroupK=this.K;
					gpMaster.PhotoK=gpMerge.PhotoK;
					gpMaster.Caption=gpMerge.Caption;
					gpMaster.DateTime=gpMerge.DateTime;
					gpMaster.AddedByUsrK=gpMerge.AddedByUsrK;
					gpMaster.ShowOnFrontPage=gpMerge.ShowOnFrontPage;
					gpMaster.Update();
				}
			}
			Cambro.Web.Helpers.WriteAlert("Done merging top photos...");

			//addedbyusrk's
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Updating invited users...", true);
				Update update = new Update();
				update.Changes.Add(new Assign(Usr.Columns.AddedByGroupK, this.K));
				update.Table = TablesEnum.Usr;
				update.Where = new Q(Usr.Columns.AddedByGroupK, merge.K);
				update.Run();
				Cambro.Web.Helpers.WriteAlert("Done updating invited users...");
			}

			Cambro.Web.Helpers.WriteAlert("Merging topics (1/4)...", true);
			//chats
			if (merge.PrivateChat != this.PrivateChat ||
				merge.ThemeK != this.ThemeK ||
				merge.MusicTypeK != this.MusicTypeK)
			{
				Update update = new Update();
				update.Table=TablesEnum.Thread;
				update.Changes.Add(new Assign(Thread.Columns.PrivateGroup,this.PrivateChat));
				update.Changes.Add(new Assign(Thread.Columns.ThemeK, this.ThemeK));
				update.Changes.Add(new Assign(Thread.Columns.MusicTypeK, this.MusicTypeK));
				update.Where=new Q(Thread.Columns.GroupK,merge.K);
				update.Run();
			}
			Cambro.Web.Helpers.WriteAlert("Done merging topics (1/4)...");

			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging topics (2/4)...", true);
				Update update = new Update();
				update.Table=TablesEnum.Thread;
				update.Changes.Add(new Assign(Thread.Columns.UrlFragment,"groups/"+this.UrlName));
				update.Changes.Add(new Assign(Thread.Columns.CountryK, this.CountryK));
				update.Changes.Add(new Assign(Thread.Columns.PlaceK,this.PlaceK));
				update.Where=new And(new Q(Thread.Columns.ParentObjectType,Model.Entities.ObjectType.Group),new Q(Thread.Columns.ParentObjectK,merge.K));
				update.Run();
				Cambro.Web.Helpers.WriteAlert("Done merging topics (2/4)...");
			}

			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging topics (3/4)...", true);
				Update update = new Update();
				update.Table=TablesEnum.Thread;
				update.Changes.Add(new Assign(Thread.Columns.GroupK,this.K));
				update.Where=new Q(Thread.Columns.GroupK,merge.K);
				update.Run();
				Cambro.Web.Helpers.WriteAlert("Done merging topics (3/4)...");
			}
			
			if (true)
			{
				Cambro.Web.Helpers.WriteAlert("Merging topics (4/4)...", true);
				Update update = new Update();
				update.Table=TablesEnum.Thread;
				update.Changes.Add(new Assign(Thread.Columns.ParentObjectK,this.K));
				update.Where=new And(new Q(Thread.Columns.ParentObjectType,Model.Entities.ObjectType.Group),new Q(Thread.Columns.ParentObjectK,merge.K));
				update.Run();
				Cambro.Web.Helpers.WriteAlert("Done merging topics (4/4)...");
			}

			Cambro.Web.Helpers.WriteAlert("Deleting old group...", true);
			merge.DeleteAll(null);
			Cambro.Web.Helpers.WriteAlert("Done deleting old group...");

			Cambro.Web.Helpers.WriteAlert("Updating stats...", true);
			this.UpdateTotalComments(null);
			this.UpdateTotalMembers();
			Cambro.Web.Helpers.WriteAlert("Done updating stats...");

			Cambro.Web.Helpers.WriteAlert("Finished merging groups.", true);


		}