private void LoadPromoterTicketRuns()
		{
			SetDateRange();
			Query promoterTicketRunsQuery = new Query(new And(new Q(Bobs.TicketRun.Columns.PromoterK, CurrentPromoter.K),
															  new Q(Event.Columns.DateTime, QueryOperator.GreaterThanOrEqualTo, StartDateRange),
															  new Q(Event.Columns.DateTime, QueryOperator.LessThan, EndDateRange)));
			promoterTicketRunsQuery.TableElement = new Join(Bobs.TicketRun.Columns.EventK, Event.Columns.K);
			promoterTicketRunsQuery.OrderBy = new OrderBy(new OrderBy(Event.Columns.DateTime, OrderBy.OrderDirection.Descending), new OrderBy(Event.Columns.K), new OrderBy(Bobs.TicketRun.Columns.ListOrder),
														  new OrderBy(Bobs.TicketRun.Columns.Price), new OrderBy(Bobs.TicketRun.Columns.StartDateTime));
			promoterTicketRunsQuery.Paging.RecordsPerPage = this.RecordsPerPage;
			promoterTicketRunsQuery.Paging.RequestedPage = this.PageNumber;
			promoterTicketRunsQuery.TopRecords = (this.PageNumber * this.RecordsPerPage) + 1;


			TicketRunSet promoterTicketRuns = new TicketRunSet(promoterTicketRunsQuery);

			TicketRunsGridView.DataSource = promoterTicketRuns;
			TicketRunsGridView.DataBind();

			this.NextPageLinkButton.Enabled = promoterTicketRuns.Paging.ShowNextPageLink;
			this.PrevPageLinkButton.Enabled = promoterTicketRuns.Paging.ShowPrevPageLink;			
		}
Esempio n. 2
0
		private void SetupFollowsTicketRunDropDownList()
		{
			this.FollowsTicketRunRow.Visible = false;

			if (CurrentTicketRun.Event != null && CurrentPromoter != null)
			{
				int currentTicketRunK = 0;
				if(CurrentTicketRun != null)
					currentTicketRunK = CurrentTicketRun.K;

				Query otherTicketRunsQuery = new Query(new And(new Q(Bobs.TicketRun.Columns.EventK, CurrentTicketRun.EventK),
															   new Q(Bobs.TicketRun.Columns.K, QueryOperator.NotEqualTo, currentTicketRunK)));
				otherTicketRunsQuery.Columns = new ColumnSet(Bobs.TicketRun.Columns.K, Bobs.TicketRun.Columns.Price, Bobs.TicketRun.Columns.Name, Bobs.TicketRun.Columns.StartDateTime, Bobs.TicketRun.Columns.EndDateTime);
				otherTicketRunsQuery.OrderBy = new OrderBy(Bobs.TicketRun.Columns.Price);
				TicketRunSet otherTicketRuns = new TicketRunSet(otherTicketRunsQuery);

                this.FollowsTicketRunDropDownList.Items.Clear();
                this.FollowsTicketRunDropDownList.Items.Add(new ListItem("", "0"));

				if (otherTicketRuns.Count > 0)
				{
					this.FollowsTicketRunRow.Visible = true;

					ListItem[] otherTicketRunListItems = new ListItem[otherTicketRuns.Count];
					for (int i = 0; i < otherTicketRuns.Count; i++)
					{
						otherTicketRunListItems[i] = otherTicketRuns[i].ToListItem(30, true);
					}

					this.FollowsTicketRunDropDownList.Items.AddRange(otherTicketRunListItems);
				}
			}
		}
Esempio n. 3
0
		private void SetupTicketRunSelection()
		{
			Q q = new Q(TicketRun.Columns.EventK, CurrentEvent.K);
			Query ticketRunForEventQuery = new Query(q);
			if (PromoterK > 0)
			{
				ticketRunForEventQuery.QueryCondition = new And(q, new Q(TicketRun.Columns.PromoterK, PromoterK));
			}
			//ticketRunForEventQuery.Columns = new ColumnSet(TicketRun.Columns.K, TicketRun.Columns.PromoterK, TicketRun.Columns.EventK, TicketRun.Columns.Price, TicketRun.Columns.Name, 
			//                                               TicketRun.Columns.BrandK, TicketRun.Columns.StartDateTime, TicketRun.Columns.EndDateTime, TicketRun.Columns.Paused, 
			//                                               TicketRun.Columns.MaxTickets, TicketRun.Columns.FollowsTicketRunK, TicketRun.Columns.SoldTickets);
			ticketRunForEventQuery.OrderBy = new OrderBy(new OrderBy(TicketRun.Columns.ListOrder), new OrderBy(TicketRun.Columns.Price));

			CurrentTicketRuns = new TicketRunSet(ticketRunForEventQuery);

			this.TicketRunSelectRepeater.DataSource = CurrentTicketRuns;
			this.TicketRunSelectRepeater.DataBind();
		}
		public static void CreateNewTicketPromoterEventsWhenNeeded()
		{
			try
			{
                // Testing started in May 2007, so include all events after that date. We do not want to include past ticket runs, SW4 2006.
				Query ticketPromoterEventNotCreatedQuery = new Query(new And(new Q(TicketPromoterEvent.Columns.EventK, QueryOperator.IsNull, null),
																			 new Q(Event.Columns.DateTime, QueryOperator.LessThan, DateTime.Today),
                                                                             new Q(Event.Columns.DateTime, QueryOperator.GreaterThanOrEqualTo, Vars.TICKETS_NEW_SYSTEM_START_DATE)));

				ticketPromoterEventNotCreatedQuery.TableElement = new Join(new Join(TicketRun.Columns.EventK, Event.Columns.K), new TableElement(TablesEnum.TicketPromoterEvent), QueryJoinType.Left,
																				 new And(new Q(TicketPromoterEvent.Columns.EventK, Event.Columns.K, true),
																						 new Q(TicketPromoterEvent.Columns.PromoterK, TicketRun.Columns.PromoterK, true)));
				ticketPromoterEventNotCreatedQuery.Columns = new ColumnSet(TicketRun.Columns.PromoterK, TicketRun.Columns.EventK);
				ticketPromoterEventNotCreatedQuery.GroupBy = new GroupBy(new GroupBy(TicketRun.Columns.PromoterK), new GroupBy(TicketRun.Columns.EventK));

				TicketRunSet ticketRunsWithoutTicketPromoterEvents = new TicketRunSet(ticketPromoterEventNotCreatedQuery);
				foreach (TicketRun ticketRunWithoutTicketPromoterEvent in ticketRunsWithoutTicketPromoterEvents)
				{
					TicketPromoterEvent ticketPromoterEvent = new TicketPromoterEvent();
					try
					{
						ticketPromoterEvent = new TicketPromoterEvent(ticketRunWithoutTicketPromoterEvent.PromoterK, ticketRunWithoutTicketPromoterEvent.EventK);
					}
					catch
					{
						ticketPromoterEvent.PromoterK = ticketRunWithoutTicketPromoterEvent.PromoterK;
						ticketPromoterEvent.EventK = ticketRunWithoutTicketPromoterEvent.EventK;
						ticketPromoterEvent.FundsLockText = "";
						ticketPromoterEvent.FundsReleased = false;
						ticketPromoterEvent.Update();

						if (!ticketPromoterEvent.Promoter.EnableTickets)
						{
							Utilities.EmailPromoterReminderToSubmitTicketApplicationForm(ticketPromoterEvent);
						}
					}
				}
			}
			catch (Exception ex)
			{
				Utilities.AdminEmailAlert("Exception in TicketPromoterEvent.CreateTicketPromoterEventsWhenNeeded()", "Exception in TicketPromoterEvent.CreateTicketPromoterEventsWhenNeeded()", ex);
			}
		}
Esempio n. 5
0
		public string PromoterHtmlTickets(Promoter p)
		{
			Query q = new Query();
			q.QueryCondition = new And(new Q(TicketRun.Columns.PromoterK, p.K), new Q(TicketRun.Columns.EventK, this.K));
			q.ReturnCountOnly = true;
			TicketRunSet ts = new TicketRunSet(q);
			return TickCrossHtml(ts.Count > 0);
		}
Esempio n. 6
0
		private void LoadEventTicketRuns()
		{
			if (EnsureSecure)
			{
				SellTicketsP.Visible = CurrentEvent.LatestEndOfTicketRunDateTime > DateTime.Now;
				NoTicketRunsP.Visible = SellTicketsP.Visible && CurrentEvent.TicketRuns.Count == 0;
				NoSellTicketsP.Visible = !SellTicketsP.Visible;
				H10.InnerHtml = (NoTicketRunsP.Visible ? "No Tickets!" : "Tickets");

				SellTicketsLink.HRef = CurrentPromoter.UrlApp("ticketrun", "eventk", CurrentEventK.ToString(), "ReferringPage", Convert.ToInt32(TicketRun.ReferringPageType.EventOptions).ToString());
				DoorlistLink.HRef = UrlInfo.PageUrl(UrlInfo.PageTypes.Blank, "doorlist", "eventk", CurrentEventK.ToString());

				Query eventTicketRunsQuery = new Query(new And(new Q(Bobs.TicketRun.Columns.EventK, CurrentEvent.K),
															   new Q(Bobs.TicketRun.Columns.PromoterK, CurrentPromoter.K)));
				eventTicketRunsQuery.OrderBy = new OrderBy(new OrderBy(Bobs.TicketRun.Columns.ListOrder),
														   new OrderBy(Bobs.TicketRun.Columns.StartDateTime),
														   new OrderBy(Bobs.TicketRun.Columns.Price));

				TicketRunSet eventTicketRuns = new TicketRunSet(eventTicketRunsQuery);

				TicketRunsGridView.DataSource = eventTicketRuns;
				TicketRunsGridView.DataBind();

				DoorlistP.Visible = false;
				foreach (Bobs.TicketRun ticketRun in eventTicketRuns)
				{
					if (ticketRun.SoldTickets > 0)
					{
						DoorlistP.Visible = true;
						break;
					}
				}
			}
		}
Esempio n. 7
0
		// Due to the complicated nature of the searching based on status, it is much easier to verify ticketrun status of the returned results
		public List<TicketRun> VerifyTicketRunsMatchSearchCriteria(TicketRunSet ticketRuns)
		{
			List<TicketRun> verifiedTicketRuns = new List<TicketRun>();
			
			ticketRuns.Reset();
			foreach (TicketRun tr in ticketRuns)
			{
				if (ticketRunStatus == 0 || ticketRunStatus == tr.Status)
				{
					verifiedTicketRuns.Add(tr);
				}
			}

			return verifiedTicketRuns;
		}