• 影院售票系统


    1.循环写出座位

     Seat seat;
                for (int i = 0; i < seatRow; i++)
                {
                    for (int j = 0; j < seatLine; j++)
                    {
                        label = new Label();
                        //设置背景颜色
                        label.BackColor = Color.Yellow;
                        //设置字体
                        label.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                        //设置尺寸
                        label.AutoSize = false;
                        label.Size = new System.Drawing.Size(50, 25);
                        //设置座位号
                        label.Text = (j + 1).ToString() + "-" + (i + 1).ToString();
                        label.TextAlign = ContentAlignment.MiddleCenter;
                        //设置位置
                        label.Location = new Point(60 + (i * 90), 60 + (j * 60));
                        //所有的标签都绑定到同一事件
                        tpCinema.Controls.Add(label);
                        lbs.Add(label.Text, label);
                        //实例化一个座位
                        seat = new Seat((j + 1).ToString() + "-" + (i + 1).ToString(), Color.Yellow);
                        //保存的座位集合
                        //cinema.Seats.Add(seat.SeatNum, seat);
                    }

    2.播放节点写入

    TreeNode tnd = null;
                foreach (KeyValuePair<string  ,ScheduleItem> item in sched.Items)
                {
                    if (Movenames != item.Value.Movies.MovieName)
                    {
                        tnd = new TreeNode(item.Value.Movies.MovieName);
                        tnd.Tag = item.Value.Movies;
                        this.tvMovies.Nodes.Add(tnd);
                    }
                    TreeNode nod = new TreeNode(item.Value.Time);
                    tnd.Nodes.Add(nod);
                    Movenames = item.Value.Movies.MovieName;
                }
                this.tvMovies.ExpandAll();

    3.播放详情界面

    if(selectedNode==null)
                {
                    return;
                }
                if(selectedNode.Level==0)
                {
                    return;
                }
                lblMovieName.Text = sched.Items[selectedNode.Text].Movies.MovieName;
                lblType.Text = sched.Items[selectedNode.Text].Movies.movietyp.ToString();
                picMovie.Image = Image.FromFile(sched.Items[selectedNode.Text].Movies.Poster);
                lblPrice.Text = sched.Items[selectedNode.Text].Movies.Price.ToString();
                lblActor.Text = sched.Items[selectedNode.Text].Movies.Actor.ToString();
                lblTime.Text = sched.Items[selectedNode.Text].Time;
                lblDirector.Text = sched.Items[selectedNode.Text].Movies.Director;
    

      

  • 相关阅读:
    《使用Hibernate开发租房系统》内部测试笔试题
    C++第十课 字符串
    【011】字符数组
    C++第九课 数组
    C++第八课 局部变量和全局变量
    【010】递归函数
    C++第七课 函数2
    【009】阅读代码
    C++第六课 函数1
    【008】查找素数
  • 原文地址:https://www.cnblogs.com/s122/p/8360752.html
Copyright © 2020-2023  润新知