Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int    E_ID     = Convert.ToInt32(Request.QueryString["eventID"]);
            string LoggedID = Convert.ToString(Session["ID"]);

            EventServiceClient esc    = new EventServiceClient();
            EventModel         _event = new EventModel();
            GuestServiceClient gsc    = new GuestServiceClient();
            EmailClient        email  = new EmailClient();

            List <GuestModel> gst = gsc.findGuestAttendingEvent(Convert.ToString(E_ID));

            _event = esc.findByEventID(Convert.ToString(E_ID));

            if (gst.Count() != 0)
            {
                foreach (GuestModel guest in gst)
                {
                    email.sendSurvey(guest.NAME, guest.EMAIL, _event);
                }
                Response.Redirect("EventManagement.aspx?HostID=" + LoggedID);
            }
            else
            {
                Response.Redirect("EventManagement.aspx?HostID=" + LoggedID);
            }
        }
Ejemplo n.º 2
0
        public EventModel getDetails(string eventID)
        {
            EventModel         _event      = new EventModel();
            EventServiceClient eventClient = new EventServiceClient();

            _event = eventClient.findByEventID(eventID);

            return(_event);
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //createSurvey
            //eventDesc
            int eventID = Convert.ToInt32(Request.QueryString["eventID"]);
            EventServiceClient eventClient = new EventServiceClient();
            EventModel         _event      = eventClient.findByEventID(Convert.ToString(eventID));

            eventDesc.InnerHtml = _event.Name + " Survey";
        }
Ejemplo n.º 4
0
        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);
                }
            }
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string eventID = Request.QueryString["ev"];
            int    G_ID    = Convert.ToInt32(Session["ID"]);

            EventModel           em           = new EventModel();
            ImageFile            img          = new ImageFile();
            List <ImageFile>     listimages   = new List <ImageFile>();
            List <EventProduct>  products     = new List <EventProduct>();
            EventTicket          EB_tickets   = new EventTicket();
            EventTicket          REG_tickets  = new EventTicket();
            EventTicket          VIP_tickets  = new EventTicket();
            EventTicket          VVIP_tickets = new EventTicket();
            EventServiceClient   eventClient  = new EventServiceClient();
            FileUploadClient     fuc          = new FileUploadClient();
            TicketServiceClient  tsc          = new TicketServiceClient();
            ProductServiceClient psc          = new ProductServiceClient();

            em         = eventClient.findByEventID(eventID);
            img        = fuc.getImageById(eventID);
            listimages = fuc.getMultipleImagesById(eventID);
            string    output      = "";
            string    imgLocation = "";
            ImageFile mainPic     = new ImageFile();

            if (listimages.Count == 0)
            {
                output = "/Events/eventrix-icon.png";
                string strIhtml = "<img src='" + output + "' class='img-responsive' alt=''/>";
                divImageSlider.InnerHtml     = strIhtml;
                secondaryImageSlider.Visible = false;
            }
            else
            if (listimages.Count == 1)  //one pic uploaded
            {
                imgLocation = img.Location;
                output      = imgLocation.Substring(imgLocation.IndexOf('E')); //trim string path from Event
                                                                               //image slider
                string strIhtml = "<img src='" + output + "' class='img-responsive' alt=''/>";
                divImageSlider.InnerHtml     = strIhtml;
                secondaryImageSlider.Visible = false;
            }
            else //more than one pic uploaded
            {
                mainPic     = null;
                mainPic     = listimages.First();
                imgLocation = mainPic.Location;
                output      = imgLocation.Substring(imgLocation.IndexOf('E')); //trim string path from Event
                                                                               //image slider
                string secImageLocation = listimages[1].Location;
                string strIhtml         = "<img src='" + output + "' class='img-responsive' alt=''/>";
                divImageSlider.InnerHtml = strIhtml;
                output = secImageLocation.Substring(imgLocation.IndexOf('E'));
                string secImageSlider = "<div class='item'><img src='" + output + "' class='img-responsive' alt=''/></div>";
                secondaryImageSlider.InnerHtml = secImageSlider;
            }

            string htmltag = "";

            htmltag         = "Event Name: " + em.Name;
            EName.InnerHtml = htmltag;

            htmltag             = "<span class='title'>Start Date : </span>" + em.sDate;
            StartDate.InnerHtml = htmltag;

            htmltag           = "<span class='title'>End Date : </span>" + em.eDate;
            EndDate.InnerHtml = htmltag;

            htmltag = em.Desc;
            Description.InnerHtml = htmltag;
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //delete event trigger===========================================
            string Status        = "";
            String deleterequest = (Request.QueryString["dl"]);

            if (deleterequest != null)
            {
                //delete QR Code;
                TicketServiceClient ticketToDelete = new TicketServiceClient();
                string dl_GT_BridgingTable         = "";
                string dl_ticket_template          = "";
                string dl_QRCode = ticketToDelete.dl_QRCodeByEventID(deleterequest);
                if (dl_QRCode.ToLower().Contains("success"))
                {
                    dl_GT_BridgingTable = ticketToDelete.dl_GuestTicket_BT_ByEventID(deleterequest);
                    if (dl_GT_BridgingTable.ToLower().Contains("success"))
                    {
                        dl_ticket_template = ticketToDelete.dl_TicketTemplate_byEventID(deleterequest);
                        if (dl_ticket_template.ToLower().Contains("success"))
                        {
                            Status = "\n All tickets Deleted";
                        }
                    }
                }
                FileUploadClient img         = new FileUploadClient();
                string           deleteImage = img.deleteImagebyEventID(deleterequest);
                if (deleteImage.ToLower().Contains("Failed"))
                {
                    Status += "\n Image not Delete";
                }
                else
                {
                    Status += "\n Image Delete";
                }
                StaffServiceClient ssc         = new StaffServiceClient();
                string             deletestaff = ssc.deleteStaffByEventID(deleterequest);
                if (deletestaff.ToLower().Contains("Failed"))
                {
                    Status += "\n Staff not Deleted";
                }
                else
                {
                    Status += "\n Staff Deleted";
                }
                ProductServiceClient psc = new ProductServiceClient();
                string deleteProduct     = psc.DeleteProductByEventID(deleterequest);
                if (deleteProduct.ToLower().Contains("Failed"))
                {
                    Status += "\n Product not Deleted";
                }
                else
                {
                    Status += "\n Product Deleted";
                }
                EventServiceClient esc = new EventServiceClient();
                EventModel         ev  = new EventModel();
                ev = esc.findByEventID(deleterequest);
                string deleteEvent = esc.deleteEventByID(deleterequest);
                if (deleteEvent.ToLower().Contains("Failed"))
                {
                    Status += "\n Event not Deleted";
                }
                else
                {
                    Status += "\n Event Deleted";
                    //delete event's address
                    try
                    {
                        int           Address_ID = ev.EventAddress;
                        MappingClient mapping    = new MappingClient();
                        mapping.deleteAddressByID(Convert.ToString(Address_ID));
                    }
                    catch (Exception)
                    {
                        Status += "Event Already Deleted";
                    }
                    int LoggedID = Convert.ToInt32(Session["ID"]);
                    Response.Redirect("EventManagement.aspx?HostID=" + LoggedID);
                }
            }   //done deleting an event============================================

            //display event list
            List <EventModel> display = new List <EventModel>();
            int intUserID;

            intUserID = Convert.ToInt32(Session["ID"]);
            String request = (Request.QueryString["ME"]);

            if (request != null) //If request is made
            {
                //guest's events
                //    int reqID = Convert.ToInt32(request);
                string sessionlevel = Convert.ToString(Session["Level"]);
                if (sessionlevel.ToLower().Equals("guest") && request.ToLower().Equals("1"))
                {
                    string GuestID = Convert.ToString(Session["ID"]);
                    Response.Redirect("GuestEventList.aspx?GuestID=" + GuestID);
                }

                if (request.Equals("Edit")) //Edit Event
                {
                    ImageFile        img = new ImageFile();
                    FileUploadClient fuc = new FileUploadClient();
                    display = GetEvent(intUserID);
                    string htmltag = "";
                    foreach (EventModel em in display)
                    {
                        strEventID = em.EventID;
                        string EventID     = Convert.ToString(em.EventID);
                        string imgLocation = "";
                        string output      = ""; //trim string path from Event
                                                 //   string strout = output;
                        img = fuc.getImageById(EventID);
                        if (img == null)
                        {
                            output = "Events/Eventrix_Default_Image.png";
                        }
                        else
                        {
                            imgLocation = img.Location;
                            output      = imgLocation.Substring(imgLocation.IndexOf('E')); //trim string path from Event
                        }
                        htmltag += "<div class='portfolio-item col-sm-6 col-md-4' data-groups='['all', 'numbers', 'blue', 'square']'>";
                        htmltag += "<div class='single-portfolio'>";
                        htmltag += "<img src='" + output + "' alt='' style='width: 317px; height: 190px'>";
                        //   htmltag += "<asp:Button style='padding:10px 130px;' class='btn btn-primary animated lightSpeedIn' OnClick='btnDelete_Click'><a style='color:white;' href='EditEvent.aspx?EventID=" + em.EventID + "'>Edit Event</a></asp:Button>";
                        htmltag += "<a style='padding:10px 130px;' class='btn btn-primary animated bounceIn' href='EditEvent.aspx?ed=" + em.EventID + "'>Edit Event</a>";
                        htmltag += "<div class='portfolio-links' style='width: 200px; margin-left: -120px;'>";
                        htmltag += "<li class='fa fa-link'>";
                        htmltag += "<a href='#' style='font-size:18px;";
                        htmltag += "font-family:'Roboto',sans-serif;";
                        htmltag += "color:white;'>";
                        htmltag += "<p>" + em.Name + "</p>";
                        htmltag += "<p> " + em.sDate + " </p></a>";
                        htmltag += "</li>";
                        htmltag += "<a class='image-link' href='" + output + "'><i class='fa fa-search-plus'></i></a>";
                        htmltag += "<a href='EventDetails.aspx?EventID=" + em.EventID + "'><i class='fa fa-link'></i></a>";
                        htmltag += "</div><!-- /.links -->";
                        htmltag += "</div><!-- /.single-portfolio -->";
                        htmltag += "</div><!-- /.portfolio-item -->";
                    }
                    grid.InnerHtml = htmltag;
                }
                else if (request.Equals("Delete")) //Delete Event
                {
                    ImageFile        img = new ImageFile();
                    FileUploadClient fuc = new FileUploadClient();
                    display = GetEvent(intUserID);
                    string htmltag     = "";
                    string imgLocation = "";
                    foreach (EventModel em in display)
                    {
                        string output  = "";
                        string EventID = Convert.ToString(em.EventID);
                        img = fuc.getImageById(EventID);
                        if (img == null)
                        {
                            output = "Events/Eventrix_Default_Image.png";
                        }
                        else
                        {
                            imgLocation = img.Location;
                            output      = imgLocation.Substring(imgLocation.IndexOf('E')); //trim string path from Event
                        }                                                                  //                                                                 //   string strout = output;
                                                                                           //    htmltag += "<a href='EventDetails.aspx'><i class='fa fa-link'></i></a>";
                        htmltag += "<div class='portfolio-item col-sm-6 col-md-4' data-groups='['all', 'numbers', 'blue', 'square']'>";
                        htmltag += "<div class='single-portfolio'>";
                        htmltag += "<img src='" + output + "' alt='' style='width: 317px; height: 190px'>";
                        htmltag += "<a style='padding:10px 130px;' class='btn btn-primary animated bounceIn' href='EventList.aspx?dl=" + em.EventID + "'>Delete Event</a>";
                        htmltag += "<div class='portfolio-links' style='width: 200px; margin-left: -120px;'>";
                        htmltag += "<li class='fa fa-link'>";
                        htmltag += "<a href='#' style='font-size:18px;";
                        htmltag += "font-family:'Roboto',sans-serif;";
                        htmltag += "color:white;'>";
                        htmltag += "<p>" + em.Name + "</p>";
                        htmltag += "<p>" + em.sDate + " </p></a>";
                        htmltag += "</li>";
                        htmltag += "<a class='image-link' href='" + output + "'><i class='fa fa-search-plus'></i></a>";
                        htmltag += "<a href='EventDetails.aspx?EventID=" + em.EventID + "'><i class='fa fa-link'></i></a>";
                        htmltag += "</div><!-- /.links -->";
                        htmltag += "</div><!-- /.single-portfolio -->";
                        htmltag += "</div><!-- /.portfolio-item -->";
                    }
                    grid.InnerHtml = htmltag;
                }
                else if (request.Equals("EventReport"))  //Event Report
                {
                    ImageFile        img = new ImageFile();
                    FileUploadClient fuc = new FileUploadClient();
                    display = GetEvent(intUserID);
                    string htmltag     = "";
                    string imgLocation = "";
                    foreach (EventModel em in display)
                    {
                        string output  = "";
                        string EventID = Convert.ToString(em.EventID);
                        img = fuc.getImageById(EventID);
                        if (img == null)
                        {
                            output = "Events/Eventrix_Default_Image.png";
                        }
                        else
                        {
                            imgLocation = img.Location;
                            output      = imgLocation.Substring(imgLocation.IndexOf('E')); //trim string path from Event
                        }                                                                  //                                                                 //   string strout = output;
                                                                                           //    htmltag += "<a href='EventDetails.aspx'><i class='fa fa-link'></i></a>";
                        htmltag += "<div class='portfolio-item col-sm-6 col-md-4' data-groups='['all', 'numbers', 'blue', 'square']'>";
                        htmltag += "<div class='single-portfolio'>";
                        htmltag += "<img src='" + output + "' alt='' style='width: 317px; height: 190px'>";
                        //AAFReport.aspx?eventID=" + strEventID
                        htmltag += "<a style='padding:10px 130px;' class='btn btn-primary animated bounceIn' href='AAFReport.aspx?eventID=" + em.EventID + "'>Event Report</a>";
                        htmltag += "<div class='portfolio-links' style='width: 200px; margin-left: -120px;'>";
                        htmltag += "<li class='fa fa-link'>";
                        htmltag += "<a href='#' style='font-size:18px;";
                        htmltag += "font-family:'Roboto',sans-serif;";
                        htmltag += "color:white;'>";
                        htmltag += "<p>" + em.Name + "</p>";
                        htmltag += "<p>" + em.sDate + " </p></a>";
                        htmltag += "</li>";
                        htmltag += "<a class='image-link' href='" + output + "'><i class='fa fa-search-plus'></i></a>";
                        htmltag += "<a href='EventDetails.aspx?EventID=" + em.EventID + "'><i class='fa fa-link'></i></a>";
                        htmltag += "</div><!-- /.links -->";
                        htmltag += "</div><!-- /.single-portfolio -->";
                        htmltag += "</div><!-- /.portfolio-item -->";
                    }
                    grid.InnerHtml = htmltag;
                }
                else //View "My Event"
                {
                    Response.Redirect("HostEventList.aspx?HostID=" + intUserID);
                }
            }
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string eventID = Request.QueryString["ev"];
            // GetNumViews(string eventID, string Type)
            EventServiceClient  esv          = new EventServiceClient();
            ReportServiceClient reportClient = new ReportServiceClient();
            EventModel          myEvent      = new EventModel();
            //Get Number of Event Vies
            int    EventViews      = esv.GetNumViews(eventID, "Views");
            int    EventShares     = esv.GetNumViews(eventID, "Shares");
            string RecentShareDate = reportClient.GetLatestView(eventID, "Shares");
            string RecentViewDate  = reportClient.GetLatestView(eventID, "Views");

            numViews.InnerHtml  = Convert.ToString(EventViews);
            numShares.InnerHtml = Convert.ToString(EventShares);
            ViewDate.InnerHtml  = RecentViewDate;
            shareDate.InnerHtml = RecentShareDate;
            //Get Event Details
            myEvent = esv.findByEventID(eventID);

            //EventProduct
            //getProductByEventID(string EventID)
            ProductServiceClient psv     = new ProductServiceClient();
            List <EventProduct>  product = new List <EventProduct>();

            product = psv.getProductByEventID(eventID);
            if (product.Count() != 0)
            {
                string htmtag = "";
                int    count  = 1;
                foreach (EventProduct _prod in product)
                {
                    double productSold = _prod._Quantity - _prod.ProdRemaining;

                    double half = Math.Round((double)(_prod._Quantity) / 2, 2);
                    double perc = Math.Round((productSold / _prod._Quantity) * 100);
                    htmtag += "<tr>";
                    htmtag += "<td scope ='row' style='text-align:center;'>" + count + "</td>";
                    htmtag += "<td style='text-align:center;'>" + _prod._Name + "</td>";
                    if (productSold > _prod.ProdRemaining)  //sold more than half of toltal product
                    {
                        htmtag += "<td style='text-align:center;'><span class='label label-success'>" + productSold + "</span></td>";
                        htmtag += "<td style='text-align:center;'><span class='label label-success'>" + _prod.ProdRemaining + "</span></td>";
                        htmtag += "<td style='text-align:center;'><h5>" + perc + "%<i class='fa fa-level-up'></i></h5></td></tr>";
                    }
                    else //Less than half of the product were sold
                    {
                        htmtag += "<td style='text-align:center;'><span class='label label-danger'>" + productSold + "</span></td>";
                        htmtag += "<td style='text-align:center;'><span class='label label-danger'>" + _prod.ProdRemaining + "</span></td>";
                        htmtag += "<td style='text-align:center;'><h5>" + perc + "%<i class='fa fa-level-down'></i></h5></td></tr>";
                    }
                    count++;
                }
                ProductRowDiv.InnerHtml = htmtag;


                //Number Scans Per Work Stations
                //string html = "";
                //int count = 0;
                //for (int i = 0; i < 4; i++)
                //{
                //    count = i + 50;
                //    html += "<div class='col-md-3 col-sm-6'>";
                //    html += "<div class='our-progress' >";
                //    html += "<div class='chart' data-percent='" + count + "'>";
                //    html += "<span class='percent'>" + count + "</span>";
                //    html += "</div></div></div>";
                //    count += 20;
                //}
                //piechart.InnerHtml = html;
                //  String request = (Request.QueryString["EventID"]);
                // string eventID = Request.QueryString["EventID"];
                List <StaffModel>   StaffList      = new List <StaffModel>();
                List <double>       percentageList = new List <double>();
                ReportServiceClient _report        = new ReportServiceClient();
                StaffList = _report.GetMostUsedWorkstation(eventID);
                if (StaffList != null)
                {
                    percentageList = calculatepercentage(StaffList);
                    string html = "";
                    for (int i = 0; i < percentageList.Count(); i++)
                    {
                        html += "<div class='col-md-3 col-sm-6'>";
                        html += "<div class='Number of Tickets by Type' >";
                        html += "<div class='chart' data-percent='" + percentageList[i] + "'>";
                        html += "<span class='percent'>" + percentageList[i] + "</span></div>";
                        html += "<span>" + StaffList[i].NAME + "</span>";
                        html += "<span>" + StaffList[i].WorkStation + "</span>";
                        html += "</div></div>";
                    }
                    piechart.InnerHtml = html;
                }
                //Track Most CHecked In Entrance
                List <StaffModel> ch_StaffList      = new List <StaffModel>();
                List <double>     ch_percentageList = new List <double>();
                ch_StaffList = _report.GetMostCheckedinEntrance(eventID);
                if (ch_StaffList != null)
                {
                    ch_percentageList = calculatepercentage(ch_StaffList);
                    string html = "";
                    for (int i = 0; i < ch_percentageList.Count(); i++)
                    {
                        html += "<div class='col-md-3 col-sm-6'>";
                        html += "<div class='Number of Tickets by Type' >";
                        html += "<div class='chart' data-percent='" + ch_percentageList[i] + "'>";
                        html += "<span class='percent'>" + ch_percentageList[i] + "</span></div>";
                        html += "<span>" + ch_StaffList[i].NAME + "</span>";
                        html += "<span>" + ch_StaffList[i].WorkStation + "</span>";
                        html += "</div></div>";
                    }
                    DivCheckedIn.InnerHtml = html;
                }
            }
            //Declined Guest
            List <GuestModel> Declinedguests = new List <GuestModel>();

            Declinedguests = reportClient.RSVPGuest(eventID, "Declined");
            //declinedRSVP.InnerHtml = Convert.ToString(Declinedguests.Count());
            //list of RSVP'd geust
            //RSVPd_Guest
            if (Declinedguests.Count() != 0)
            {
                string htmltage = "";
                foreach (GuestModel guest in Declinedguests)
                {
                    htmltage += "<li>Guest Name: " + guest.NAME + ", Email: " + guest.EMAIL + "</li>";
                }
                //Send to front End
            }


            //Get Number of RSVP'd guest
            List <GuestModel> Confirmedguests = new List <GuestModel>();

            Confirmedguests = reportClient.RSVPGuest(eventID, "Confirmed");
            // confirmedRSVP.InnerHtml = Convert.ToString(Confirmedguests.Count());
            //list of RSVP'd geust
            //RSVPd_Guest
            if (Confirmedguests.Count() != 0)
            {
                string htmltage = "";
                foreach (GuestModel guest in Confirmedguests)
                {
                    htmltage += "<li>Guest Name: " + guest.NAME + ", Email: " + guest.EMAIL + "</li>";
                }
                //Send to front End
                // RSVPd_Guest.InnerHtml = htmltage;
            }
        }
Ejemplo n.º 8
0
        // string reqEventID = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            String request = (Request.QueryString["EventID"]);

            // reqEventID = request;
            if (!IsPostBack)
            {
                if (request == null)
                {
                    request = (Request.QueryString["ed"]);
                }
                int EventID = Convert.ToInt32(request);
                strEventID = EventID;
                EventModel          em           = new EventModel();
                ImageFile           img          = new ImageFile();
                List <EventProduct> products     = new List <EventProduct>();
                EventTicket         EB_tickets   = new EventTicket();
                EventTicket         REG_tickets  = new EventTicket();
                EventTicket         VIP_tickets  = new EventTicket();
                EventTicket         VVIP_tickets = new EventTicket();
                EventAddress        _address     = new EventAddress();
                //Service Clients
                EventServiceClient   eventClient = new EventServiceClient();
                FileUploadClient     fuc         = new FileUploadClient();
                TicketServiceClient  tsc         = new TicketServiceClient();
                ProductServiceClient psc         = new ProductServiceClient();
                MappingClient        mc          = new MappingClient();

                //Gett Functions
                em = eventClient.findByEventID(request);
                string addID = Convert.ToString(em.EventAddress);
                AddressID    = Convert.ToInt32(addID);
                img          = fuc.getImageById(request);
                EB_tickets   = tsc.getEBTicket(request);
                REG_tickets  = tsc.getRegularTicket(request);
                VIP_tickets  = tsc.getVIPTicket(request);
                VVIP_tickets = tsc.getVVIPTicket(request);
                products     = psc.getProductByEventID(request);
                _address     = mc.getAddressById(addID);
                //First Tab
                divHearderName.InnerHtml = "Edit " + em.Name;
                txtEventName.Text        = em.Name;
                txtDesc.Text             = em.Desc;
                txtStart.Text            = Convert.ToString(em.sDate);
                txtEnd.Text = Convert.ToString(em.eDate);

                //Ticket Section
                if (EB_tickets == null)
                {
                    txtE_Price.Text       = "";
                    txtE_Quantity.Text    = "";
                    txtE_Token.Text       = "";
                    txtE_OpenDate.Text    = "";
                    txtE_ClosingDate.Text = "";
                }
                else
                {
                    txtE_Price.Text       = Convert.ToString(EB_tickets._Price);
                    txtE_Quantity.Text    = Convert.ToString(em.EB_Quantity);
                    txtE_Token.Text       = Convert.ToString(EB_tickets._Credit);
                    txtE_OpenDate.Text    = Convert.ToString(EB_tickets._StartDate);
                    txtE_ClosingDate.Text = Convert.ToString(EB_tickets._EndDate);
                }

                if (REG_tickets == null)
                {
                    txtR_Price.Text       = "";
                    txtR_Quantity.Text    = "";
                    txtR_Token.Text       = "";
                    txtR_OpenDate.Text    = "";
                    txtR_ClosingDate.Text = "";
                }
                else
                {
                    txtR_Price.Text       = Convert.ToString(REG_tickets._Price);
                    txtR_Quantity.Text    = Convert.ToString(em.Reg_Quantity);
                    txtR_Token.Text       = Convert.ToString(REG_tickets._Credit);
                    txtR_OpenDate.Text    = Convert.ToString(REG_tickets._StartDate);
                    txtR_ClosingDate.Text = Convert.ToString(REG_tickets._EndDate);
                }
                if (VIP_tickets == null)
                {
                    txtV_Price.Text       = "";
                    txtV_Quantity.Text    = "";
                    txtV_Token.Text       = "";
                    txtV_OpenDate.Text    = "";
                    txtV_ClosingDate.Text = "";
                }
                else
                {
                    txtV_Price.Text       = Convert.ToString(VIP_tickets._Price);
                    txtV_Quantity.Text    = Convert.ToString(em.VIP_Quantity);
                    txtV_Token.Text       = Convert.ToString(VIP_tickets._Credit);
                    txtV_OpenDate.Text    = Convert.ToString(VIP_tickets._StartDate);
                    txtV_ClosingDate.Text = Convert.ToString(VIP_tickets._EndDate);
                }

                if (VVIP_tickets == null)
                {
                    txtVV_Price.Text       = "";
                    txtVV_Quantity.Text    = "";
                    txtVV_Token.Text       = "";
                    txtVV_OpenDate.Text    = "";
                    txtVV_ClosingDate.Text = "";
                }
                else
                {
                    txtVV_Price.Text       = Convert.ToString(VVIP_tickets._Price);
                    txtVV_Quantity.Text    = Convert.ToString(em.VVIP_Quantity);
                    txtVV_Token.Text       = Convert.ToString(VVIP_tickets._Credit);
                    txtVV_OpenDate.Text    = Convert.ToString(VVIP_tickets._StartDate);
                    txtVV_ClosingDate.Text = Convert.ToString(VVIP_tickets._EndDate);
                }

                //Address
                txtStreet.Text   = _address.STREET;
                txtCity.Text     = _address.CITY;
                txtProvince.Text = _address.PROVINCE;
                txtCountry.Text  = _address.COUNTRY;
            }
        }
Ejemplo n.º 9
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string EVENT_TRACKER;
            string SUBFOLDER = "Main_Image";
            int    hostID    = Convert.ToInt32(Session["ID"].ToString());
            String request   = (Request.QueryString["EventID"]);

            if (request == null)
            {
                request = (Request.QueryString["ed"]);
            }
            EventServiceClient _eventClient = new EventServiceClient();
            EventModel         oldEvent     = new EventModel();

            oldEvent = _eventClient.findByEventID(request);

            //Editing  Address
            EventAddress  currentAdd = new EventAddress();
            EventAddress  Oldadd     = new EventAddress();
            MappingClient mc         = new MappingClient();

            currentAdd = mc.getAddressById(Convert.ToString(oldEvent.EventAddress));
            if (txtCountry.Text.Equals(""))
            {
                Oldadd.COUNTRY = currentAdd.COUNTRY;
            }
            else
            {
                Oldadd.COUNTRY = txtCountry.Text;
            }
            if (txtCity.Text.Equals(""))
            {
                Oldadd.CITY = currentAdd.CITY;
            }
            else
            {
                Oldadd.CITY = txtCity.Text;
            }
            if (txtStreet.Text.Equals(""))
            {
                Oldadd.STREET = currentAdd.STREET;
            }
            else
            {
                Oldadd.STREET = txtStreet.Text;
            }
            if (txtProvince.Text.Equals(""))
            {
                Oldadd.PROVINCE = currentAdd.PROVINCE;
            }
            else
            {
                Oldadd.PROVINCE = txtProvince.Text;
            }
            EventAddress newAddress = new EventAddress();

            newAddress = mc.EditAddress(Oldadd, Convert.ToString(oldEvent.EventAddress));

            EventModel _event = new EventModel();

            _event.HostID = oldEvent.HostID;
            _event.Name   = txtEventName.Text;  //Event Name
            if (chkBoxPrivate.Checked == true)  //Public or Private Event
            {
                _event.Type = "Private";
            }
            else
            {
                _event.Type = "Public";
            }
            _event.Desc = txtDesc.Text; //Event Description
            string startdate = "";
            string enddate   = "";

            //DateTime sDate = DateTime.ParseExact(startdate, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
            //DateTime eDate = DateTime.ParseExact(enddate, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
            //_event.sDate = sDate; //Event Start Date
            //_event.eDate = eDate; //Event End Date

            if (txtStart.Text.Equals(""))
            {
                _event.sDate = oldEvent.sDate;
            }
            else
            {
                // _event.sDate = DateTime.ParseExact(txtStart.Text, "yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);
                //var date = DateTime.Parse(strDate,new CultureInfo("en-US", true))
                _event.sDate = Convert.ToString(DateTime.Parse(txtStart.Text, new CultureInfo("en-US", true)));
            }
            if (txtEnd.Text.Equals(""))
            {
                _event.eDate = oldEvent.eDate;
            }
            else
            {
                //  _event.eDate = DateTime.ParseExact(txtEnd.Text, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
                _event.eDate = Convert.ToString(DateTime.Parse(txtEnd.Text, new CultureInfo("en-US", true)));
            }
            _event.EventAddress = newAddress.ID;   //Event's address ID
            //check ticket field
            if (!txtE_Quantity.Text.Equals(""))
            {
                _event.EB_Quantity = Convert.ToInt32(txtE_Quantity.Text);
            }
            else
            {
                _event.EB_Quantity = 0;
            }

            if (!txtR_Quantity.Text.Equals(""))
            {
                _event.Reg_Quantity = Convert.ToInt32(txtR_Quantity.Text);
            }
            else
            {
                _event.Reg_Quantity = 0;
            }

            if (!txtV_Quantity.Text.Equals(""))
            {
                _event.VIP_Quantity = Convert.ToInt32(txtV_Quantity.Text);
            }
            else
            {
                _event.VIP_Quantity = 0;
            }
            if (!txtVV_Quantity.Text.Equals(""))
            {
                _event.VVIP_Quantity = Convert.ToInt32(txtVV_Quantity.Text);
            }
            else
            {
                _event.VVIP_Quantity = 0;
            }
            //Edit Event Event
            EventServiceClient _editEvent = new EventServiceClient();
            EventModel         newEvent   = new EventModel();

            newEvent = _editEvent.updateEvent(_event, request);
            bool isCreatedTicket = false;   //Ticket Controller

            EVENT_TRACKER = "Event Edited successfully";
            //Import users
            //string ImportSpreadsheet = "";
            //ImportSpreadsheet = ImportData(flGuest, newEvent.EventID);

            //===================Import guest,staff and products============================//

            string         path                 = "";
            string         response             = "";
            bool           isValidGuestColumn   = false;
            bool           isValidStaffColumn   = false;
            bool           isValidProductColumn = false;
            int            startColumn          = 0;
            int            startRow             = 0;
            ExcelWorksheet GuestworkSheet       = null;
            ExcelWorksheet StaffworkSheet       = null;
            ExcelWorksheet ProductworkSheet     = null;
            int            count                = 0;

            if (flGuest.HasFile)
            {
                try
                {
                    string filename       = Path.GetFileName(flGuest.FileName);
                    string serverLocation = "~/Temp/" + "/" + filename;
                    string SaveLoc        = Server.MapPath(serverLocation);
                    flGuest.SaveAs(SaveLoc);
                    path = Server.MapPath("/") + "\\Temp\\" + filename;

                    var package = new ExcelPackage(new System.IO.FileInfo(path));
                    ////  package.Workbook.Worksheets["TABNAME"].View.TabSelected = true;
                    startColumn      = 1;                              //where the file in the class excel start
                    startRow         = 2;
                    GuestworkSheet   = package.Workbook.Worksheets[1]; //read sheet one
                    StaffworkSheet   = package.Workbook.Worksheets[2]; //read sheet two
                    ProductworkSheet = package.Workbook.Worksheets[3];

                    isValidGuestColumn   = ValidateGuestColumns(GuestworkSheet);
                    isValidStaffColumn   = ValidateStaffColumns(StaffworkSheet);
                    isValidProductColumn = ValidateProductColumns(ProductworkSheet);
                    // isValidColumn = true;
                }
                catch
                {
                    response += "Failed";
                }
                //check staff sheet
                object data = null;
                if (isValidStaffColumn == true && isValidGuestColumn == true && isValidProductColumn == true)
                {
                    do
                    {
                        data = StaffworkSheet.Cells[startRow, startColumn].Value; //column Number
                        if (data == null)
                        {
                            continue;
                        }
                        //read column class name
                        object     Name       = StaffworkSheet.Cells[startRow, startColumn].Value;
                        object     Email      = StaffworkSheet.Cells[startRow, startColumn + 1].Value;
                        object     Occupation = StaffworkSheet.Cells[startRow, startColumn + 2].Value;
                        StaffModel _staff     = new StaffModel();
                        _staff.NAME       = Name.ToString();
                        _staff.EMAIL      = Email.ToString();
                        _staff.Occupation = Occupation.ToString();
                        _staff.PASS       = "******";
                        _staff.EventID    = newEvent.EventID;
                        //edit to db
                        StaffServiceClient ssv = new StaffServiceClient();
                        bool isCreated         = ssv.createStaff(_staff);
                        if (isCreated == true)
                        {
                            count++;
                        }
                        startRow++;
                    } while (data != null);

                    data        = null;
                    startColumn = 1;  //where the file in the class excel start
                    startRow    = 2;
                    do
                    {
                        data = GuestworkSheet.Cells[startRow, startColumn].Value; //column Number
                        if (data == null)
                        {
                            continue;
                        }
                        object     Name    = GuestworkSheet.Cells[startRow, startColumn].Value;
                        object     Surname = GuestworkSheet.Cells[startRow, startColumn + 1].Value;
                        object     Email   = GuestworkSheet.Cells[startRow, startColumn + 2].Value;
                        GuestModel _guest  = new GuestModel();
                        _guest.NAME    = Name.ToString();
                        _guest.SURNAME = Surname.ToString();
                        _guest.EMAIL   = Email.ToString();
                        _guest.PASS    = "******";
                        _guest.TYPE    = "Private";
                        Eventrix_Client.Registration reg = new Eventrix_Client.Registration();
                        //   response = reg.RegisterGuest(_guest);
                        sendMsg(_guest, _event);
                        if (response.Contains("successfully"))
                        {
                            count++;
                        }
                        startRow++;
                    } while (data != null);

                    //upload product details
                    data        = null;
                    startColumn = 1;  //where the file in the class excel start
                    startRow    = 2;
                    do
                    {
                        data = ProductworkSheet.Cells[startRow, startColumn].Value; //column Number
                        if (data == null)
                        {
                            continue;
                        }
                        object       Name        = ProductworkSheet.Cells[startRow, startColumn].Value;
                        object       Description = ProductworkSheet.Cells[startRow, startColumn + 1].Value;
                        object       Quantity    = ProductworkSheet.Cells[startRow, startColumn + 2].Value;
                        object       Price       = ProductworkSheet.Cells[startRow, startColumn + 3].Value;
                        EventProduct _product    = new EventProduct();
                        _product._Name = Name.ToString();
                        //     _product._Desc = Description.ToString();
                        _product._Quantity = Convert.ToInt32(Quantity.ToString());
                        _product._Price    = Convert.ToInt32(Price.ToString());
                        _product.EventID   = newEvent.EventID;
                        ProductServiceClient psv = new ProductServiceClient();
                        //  string isProductUpdated = psv.createProduct(_product);
                        string isProductUpdated = psv.createProduct(_product);
                        if (isProductUpdated.Contains("success"))
                        {
                            count++;
                        }
                        startRow++;
                    } while (data != null);
                    //check record
                    if (count == (GuestworkSheet.Dimension.Rows - 1) + (StaffworkSheet.Dimension.Rows - 1) + (ProductworkSheet.Dimension.Rows - 1))
                    {
                        response = "success: All Records uploaded";
                    }
                    else
                    {
                        response = "success: Not All Records uploaded";
                    }
                }
                else
                {
                    response += " Failed to upload Exceel: Check columns";
                }
            }
            else
            {
                response = "Failed: File not found";
            }


            //==============================================================================//
            if (response.Contains("success"))
            {
                EVENT_TRACKER += "\n Spreadsheet Uploaded";
                //Create Tickets
                isCreatedTicket = isLoadedTicket(newEvent, newEvent.EventID);
                if (isCreatedTicket == true)
                {
                    EVENT_TRACKER += "\n Ticket Created";
                }
                else
                {
                    EVENT_TRACKER += "\n Failed to upload ticket";
                }
            }
            else
            {
                EVENT_TRACKER += "\n Spreadsheet Uploaded";
                //Create Tickets
                isCreatedTicket = isLoadedTicket(newEvent, newEvent.EventID);
                if (isCreatedTicket == true)
                {
                    EVENT_TRACKER += "\n Ticket Created";
                }
                else
                {
                    EVENT_TRACKER += "\n Failed to upload ticket";
                }
                //Unable to upload guest
                EVENT_TRACKER += "\n failed to upload spreadsheet";
            }

            ////Upload images
            ImageFile mainPic = new ImageFile();

            mainPic = UploadFile(flEventImages, Convert.ToString(newEvent.EventID), SUBFOLDER); //Upload Event Main's Image to client directory
            if (mainPic != null)
            {
                FileUploadClient fuc    = new FileUploadClient();
                string           res1   = fuc.saveImage(mainPic); //Upload Event Main's Image to Database
                string           number = res1;
            }
            Response.Redirect("EventDetails.aspx?EventID=" + newEvent.EventID);

            //  Response.Write("<script> Alert("+ EVENT_TRACKER + ");</script>");
        }
        protected void btnSave_Click1(object sender, EventArgs e)
        {
            int numTicket = Convert.ToInt32(txtQtys.Text);  // event's ticket quantity

            //edit ticket by ticket id --create new ticket with ticket
            eventID = Request.QueryString["E_ID"];
            EventTicket         EB_tickets   = new EventTicket();
            EventTicket         REG_tickets  = new EventTicket();
            EventTicket         VIP_tickets  = new EventTicket();
            EventTicket         VVIP_tickets = new EventTicket();
            TicketServiceClient tsc          = new TicketServiceClient();
            EventModel          currentEvent = new EventModel();
            EventServiceClient  esc          = new EventServiceClient();

            currentEvent = esc.findByEventID(eventID);
            EventModel newEvent = new EventModel();   //event to be updated

            //validate ticket selected
            EB_TicketID = Request.QueryString["EBT_ID"];
            if (EB_TicketID == null)
            {
                RG_TicketID = Request.QueryString["RBT_ID"];
                if (RG_TicketID == null)
                {
                    VIP_TicketID = Request.QueryString["VT_ID"];
                    if (VIP_TicketID == null)
                    {
                        VVIP_TicketID = Request.QueryString["VVT_ID"];
                        if (VVIP_TicketID == null)
                        {
                            //free event
                        }
                        else  //get vvip ticket info by ticket id
                        {
                            int currentNumTicket = currentEvent.VVIP_Quantity;
                            if (currentNumTicket >= numTicket)
                            {
                                for (int i = 0; i < numTicket; i++)
                                {
                                    VVIP_tickets           = tsc.getVIPTicket(eventID);
                                    VVIP_tickets._GuestID  = Convert.ToInt32(LoggedID);
                                    VVIP_tickets.numTicket = numTicket;
                                    int purchased_Ticket_ID;
                                    //   int purchasedTicektID = 0;
                                    purchased_Ticket_ID = tsc.PurchaseTicket(VVIP_tickets);
                                    if (purchased_Ticket_ID != 0)
                                    {
                                        purchased_Ticket_ID = Convert.ToInt32(purchased_Ticket_ID);
                                        //QR Code
                                        QRCodeImage qrCode = new QRCodeImage();
                                        qrCode = GenerateCode(VVIP_tickets, numTicket, LoggedID, purchased_Ticket_ID, eventID);
                                        //decrement ticket quantity in main event table
                                        currentEvent.VVIP_Quantity = currentNumTicket - numTicket;
                                        newEvent = esc.updateEvent(currentEvent, eventID);
                                        EmailClient emails = new EmailClient();
                                        //guest, newEvent, EventTicket,
                                        EventServiceClient EventClient = new EventServiceClient();
                                        EventModel         items       = EventClient.findByEventID(eventID);
                                        emails.sendMsg_TicketPurchased(Name, Email, items, qrCode, VVIP_tickets);
                                    }
                                }
                                Response.Redirect("EventDetails.aspx?ev=" + eventID);
                            }
                        }
                    }
                    else //get vip ticket info by ticket id
                    {
                        int currentNumTicket = currentEvent.VIP_Quantity;
                        if (currentNumTicket >= numTicket)
                        {
                            for (int i = 0; i < numTicket; i++)
                            {
                                VIP_tickets           = tsc.getVIPTicket(eventID);
                                VIP_tickets._GuestID  = Convert.ToInt32(LoggedID);
                                VIP_tickets.numTicket = numTicket;
                                int purchased_Ticket_ID;
                                //   int purchasedTicektID = 0;
                                purchased_Ticket_ID = tsc.PurchaseTicket(VIP_tickets);
                                if (purchased_Ticket_ID != 0)
                                {
                                    purchased_Ticket_ID = Convert.ToInt32(purchased_Ticket_ID);
                                    //QR Code
                                    QRCodeImage qrCode = new QRCodeImage();
                                    qrCode = GenerateCode(VIP_tickets, numTicket, LoggedID, purchased_Ticket_ID, eventID);
                                    //decrement ticket quantity in main event table
                                    currentEvent.VIP_Quantity = currentNumTicket - numTicket;
                                    newEvent = esc.updateEvent(currentEvent, eventID);
                                    EmailClient emails = new EmailClient();
                                    //guest, newEvent, EventTicket,
                                    EventServiceClient EventClient = new EventServiceClient();
                                    EventModel         items       = EventClient.findByEventID(eventID);
                                    emails.sendMsg_TicketPurchased(Name, Email, items, qrCode, VIP_tickets);
                                }
                            }
                            Response.Redirect("EventDetails.aspx?ev=" + eventID);
                        }
                    }
                }
                else  //get regular ticket info by ticket id
                {
                    int currentNumTicket = currentEvent.Reg_Quantity;
                    if (currentNumTicket >= numTicket)
                    {
                        for (int i = 0; i < numTicket; i++)
                        {
                            REG_tickets           = tsc.getRegularTicket(eventID);
                            REG_tickets._GuestID  = Convert.ToInt32(LoggedID);
                            REG_tickets.numTicket = numTicket;
                            int purchased_Ticket_ID = 0;
                            //   int purchasedTicektID = 0;
                            purchased_Ticket_ID = tsc.PurchaseTicket(REG_tickets);
                            if (purchased_Ticket_ID != 0)
                            {
                                //QR Code
                                QRCodeImage qrCode = new QRCodeImage();
                                qrCode = GenerateCode(REG_tickets, numTicket, LoggedID, purchased_Ticket_ID, eventID);
                                //decrement ticket quantity in main event table
                                currentEvent.Reg_Quantity = currentNumTicket - numTicket;
                                newEvent = esc.updateEvent(currentEvent, eventID);

                                EmailClient emails = new EmailClient();
                                //guest, newEvent, EventTicket,
                                EventServiceClient EventClient = new EventServiceClient();
                                EventModel         items       = EventClient.findByEventID(eventID);
                                emails.sendMsg_TicketPurchased(Name, Email, items, qrCode, REG_tickets);
                            }
                        }
                        Response.Redirect("EventDetails.aspx?ev=" + eventID);
                    }
                }
            }
            else //get early bird ticket info by ticket id
            {
                int currentNumTicket = currentEvent.EB_Quantity;
                if (currentNumTicket >= numTicket)
                {
                    for (int i = 0; i < numTicket; i++)
                    {
                        EB_tickets           = tsc.getEBTicket(eventID);
                        EB_tickets._GuestID  = Convert.ToInt32(LoggedID);
                        EB_tickets.numTicket = numTicket;
                        int purchased_Ticket_ID;
                        //   int purchasedTicektID = 0;
                        purchased_Ticket_ID = tsc.PurchaseTicket(EB_tickets);
                        if (purchased_Ticket_ID != 0)
                        {
                            purchased_Ticket_ID = Convert.ToInt32(purchased_Ticket_ID);
                            //QR Code
                            QRCodeImage qrCode = new QRCodeImage();
                            qrCode = GenerateCode(EB_tickets, numTicket, LoggedID, purchased_Ticket_ID, eventID);
                            //decrement ticket quantity in main event table
                            FileUploadClient fuc = new FileUploadClient();

                            currentEvent.EB_Quantity = currentNumTicket - numTicket;
                            newEvent = esc.updateEvent(currentEvent, eventID);
                            EmailClient emails = new EmailClient();
                            //guest, newEvent, EventTicket,
                            EventServiceClient EventClient = new EventServiceClient();
                            EventModel         items       = EventClient.findByEventID(eventID);
                            emails.sendMsg_TicketPurchased(Name, Email, items, qrCode, EB_tickets);
                        }
                    }

                    Response.Redirect("EventDetails.aspx?ev=" + eventID);
                }
                else
                {
                    //sold out
                }
            }
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string eventID = Request.QueryString["ev"];

            // GetNumViews(string eventID, string Type)
            EventServiceClient  esv          = new EventServiceClient();
            ReportServiceClient reportClient = new ReportServiceClient();
            EventModel          myEvent      = new EventModel();
            //Get Number of Event Vies
            int    EventViews      = esv.GetNumViews(eventID, "Views");
            int    EventShares     = esv.GetNumViews(eventID, "Shares");
            string RecentShareDate = reportClient.GetLatestView(eventID, "Shares");
            string RecentViewDate  = reportClient.GetLatestView(eventID, "Views");

            numViews.InnerHtml  = Convert.ToString(EventViews);
            numShares.InnerHtml = Convert.ToString(EventShares);
            ViewDate.InnerHtml  = RecentViewDate;
            shareDate.InnerHtml = RecentShareDate;



            String request   = (Request.QueryString["ev"]);
            string HostLevel = Convert.ToString(Session["Level"]);
            int    HostID    = Convert.ToInt32(Session["ID"]);

            //Trigger event views
            EventServiceClient evsc    = new EventServiceClient();
            EventViews         newView = new EventViews();

            newView.E_ID = Convert.ToInt32(request);
            if (HostLevel.ToLower().Equals("host"))
            {
                MapVsReportContainer.InnerHtml = "<span class='title' style='text-align:center;'>Ticket Statistics</span>";
                EventServiceClient Service_Client = new EventServiceClient();
                EventModel         _event         = new EventModel();
                _event = Service_Client.findByEventID(request);
                if (_event.HostID == HostID)
                {
                    btnDelete.Visible = true;
                    btnEdit.Visible   = true;
                    btnReport.Visible = true;


                    googleMap.Visible = false;
                    PieChart.Visible  = true;
                    market.Visible    = true;
                    ticket.Visible    = false;
                }
                else
                {
                    btnDelete.Visible = false;
                    btnEdit.Visible   = false;
                    btnReport.Visible = false;


                    googleMap.Visible = true;
                    PieChart.Visible  = false;
                    market.Visible    = false;
                    ticket.Visible    = true;
                }


                EventModel view = new EventModel();
                view.EventID = Convert.ToInt32(request);
                view.HostID  = Convert.ToInt32(HostID);
                view.Type    = "Views";
                evsc.addEventView(view);
            }
            else if (HostLevel.ToLower().Equals("guest"))
            {
                MapVsReportContainer.InnerHtml = "<span class='title' style='text-align:center;'>Get Directions</span>";
                btnDelete.Visible = false;
                btnEdit.Visible   = false;
                btnReport.Visible = false;

                googleMap.Visible = true;
                PieChart.Visible  = false;
                market.Visible    = false;
                ticket.Visible    = true;

                EventModel view = new EventModel();
                view.EventID = Convert.ToInt32(request);
                view.GuestID = Convert.ToInt32(HostID);
                view.Type    = "View";
                evsc.addEventView(view);
            }
            else
            {
                MapVsReportContainer.InnerHtml = "<span class='title' style='text-align:center;'>Get Directions</span>";
                btnDelete.Visible = false;
                btnEdit.Visible   = false;
                btnReport.Visible = false;

                googleMap.Visible = true;
                PieChart.Visible  = false;
                market.Visible    = false;
                ticket.Visible    = true;
            }

            //bool addViews = false;
            EventModel _View = new EventModel();

            _View.EventID   = Convert.ToInt32(request);
            _View.EventView = EventViews;
            DateTime dummyTime = new DateTime();

            dummyTime   = DateTime.Now;
            _View.sDate = Convert.ToString(dummyTime);
            _View.eDate = Convert.ToString(dummyTime);

            int EventID = Convert.ToInt32(request);

            strEventID = EventID;
            EventModel           em           = new EventModel();
            ImageFile            img          = new ImageFile();
            List <ImageFile>     listimages   = new List <ImageFile>();
            List <EventProduct>  products     = new List <EventProduct>();
            EventTicket          EB_tickets   = new EventTicket();
            EventTicket          REG_tickets  = new EventTicket();
            EventTicket          VIP_tickets  = new EventTicket();
            EventTicket          VVIP_tickets = new EventTicket();
            EventServiceClient   eventClient  = new EventServiceClient();
            FileUploadClient     fuc          = new FileUploadClient();
            TicketServiceClient  tsc          = new TicketServiceClient();
            ProductServiceClient psc          = new ProductServiceClient();

            em         = eventClient.findByEventID(request);
            img        = fuc.getImageById(request);
            listimages = fuc.getMultipleImagesById(request);
            string    output      = "";
            string    imgLocation = "";
            ImageFile mainPic     = new ImageFile();

            if (listimages.Count == 0)
            {
                output = "/Events/Eventrix_Default_Image.png";
                string strIhtml = "<img src='" + output + "' class='img-responsive' alt=''/>";
                divImageSlider.InnerHtml = strIhtml;
                //secondaryImageSlider.Visible = false;
            }
            else
            if (listimages.Count == 1)  //one pic uploaded
            {
                imgLocation = img.Location;
                output      = imgLocation.Substring(imgLocation.IndexOf('E')); //trim string path from Event
                                                                               //image slider
                string strIhtml = "<img src='" + output + "' class='img-responsive' alt=''/>";
                divImageSlider.InnerHtml = strIhtml;
                //  secondaryImageSlider.Visible = false;
            }
            string htmltag = "";

            htmltag         = "Event Name: " + em.Name;
            EName.InnerHtml = htmltag;

            htmltag             = "<span class='title'>Start Date : </span>" + em.sDate;
            StartDate.InnerHtml = htmltag;

            htmltag           = "<span class='title'>End Date : </span>" + em.eDate;
            EndDate.InnerHtml = htmltag;

            htmltag = em.Desc;
            Description.InnerHtml = htmltag;

            htmltag      = ""; //clean string
            EB_tickets   = tsc.getEBTicket(request);
            REG_tickets  = tsc.getRegularTicket(request);
            VIP_tickets  = tsc.getVIPTicket(request);
            VVIP_tickets = tsc.getVVIPTicket(request);
            if (EB_tickets != null)
            {
                if (EB_tickets._Price.Equals(0))
                {
                    htmltag += "<li><span class='title'>Early Bird Tickets :Available  " + em.EB_Quantity + " </span> Price: For Free!, Available Till: " + EB_tickets._EndDate + "</li>";
                }
                else
                {
                    htmltag += "<li><span class='title'>Early Bird Tickets :Available  " + em.EB_Quantity + "  </span> Price: R" + EB_tickets._Price + ", Available Till: " + EB_tickets._EndDate + "</li>";
                }
                htmltag += "<li><a class='btn btn-primary animated bounceIn' href ='PurchaseTicket.aspx?EBT_ID=" + EB_tickets._TicketID + "&E_ID=" + request + "'>Buy Early Bird Ticket</a></li><hr/>";
            }

            if (REG_tickets != null)
            {
                if (REG_tickets._Price.Equals(0))
                {
                    htmltag += "<li><span class='title'>Regular Tickets :Available " + em.Reg_Quantity + " </span> Price: For Free!, Available Till: " + REG_tickets._EndDate + "</li>";
                }
                else
                {
                    htmltag += "<li><span class='title'>Regular Tickets :Available " + em.Reg_Quantity + " </span> Price: R" + REG_tickets._Price + ", Available Till: " + REG_tickets._EndDate + "</li>";
                }
                htmltag += "<li><a class='btn btn-primary animated bounceIn' href ='PurchaseTicket.aspx?RBT_ID=" + REG_tickets._TicketID + "&E_ID=" + request + "'>Buy Regular Ticket</a></li><hr/>";
            }
            if (VIP_tickets != null)
            {
                if (VIP_tickets._Price.Equals(0))
                {
                    htmltag += "<li><span class='title'>VIP Tickets :Available " + em.VIP_Quantity + " </span> Price: For Free!, Available Till: " + VIP_tickets._EndDate + "</li>";
                }
                else
                {
                    htmltag += "<li><span class='title'>VIP Tickets :Available " + em.VIP_Quantity + " </span> Price: R" + VIP_tickets._Price + ", Available Till: " + VIP_tickets._EndDate + "</li>";
                }
                htmltag += "<li><a class='btn btn-primary animated bounceIn' href ='PurchaseTicket.aspx?VT_ID=" + VIP_tickets._TicketID + "&E_ID=" + request + "'>Buy VIP Ticket</a></li><hr/>";
            }
            if (VVIP_tickets != null)
            {
                if (VVIP_tickets._Price.Equals(0))
                {
                    htmltag += "<li><span class='title'>VVIP Tickets :Available " + em.VVIP_Quantity + " </span> Price: For Free!, Available Till: " + VVIP_tickets._EndDate + "</li>";
                }
                else
                {
                    htmltag += "<li><span class='title'>VVIP Tickets :Available " + em.VVIP_Quantity + " </span> Price: R" + VVIP_tickets._Price + ", Available Till: " + VVIP_tickets._EndDate + "</li>";
                }
                htmltag += "<li><a class='btn btn-primary animated bounceIn' href ='PurchaseTicket.aspx?VVT_ID=" + VVIP_tickets._TicketID + "&E_ID=" + request + "'>Buy VVIP Ticket</a></li><hr/>";
            }
            ticketInfo.InnerHtml = htmltag;

            //check if ticket entrance is for free
            if (EB_tickets == null && REG_tickets == null && VIP_tickets == null && VVIP_tickets == null)
            {
                AttendEvent.Visible = true;
            }
            else
            {
                AttendEvent.Visible = false;
            }

            htmltag  = ""; //clean string
            products = psc.getProductByEventID(request);
            int PC = products.Count();

            int count = 1;

            if (products != null)
            {
                if (PC != 0)
                {
                    htmltag = "<span class='title'>Products Sold</span>";
                    //    ProductsHeading.InnerHtml = htmltag;
                    htmltag = "";
                }
                foreach (EventProduct ep in products)
                {
                    htmltag += "<li><span class='title'>" + count + ". " + ep._Name + "</span>Price: R" + ep._Price + "</li>";
                    count++;
                }
                Products.InnerHtml = htmltag;
            }
        }