Exemple #1
0
        void LuuPhongChieu()
        {
            if (txbPCMaPhong.Text == "")
            {
                return;
            }
            PhongChieuDAO ttphongchieu = new PhongChieuDAO()
            {
                TenRap   = cbPCTenRap.SelectedItem.ToString(),
                MaPhong  = txbPCMaPhong.Text,
                TenPhong = txbPCTenPhong.Text,
                SoGhe    = Int32.Parse(txbPCSoGhe.Text)
            };

            if (phongchieu.KiemTraPhongChieu(ttphongchieu.MaPhong))
            {
                int soghecu = phongchieu.LaySoGheCuaPhongTheoMaPhong(ttphongchieu.MaPhong);
                phongchieu.SuaPhongChieu(ttphongchieu, soghecu);
            }
            else
            {
                phongchieu.ThemPhong(ttphongchieu);
            }
            MessageBox.Show("Lưu phòng chiếu thành công!");
            LoadDtgvPhongChieu();
        }