예제 #1
0
        void AutoCreateTicketsByShowTimes(ShowTimes showTimes)
        {
            int    result = 0;
            Cinema cinema = CinemaDAO.GetCinemaByName(showTimes.CinemaName);
            int    Row    = cinema.Row;
            int    Column = cinema.SeatInRow;

            for (int i = 0; i < Row; i++)
            {
                int  temp    = i + 65;
                char nameRow = (char)(temp);
                for (int j = 1; j <= Column; j++)
                {
                    string seatName = nameRow.ToString() + j;
                    result += TicketDAO.InsertTicketByShowTimes(showTimes.ID, seatName);
                }
            }
            if (result == Row * Column)
            {
                int ret = ShowTimesDAO.UpdateStatusShowTimes(showTimes.ID, 1);
                if (ret > 0)
                {
                    MessageBox.Show("TẠO VÉ TỰ ĐỘNG THÀNH CÔNG!", "THÔNG BÁO");
                }
            }
            else
            {
                MessageBox.Show("TẠO VÉ TỰ ĐỘNG THẤT BẠI!", "THÔNG BÁO");
            }
        }
예제 #2
0
        private void LoadDataCinema(string cinemaName)
        {
            Cinema cinema = CinemaDAO.GetCinemaByName(cinemaName);
            int    Row    = cinema.Row;
            int    Column = cinema.SeatInRow;

            flpSeat.Size = new Size((SIZE + 20 + GAP) * Column, (SIZE + GAP) * Row);
        }
예제 #3
0
        private void DeleteTicketsByShowTimes(ShowTimes showTimes)
        {
            Cinema cinema = CinemaDAO.GetCinemaByName(showTimes.CinemaName);
            int    Row    = cinema.Row;
            int    Column = cinema.SeatInRow;
            int    result = TicketDAO.DeleteTicketsByShowTimes(showTimes.ID);

            if (result == Row * Column)
            {
                int ret = ShowTimesDAO.UpdateStatusShowTimes(showTimes.ID, 0);
                if (ret > 0)
                {
                    MessageBox.Show("XÓA TẤT CẢ CÁC VÉ CỦA LỊCH CHIẾU ID=" + showTimes.ID + " THÀNH CÔNG!", "THÔNG BÁO");
                }
            }
            else
            {
                MessageBox.Show("XÓA TẤT CẢ CÁC VÉ CỦA LỊCH CHIẾU ID=" + showTimes.ID + " THẤT BẠI!", "THÔNG BÁO");
            }
        }