Ejemplo n.º 1
0
 partial void DeleteGhe(Ghe instance);
Ejemplo n.º 2
0
        protected void Xl_XemSoDoGhe_Click(object sender, EventArgs e)
        {
            int soHang = int.Parse(tb_SoHangGhe.Text);
            int soGheTrenHang = int.Parse(tb_SoGheTrenHang.Text);
            CinemaLINQDataContext dt = new CinemaLINQDataContext();
            PhongChieuPhim phong = new PhongChieuPhim();
            phong.MaRapChieuPhim = int.Parse(cbb_RapPhim.SelectedItem.Value);
            phong.TenPhongChieuPhim = tb_TenPhong.Text;
            phong.TongSoLuongGhe = soGheTrenHang * soHang;
            phong.TinhTrang = false;
            phong.SoHang = soHang;
            phong.SoGheTrenHang = soGheTrenHang;
            dt.PhongChieuPhims.InsertOnSubmit(phong);

            dt.SubmitChanges();

            for (int i = 0; i < soHang; ++i)
            {
                for (int j = 0; j < soGheTrenHang; ++j)
                {
                    Ghe ghe = new Ghe();
                    ghe.MaPhongChieuPhim = phong.MaPhongChieuPhim;
                    ghe.TenGhe = "Ghe";
                    ghe.MaDanhMucGhe = dt.DanhMucGhes.Where(dmg => dmg.TenDanhMucGhe.CompareTo("Thường") == 0).Select(dmg => dmg.MaDanhMucGhe).Single();
                    ghe.Hang = i;
                    ghe.SoThuTu = j;
                    ghe.TinhTrang = -1;
                    dt.Ghes.InsertOnSubmit(ghe);
                    dt.SubmitChanges();
                }
            }

            Session["Phong"] = (PhongChieuPhim)phong;
        }
Ejemplo n.º 3
0
 partial void UpdateGhe(Ghe instance);
Ejemplo n.º 4
0
 partial void InsertGhe(Ghe instance);
Ejemplo n.º 5
0
		private void detach_Ghes(Ghe entity)
		{
			this.SendPropertyChanging();
			entity.PhongChieuPhim = null;
		}
Ejemplo n.º 6
0
		private void detach_Ghes(Ghe entity)
		{
			this.SendPropertyChanging();
			entity.DanhMucGhe = null;
		}
Ejemplo n.º 7
0
		private void attach_Ghes(Ghe entity)
		{
			this.SendPropertyChanging();
			entity.DanhMucGhe = this;
		}