예제 #1
0
        public FilmScreeningService(IRepository <FilmScreening> screenings, IFilmScreening filmScreening)
        {
            Guard.WhenArgument(screenings, "screenings").IsNull().Throw();
            Guard.WhenArgument(filmScreening, "filmScreening").IsNull().Throw();

            this.screenings            = screenings;
            this.filmScreeningToCreate = filmScreening;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.queryId       = Request.QueryString["Id"];
            this.FilmScreening = this.Presenter.GetScreeningById(this.queryId);

            this.buttons.Add(ImageButton00);
            this.buttons.Add(ImageButton01);
            this.buttons.Add(ImageButton02);
            this.buttons.Add(ImageButton03);
            this.buttons.Add(ImageButton04);
            this.buttons.Add(ImageButton05);
            this.buttons.Add(ImageButton06);
            this.buttons.Add(ImageButton07);
            this.buttons.Add(ImageButton08);
            this.buttons.Add(ImageButton09);
            this.buttons.Add(ImageButton10);
            this.buttons.Add(ImageButton11);
            this.buttons.Add(ImageButton12);
            this.buttons.Add(ImageButton13);
            this.buttons.Add(ImageButton14);
            this.buttons.Add(ImageButton15);
            this.buttons.Add(ImageButton16);
            this.buttons.Add(ImageButton17);
            this.buttons.Add(ImageButton18);
            this.buttons.Add(ImageButton19);

            if (!Page.IsPostBack)
            {
                for (int i = 0; i < 20; i++)
                {
                    if (this.FilmScreening.Seats[i].IsFree == true)
                    {
                        this.buttons[i].BackColor = System.Drawing.Color.Transparent;
                    }
                    else
                    {
                        this.buttons[i].BackColor = System.Drawing.Color.Red;
                        this.buttons[i].Enabled   = false;
                    }
                }

                this.MovieInfoLabel.Text = String.Format("{0:f}", this.FilmScreening.Start);
            }
        }