protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["buying"] != null)
            {
                Session["ShoppingCart"] = null;
            }
            DateTime date;

            if (Session["date"] == null)
            {
                date = DateTime.Now;
                Session["date"] = date;
            }
            else
            {
                if (Session["stage"] != null)
                {
                    if (Session["stage"].Equals("Theatre"))
                        date = Convert.ToDateTime(Session["date"]);
                    else
                    {
                        date = DateTime.Now;
                        Session["date"] = date;
                    }
                }
                else
                {
                    date = DateTime.Now;
                    Session["date"] = date;
                }
            }

            LbHeader.Text = "Repertorire for the theatre in " + date.ToString("MMMM");

            WsSmallTheatre.Service1 wsTheatre = new WsSmallTheatre.Service1();
            DataRow singleEvent;

            DataTable DtSchedule = new DataTable();
            DtSchedule.Columns.Add("Title");
            DtSchedule.Columns.Add("Date", System.Type.GetType("System.DateTime"));
            DtSchedule.Columns.Add("Runtime", System.Type.GetType("System.Int32"));
            DtSchedule.Columns.Add("OpenSeats", System.Type.GetType("System.Int32"));

            var scheduleBallet = wsTheatre.GetScheduleForAMonth(date);
            if (scheduleBallet != null)
            {
                for (int i = 0; i < scheduleBallet.Length / 4; i++)
                {
                    int y = i * 4;
                    singleEvent = DtSchedule.NewRow();
                    singleEvent[0] = scheduleBallet[y];
                    singleEvent[1] = Convert.ToDateTime(scheduleBallet[y + 1]);
                    singleEvent[2] = Convert.ToInt32(scheduleBallet[y + 2]);
                    singleEvent[3] = Convert.ToInt32(scheduleBallet[y + 3]);
                    DtSchedule.Rows.Add(singleEvent);
                }
            }

            GvEntTheatre.DataSource = DtSchedule;
            GvEntTheatre.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["buying"] != null)
            {
                Session["ShoppingCart"] = null;
            }

            DateTime date;

            if (Session["date"] == null)
            {
                date = DateTime.Now;
                Session["date"] = date;
            }
            else
                date = Convert.ToDateTime(Session["date"]);

            LbHeader.Text = "Entertainments in " + date.ToString("MMMM");

            WsBallet.Service1 wsBallet = new WsBallet.Service1();
            WsOpera.Service1 wsOpera = new WsOpera.Service1();
            WsSmallTheatre.Service1 wsTheatre = new WsSmallTheatre.Service1();
            DataRow singleEvent;

            DataTable DtSchedule = new DataTable();
            DtSchedule.Columns.Add("Org");
            DtSchedule.Columns.Add("Title");
            DtSchedule.Columns.Add("Date", System.Type.GetType("System.DateTime"));
            DtSchedule.Columns.Add("Runtime", System.Type.GetType("System.Int32"));
            DtSchedule.Columns.Add("OpenSeats", System.Type.GetType("System.Int32"));

            var scheduleBallet = wsBallet.GetScheduleForAMonth(date);
            if (scheduleBallet != null)
            {
                for (int i = 0; i < scheduleBallet.Length / 4; i++)
                {
                    int y = i * 4;
                    singleEvent = DtSchedule.NewRow();
                    singleEvent[0] = "Ballet";
                    singleEvent[1] = scheduleBallet[y];
                    singleEvent[2] = Convert.ToDateTime(scheduleBallet[y + 1]);
                    singleEvent[3] = Convert.ToInt32(scheduleBallet[y + 2]);
                    singleEvent[4] = Convert.ToInt32(scheduleBallet[y + 3]);
                    DtSchedule.Rows.Add(singleEvent);
                }
            }

            var scheduleOpera = wsOpera.GetScheduleForAMonth(date);
            if (scheduleOpera != null)
            {
                for (int i = 0; i < scheduleOpera.Length / 4; i++)
                {
                    int y = i * 4;
                    singleEvent = DtSchedule.NewRow();
                    singleEvent[0] = "Opera";
                    singleEvent[1] = scheduleOpera[y];
                    singleEvent[2] = Convert.ToDateTime(scheduleOpera[y + 1]);
                    singleEvent[3] = Convert.ToInt32(scheduleOpera[y + 2]);
                    singleEvent[4] = Convert.ToInt32(scheduleOpera[y + 3]);
                    DtSchedule.Rows.Add(singleEvent);
                }
            }

            var scheduleTheatre = wsTheatre.GetScheduleForAMonth(date);
            if (scheduleTheatre != null)
            {
                for (int i = 0; i < scheduleTheatre.Length / 4; i++)
                {
                    int y = i * 4;
                    singleEvent = DtSchedule.NewRow();
                    singleEvent[0] = "Theatre";
                    singleEvent[1] = scheduleTheatre[y];
                    singleEvent[2] = Convert.ToDateTime(scheduleTheatre[y + 1]);
                    singleEvent[3] = Convert.ToInt32(scheduleTheatre[y + 2]);
                    singleEvent[4] = Convert.ToInt32(scheduleTheatre[y + 3]);
                    DtSchedule.Rows.Add(singleEvent);
                }
            }
            DataTable EarliestEvents = Get3EarliestEvents(DtSchedule);

            GvEntertainments.DataSource = EarliestEvents;
            GvEntertainments.DataBind();
        }