Пример #1
0
        public SeatsChooser(Movie _movie,User user)
        {
            this.user = user;
            InitializeComponent();
            this.movie = _movie;
            this.sold = new bool[movie.amount];
            this.choose = new bool[movie.amount];

            DataRowCollection res = movie.getSeats().Tables[0].Rows;
            for (int i = 0; i < res.Count; i++)
            {
                int s = (int)res[i]["flag"];
                this.sold[s] = true;
            }
            for (int i = 0; i < movie.amount; i++)
            {
                int x = i % NUM_COLUMNS;
                int y = i / NUM_COLUMNS;
                CheckBox button = new CheckBox();
                button.Appearance = Appearance.Button;
                button.Text = Convert.ToString(i);
                button.Left = x * (WIDTH+INTERVAL) + INTERVAL;
                button.Top = y * (HEIGHT+INTERVAL) + INTERVAL;
                button.Height = HEIGHT;
                button.Width = WIDTH;
                button.Click += F;
                if (sold[i])
                {
                    //button.Checked = true;
                    button.Enabled = false;
                }
                groupBox1.Controls.Add(button);
            }
        }
Пример #2
0
 public boughtForm(User user)
 {
     InitializeComponent();
     this.user = user;
     dataGridView1.DataSource = user.getTickets();
     dataGridView1.Columns[0].Visible = false;
 }
Пример #3
0
 /// <summary>
 /// 获取输入框里的信息
 /// </summary>
 /// <returns></returns>
 public User getUser()
 {
     User user=new User();
     user.username = textBoxName.Text.Trim();
     user.password = textBoxPassword.Text.Trim();
     user.type = comboType.SelectedIndex;
     return user;
 }
Пример #4
0
        public PayForm(Movie movie,User user,Seat seats)
        {
            InitializeComponent();
            this.movie = movie;
            this.user = user;
            this.seats = seats;
            this.total_price = movie.price * seats.Count;

            textBoxtotalprice.Text = Convert.ToString(this.total_price);
            textBoxleftmoney.Text = Convert.ToString(user.money);
        }
Пример #5
0
 private void buttonLogin_Click(object sender, EventArgs e)
 {
     user = this.getUser();
     if (user.isValidated())
     {
         user.getUserByName();
         MessageBox.Show("登录成功!");
         this.Hide();
         new MovieList(this, user).Show();
     }
     else
     {
         MessageBox.Show("登录失败!");
     }
 }
Пример #6
0
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonRegister_Click(object sender, EventArgs e)
        {
            user = this.getUser();

            if (user.username == "" || user.password == ""){
                MessageBox.Show("用户名和密码不能为空!");
            }
            else if (user.isExisting())
            {
                MessageBox.Show("该用户已存在!");

            }
            else
            {
                if (user.register()){
                    MessageBox.Show("注册成功!");
                    this.clear();
                }else{
                    MessageBox.Show("注册失败!");
                }
            }
        }
Пример #7
0
 public MovieList(formLogin fl, User user)
 {
     this.fl = fl;
     this.user = user;
     InitializeComponent();
     if (user.type == ADMIN)
     {
         button1.Visible = false;
     }
     else
     {
         buttonPub.Visible = false;
     }
     dataMovieList.DataSource = Movie.getMovies(-1);
     for (int i = 0; i < dataMovieList.Columns.Count; i++)
     {
         dataMovieList.Columns[i].Visible = false;
     }
     dataMovieList.Columns[1].Visible = true;
     dataMovieList.Columns[2].Visible = true;
     dataMovieList.Columns[7].Visible = true;
     dataMovieList.Columns[9].Visible = true;
 }
Пример #8
0
 public commentForm(User user,Movie movie)
 {
     InitializeComponent();
     this.user = user;
     this.movie = movie;
 }
Пример #9
0
 public RechargeForm(User user)
 {
     InitializeComponent();
     this.user = user;
 }
Пример #10
0
        public MovieDetail(Movie movie,User user)
        {
            InitializeComponent();
            detailMovie = movie;
            this.user = user;
            detailMovie.getMovieById();
            textBoxfilmname.Text = detailMovie.name;
            textBoxdirector.Text = detailMovie.director;
            textBoxhallnum.Text = detailMovie.hallNum.ToString();
            textBoxlength.Text = detailMovie.length.ToString();
            textBoxprice.Text = detailMovie.price.ToString();
            textTime.Text = detailMovie.startTime.ToString();
            try
            {
                picturePoster.Image = Image.FromFile(detailMovie.logoPath);
            }
            catch (Exception)
            {

                picturePoster.Image = null;
            }

            comments = new Comment();
            comments.getFilmComments(detailMovie.id);
            labelRemark1.Text = Convert.ToString(comments.comments[0]);
            labelRemark2.Text = Convert.ToString(comments.comments[1]);

            picMark[0] = pictureBox1;
            picMark[1] = pictureBox2;
            picMark[2] = pictureBox3;
            picMark[3] = pictureBox4;
            picMark[4] = pictureBox5;

            for (int i = 0; i < 5 ; i ++)
            {
                picMark[i].Click += movieMark;
                picMark[i].MouseMove += movieOver;
            }
            groupBox1.MouseMove += movieOver;
            groupBox1.Click += movieMark;

            DataTable dt = this.detailMovie.getUserMark().Tables[0];
            double sum_score = 0;
            int count = dt.Rows.Count;
            foreach (DataRow r in dt.Rows)
            {
                sum_score += Convert.ToDouble(r["score"]);
            }
            if (count == 0)
                this.detailMovie.score = 0;
            else
                this.detailMovie.score = 1.0 * sum_score / count;

            clearMark();

            if (user.type == 0)
            {

            }
            else
            {
                this.button.Visible = false;
                this.buttonbuyticket.Visible = false;
            }
        }