Пример #1
0
        private void SuatChieucb_SelectedIndexChanged(object sender, EventArgs e)
        {
            Daytxt.Text = "";
            ghetxt.Text = "";
            if (Phimcb.ValueMember.ToString() == "")
            {
                return;
            }
            if (SuatChieucb.ValueMember.ToString() == "")
            {
                return;
            }
            //string time;
            XuLyGioKetThuc();

            seatPanel.Visible = true;
            render seatLoader = new render();

            dtRap = new DataTable();
            dtRap.Clear();
            dtPhim = new DataTable();
            DataSet dsPhim = dbPhim.LayPhim();

            dtPhim = dsPhim.Tables[0];
            setRaptxt(dtPhim);
            if (globalRap != null)
            {
                DataSet ds = dbRap.findRap(globalRap);
                dtRap = ds.Tables[0];

                if (dtRap.Rows.Count != 0)
                {
                    ds              = dbRap.findSoDayGhe(globalRap);
                    dtRap           = ds.Tables[0];
                    Program.hangGhe = Convert.ToInt32(dtRap.Rows[0].ItemArray[0].ToString());
                    ds              = dbRap.findSoLuongGhe(globalRap);
                    dtRap           = ds.Tables[0];
                    Program.soGhe   = Convert.ToInt32(dtRap.Rows[0].ItemArray[0].ToString());
                    seatLoader.removeSeat(ref seatPanel);
                    seatPanel.Refresh();
                    getBookedSeat();
                    seatLoader.renderSeat(ref seatPanel, bookedSeatAlpha, bookedSeatNum);
                    setBtnEven(seatLoader.btns);
                }
            }
        }
Пример #2
0
        private void SuatChieucb_SelectedIndexChanged(object sender, EventArgs e)
        {
            Daytxt.Text = "";
            ghetxt.Text = "";
            if (comboBox2.ValueMember.ToString() == "")
            {
                return;
            }
            if (SuatChieucb.ValueMember.ToString() == "")
            {
                return;
            }
            //string time;

            seatPanel.Visible = true;
            render seatLoader = new render();
            //dtRap = new DataTable();
            //dtRap.Clear();
            //dtPhim = new DataTable();
            var dtPhim = dbPhim.LayPhim().ToList();

            setRaptxt();
            if (globalRap != null)
            {
                var demRap = dbRap.findrap(globalRap);

                if (demRap != 0)
                {
                    dbRap.findsodayghe(globalRap, ref Program.hangGhe);
                    dbRap.findSoLuongGhe(globalRap, ref Program.soGhe);
                    seatLoader.removeSeat(ref seatPanel);
                    seatPanel.Refresh();
                    getBookedSeat();
                    seatLoader.renderSeat(ref seatPanel, bookedSeatAlpha, bookedSeatNum);
                    setBtnEven(seatLoader.btns);
                }
            }
        }