protected void Save(object sender, EventArgs e)
		{
			bool mismatch = false;
			bool canHaveAnotherAttempt = false;
			Hashtable cv2s = uiDoorlist.CV2s;
			foreach (var key in cv2s.Keys)
			{
				string cv2 = (string)uiDoorlist.CV2s[key];
				if (cv2.Length == 0)
					continue;

				Ticket t = new Ticket((int)key);
				if (t.EventK != int.Parse(uiEvents.SelectedValue))
				{
					throw new Exception("Mismatch in event K");
				}
				if (t.TicketRun.PromoterK != CurrentPromoter.K)
				{
					throw new Exception("Mismatch in promoter K");
				}
				if (t.ConfirmCv2(cv2) == false)
				{
					mismatch = true;
					if (!t.HasExceededCardCheckAttempts)
					{
						canHaveAnotherAttempt = true;
					}
				}
			}

			this.uiDoorlist.DataBind();
			this.uiDoorlist.CV2s = cv2s;
			this.uiSomeWrongLabel.Visible = mismatch;
			this.uiSomeWrongLabel.Text = canHaveAnotherAttempt ? "Some CV2s didn't match, please check the list" : "You have exceeded maximum attempts";
		}
示例#2
0
		private void SetTicketFeedback(Ticket.FeedbackEnum feedback, string feedbackNote)
		{
			if (CurrentEvent.DateTime < DateTime.Today && CurrentUsrTickets != null && CurrentUsrTickets.Count > 0)
			{
				if (CurrentUsrTickets != null && CurrentUsrTickets.Count > 0)
				{
					// User cannot change their response once its been set, but can add a feedback note if they havent already
					if (CurrentUsrTickets[0].Feedback == Ticket.FeedbackEnum.None || (CurrentUsrTickets[0].Feedback == feedback && CurrentUsrTickets[0].FeedbackNote.Length == 0 && feedbackNote.Length > 0))
					{
						// If user has not added a feedback note, then update all user's Tickets for this Event
						foreach (Ticket ticket in CurrentUsrTickets)
						{
                            if (!ticket.Cancelled)
                            {
                                ticket.Feedback = feedback;
                                ticket.FeedbackNote = Cambro.Misc.Utility.Snip(Cambro.Web.Helpers.StripHtml(feedbackNote), 4000);
                                ticket.Update();
                                Usr.Current.SetPrefsNextTicketFeedbackDate();
                                this.ContainerPage.ShowTicketFeedbackToDo();
                            }
						}
					}
				}
			}
			LoadTicketFeedback();			
		}
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!this.IsPostBack)
			{
                if (this.ContainerPage.Url["ticketk"].Exists && this.ContainerPage.Url["ticketk"].IsInt)
				{
					CurrentTicket = new Ticket(Convert.ToInt32(this.ContainerPage.Url["ticketk"].Value));
				}
                this.ChargePromoterAmountTextBox.Text = Ticket.DEFAULT_REFUND_CHARGE.ToString("c");
			}
			LoadTicketToScreen();
		}
示例#4
0
		public string TicketCheckBoxes(Ticket ticket)
		{
			string output = "";
			if (!IsExportFile && ForExport)
			{
				for (int i = 0; i < ticket.Quantity; i++)
				{
					output += "<input id=\"Checkbox" + ticket.K.ToString() + "-" + i.ToString() + "\" type=\"checkbox\" />";
				}
			}
			return output;
		}
		protected void Page_Load(object sender, EventArgs e)
		{
			string type = "";
			int k = 0;
			int pk = 0;

			if (ContainerPage.Url["type"].Exists)
				type = ContainerPage.Url["type"].Value;

			if (ContainerPage.Url["K"].Exists && ContainerPage.Url["K"].IsInt)
				k = Convert.ToInt32(ContainerPage.Url["K"].Value);

			if (ContainerPage.Url["PK"].Exists && ContainerPage.Url["PK"].IsInt)
				pk = Convert.ToInt32(ContainerPage.Url["PK"].Value);

			//Promoter CurrentPromoter = new Promoter(pk);

			Usr.KickUserIfNotLoggedIn();

			//if (!Usr.Current.IsPromoter && !Usr.Current.IsAdmin)
			//{
			//    throw new Exception("You must be a promoter to view this page");
			//}
			//if (CurrentPromoter != null)
			//{
			//    if (!Usr.Current.IsPromoterK(CurrentPromoter.K) && !Usr.Current.IsAdmin)
			//        throw new Exception("You can't view these details.");
			//}

			if (type.ToUpper() == "STATEMENT")
			{
				Promoter promoter = new Promoter(pk);

				if (!promoter.IsUsrAllowedAccess(Usr.Current))
					throw new Exception(Vars.CANT_VIEW_DETAILS);

				int month = DateTime.Now.Month;
				int year = DateTime.Now.Year;

				if (ContainerPage.Url["M"].Exists && ContainerPage.Url["M"].IsInt)
					month = Convert.ToInt32(ContainerPage.Url["M"].Value);
				if (ContainerPage.Url["Y"].Exists && ContainerPage.Url["Y"].IsInt)
					year = Convert.ToInt32(ContainerPage.Url["Y"].Value);

				Response.Write(promoter.GenerateMonthlyStatementStringBuilder(month, year, true).ToString());
			}
            else if(type.ToUpper().Equals("TICKETFUNDSINVOICE"))
            {
                TicketPromoterEvent tpe = new TicketPromoterEvent(pk, k);
                if (!tpe.IsUsrAllowedAccess(Usr.Current))
                    throw new Exception(Vars.CANT_VIEW_DETAILS);

                Response.Write(tpe.GenerateReportStringBuilder(true).ToString());
            }
			else
			{
				IBobReport bobReport;
				switch (type.ToUpper())
				{
					case "TRANSFER": bobReport = new Transfer(k); break;
					case "INVOICE": // goto credit
					case "CREDIT": bobReport = new Bobs.Invoice(k); break;
					case "TICKET": bobReport = new Ticket(k); break;
					case "TICKETFORPRINTING": bobReport = new TicketForPrinting(k); break;
					case "INSERTIONORDER": bobReport = new InsertionOrder(k); break;
					default: bobReport = null; break;
				}

				if (bobReport != null)
				{
					if (!bobReport.IsUsrAllowedAccess(Usr.Current))
						throw new Exception(Vars.CANT_VIEW_DETAILS);

					Response.Write(bobReport.GenerateReportStringBuilder(true).ToString());
				}
			}

		}
示例#6
0
        public List<Ticket> UpdateTicketsFromPaymentControl()
        {
            List<Ticket> ticketsPurchased = new List<Ticket>();
            foreach (InvoiceDataHolder idh in this.Payment.Invoices)
            {
                if (idh.K > 0)
                {
                    Invoice invoice = new Invoice(idh.K);
					//string ticketPurchaseMessage = "You just purchased ";
					//int ticketCounter = 0;
                    foreach (InvoiceItem invoiceItem in invoice.Items)
                    {
                        if (invoiceItem.BuyableObjectType.Equals(Model.Entities.ObjectType.Ticket) && invoiceItem.Type.Equals(InvoiceItem.Types.EventTickets))
                        {
                            Ticket ticket = new Ticket(invoiceItem.BuyableObjectK);

							// Only update once. If page is refreshed, it shouldnt redo the updating of this ticket.
                            if (ticket.InvoiceItemK == 0)
                            {
                                Transfer transfer = new Transfer();

                                if (this.Payment.SecPay != null && this.Payment.SecPay.Transfer != null && this.Payment.SecPay.Transfer.K > 0)
                                    transfer = this.Payment.SecPay.Transfer;
                                else if (invoice.SuccessfulAppliedTransfers.Count > 0 && invoice.SuccessfulAppliedTransfers[0].K > 0)
                                    transfer = invoice.SuccessfulAppliedTransfers[0];

								if (transfer.K > 0)
								{
									bool ticketWasEnabled = ticket.Enabled;
									//ticket.AddressArea = Payment.CurrentUsr.AddressArea;
									ticket.AddressPostcode = transfer.CardPostcode;
									ticket.AddressStreet = transfer.CardAddress1;
									ticket.AddressCounty = transfer.CardAddressCounty;
									ticket.AddressCountryK = transfer.CardAddressCountryK;
									ticket.AddressTown = transfer.CardAddressTown;
									ticket.AddressArea = transfer.CardAddressArea;
									ticket.CardNumberDigits = transfer.CardDigits;
									ticket.CardNumberEnd = transfer.CardNumberEnd;
									ticket.CardNumberHash = transfer.CardNumberHash;
									ticket.AddressName = transfer.CardName;
									ticket.CardCV2 = transfer.CardCV2;
									string cardName = Utilities.StripTitleFromName(transfer.CardName);
									ticket.FirstName = Cambro.Misc.Utility.Snip(Utilities.GetFirstName(cardName), 100);
									ticket.LastName = Cambro.Misc.Utility.Snip(Utilities.GetLastName(cardName), 100);
									if (!ticket.Enabled && invoiceItem.K > 0 && transfer.Status == Transfer.StatusEnum.Success && Math.Round(transfer.Amount, 2) >= Math.Round(ticket.Price + ticket.BookingFee, 2) && ticket.Invoice != null && ticket.Invoice.Paid)
									{
										ticket.Enabled = true;
									}
									ticket.InvoiceItemK = invoiceItem.K;
									ticket.Mobile = Payment.CurrentUsr.Mobile;
									ticket.MobileCountryCode = Payment.CurrentUsr.MobileCountryCode;
									ticket.Update();

									if (ticket.Enabled)
									{
										Utilities.EmailTicket(ticket);
										ticketsPurchased.Add(ticket);
									}

									ticket.TicketRun.CalculateSoldTicketsAndUpdate();
								}
								else
								{
									Utilities.AdminEmailAlert("<p>Error in UpdateTicketsFromPaymentControl(). Transfer not found.</p>",
																"Error in UpdateTicketsFromPaymentControl(). Transfer not found.", new DsiUserFriendlyException("Error in UpdateTicketsFromPaymentControl()"),
																new List<IBobAsHTML>() { ticket, invoice }, new string[] { Vars.EMAIL_ADDRESS_TIMI });
								}
                            }
                        }
                    }
                }
            }

            return ticketsPurchased;
        }
示例#7
0
		private void SetTicketFeedback(Ticket.FeedbackEnum feedback)
		{
			SetTicketFeedback(feedback, "");
		}