private void PrepareElements(int id)
        {
            //pairno to venue
            enventDataSetTableAdapters.venuesTableAdapter ven = new enventDataSetTableAdapters.venuesTableAdapter();
            int   venue_id = (int)ven.GetVenueIdFromEventID(id);
            Venue theVenue = new Venue(venue_id);

            //pairno ta tickets
            enventDataSetTableAdapters.ticketsTableAdapter tick = new enventDataSetTableAdapters.ticketsTableAdapter();
            float normal_ticket  = (float)tick.GetNormalPriceEventId(id);
            float reduced_ticket = (float)tick.GetReducedPriceEventId(id);


            User_Classes.Event event_kati = new User_Classes.Event(id);
            App_Code.Play      plays      = new App_Code.Play(id);


            Dictionary <int, string> category = new Dictionary <int, string>();

            category[1] = "Music"; category[2] = "Theater"; category[3] = "Conference"; category[4] = "Festivals"; category[5] = "Sports"; category[6] = "Educational"; category[7] = "Informing"; category[8] = "Soccer"; category[9] = "Basketball"; category[10] = "Cinema";
            int    cat_id   = event_kati.GetCategory();
            string cat_name = category[cat_id];
            int    duration = event_kati.GetDuration();

            this.eventTitle.Text     = event_kati.GetTitle();
            this.imerominia.Text     = event_kati.GetCreatedAt().ToString("d/M/yyyy");
            this.perigrafilabel.Text = event_kati.GetDescription().ToString();
            this.durationlabel.Text  = (duration / 3600).ToString() + " ώρες";
            this.categorylabel.Text  = cat_name;
            this.topothesia.Text     = theVenue.GetName();
            this.NameofPlace.Text    = theVenue.GetName();
            this.addressofPlace.Text = theVenue.GetLocation();
            this.kanonikoTimi.Text   = normal_ticket.ToString();
            this.meiomenoTimi.Text   = reduced_ticket.ToString();
            //Debug.WriteLine(event_kati.GetTitle().ToString());
            Image rszimg = Images.resizeImage(Images.pic.ElementAt(id), new Size(880, 222));

            IconEvent.Image = rszimg;

            int z = 0;

            List <DateTime> dates = plays.GetDates();

            foreach (DateTime date in dates)
            {
                Label newLabel = new Label();

                newLabel.Width    = 125;
                newLabel.Height   = 20;
                newLabel.Location = new Point(10, 50 + 2 * z * newLabel.Height);
                newLabel.Name     = "label" + z;

                newLabel.Text = date.ToString("dd/MM/yyyy HH:mm");
                date_panel.Controls.Add(newLabel);


                z++;
            }
        }
Exemplo n.º 2
0
 public Venue(int id)
 {
     this.id = id;
     enventDataSetTableAdapters.venuesTableAdapter ev = new enventDataSetTableAdapters.venuesTableAdapter();
     if (Convert.ToInt32(ev.tryVenue(this.id)) > 0)
     {
         List <enventDataSet.venuesRow> venueDetails = ev.getVenue(this.id).ToList();
         this.name     = venueDetails.ElementAt(0).name;
         this.location = venueDetails.ElementAt(0).location;
         this.capacity = venueDetails.ElementAt(0).capacity;
     }
     else
     {
         throw new VenueException("Το Venue δεν υπάρχει");
     }
 }