protected void btnNotCOming_Click(object sender, EventArgs e)
        {
            string             G_ID         = Convert.ToString(Session["ID"]);
            string             eventID      = Request.QueryString["ev"];
            EventServiceClient event_client = new EventServiceClient();
            bool isRecorded = event_client.RecordRSVP(eventID, G_ID, "Declined");

            Response.Redirect("Index.aspx");
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string eventID          = Request.QueryString["EventID"];
            string GuestID          = Convert.ToString(Session["ID"]);
            TicketServiceClient tsv = new TicketServiceClient();
            string dl_BridgingTable = tsv.dl_BT_AND_QRCode(GuestID, eventID);

            if (dl_BridgingTable.ToLower().Contains("success"))
            {
                //Change RSVP Status
                EventServiceClient esc = new EventServiceClient();
                bool isChanged         = esc.RecordRSVP(eventID, GuestID, "Declined");
            }
            Response.Redirect("GuestManagement.aspx?GuestID=" + GuestID);
        }
        protected void btnComing_Click(object sender, EventArgs e)
        {
            string eventID = Request.QueryString["ev"];
            int    G_ID    = Convert.ToInt32(Session["ID"]);

            EventServiceClient event_client = new EventServiceClient();

            //Update event RSVP table
            bool isRecorded = event_client.RecordRSVP(eventID, Convert.ToString(G_ID), "Confirmed");

            //Retreive event info
            EventModel newEvent     = new EventModel();
            EventModel updatedEvent = new EventModel();

            newEvent = event_client.findByEventID(eventID);

            string ticket_Type = Convert.ToString(Session["TYPE"]);
            //Create BarCode
            TicketServiceClient tsc    = new TicketServiceClient();
            EventTicket         ticket = new EventTicket();

            if (ticket_Type.ToLower().Contains("early bird") && newEvent.EB_Quantity > 0)
            {
                ticket = tsc.getEBTicket(Convert.ToString(eventID));
                newEvent.EB_Quantity = newEvent.EB_Quantity - 1;
                updatedEvent         = event_client.updateEvent(newEvent, eventID);
            }
            else
            if (ticket_Type.ToLower().Contains("regular") && newEvent.Reg_Quantity > 0)
            {
                ticket = tsc.getRegularTicket(Convert.ToString(eventID));
                newEvent.Reg_Quantity = newEvent.Reg_Quantity - 1;
                updatedEvent          = event_client.updateEvent(newEvent, eventID);
            }
            else if (ticket_Type.ToLower().Contains("vip") && newEvent.VIP_Quantity > 0)
            {
                ticket = tsc.getVIPTicket(Convert.ToString(eventID));
                newEvent.VIP_Quantity = newEvent.VIP_Quantity - 1;
                updatedEvent          = event_client.updateEvent(newEvent, eventID);
            }
            else
            if (ticket_Type.ToLower().Contains("vvip") && newEvent.VVIP_Quantity > 0)
            {
                ticket = tsc.getVVIPTicket(Convert.ToString(eventID));
                newEvent.VVIP_Quantity = newEvent.VVIP_Quantity - 1;
                updatedEvent           = event_client.updateEvent(newEvent, eventID);
            }

            //Check if tickets sstill available
            if (ticket != null)
            {
                //Purchase ticket
                ticket._GuestID = G_ID;
                int ticketID = tsc.PurchaseTicket(ticket);
                if (ticketID != 0) //successfull transaction
                {
                    QRCodeImage img = new QRCodeImage();
                    img = GenerateCode(ticket, 1, Convert.ToString(G_ID), ticketID, eventID);
                    //Send Barcode to guest
                    EmailClient emails = new EmailClient();
                    //Find guest details
                    string Name    = Convert.ToString(Session["Name"]);
                    string Surname = Convert.ToString(Session["Surname"]);
                    string Email   = Convert.ToString(Session["Email"]);
                    emails.sendMsg_TicketPurchased(Name, Email, newEvent, img, ticket);
                    Response.Redirect("EventDetails.aspx?ev=" + eventID);
                }
            }
        }