private void attach_BinhLuans(BinhLuan entity)
		{
			this.SendPropertyChanging();
			entity.Phim = this;
		}
		private void detach_BinhLuans(BinhLuan entity)
		{
			this.SendPropertyChanging();
			entity.Phim = null;
		}
 partial void DeleteBinhLuan(BinhLuan instance);
 partial void UpdateBinhLuan(BinhLuan instance);
 partial void InsertBinhLuan(BinhLuan instance);
		private void detach_BinhLuans(BinhLuan entity)
		{
			this.SendPropertyChanging();
			entity.DanhMucTinhTrangBinhLuan = null;
		}
Esempio n. 7
0
        protected void Xl_ThemBinhLuan_Click(object sender, EventArgs e)
        {
            try
            {
                CinemaLINQDataContext dt = new CinemaLINQDataContext();

                BinhLuan bl = new BinhLuan();
                bl.MaPhim = ((Phim)Session["CurrentPhim"]).MaPhim;
                bl.NoiDungBinhLuan = Th_BinhLuanMoi.Text;
                bl.MaNguoiDung = ((NguoiDung)Session["NguoiDung"]).MaNguoiDung;
                bl.TinhTrang = dt.DanhMucTinhTrangBinhLuans.Where(ttbl => ttbl.TenTinhTrang.CompareTo("Bình thường")==0).Select(ttbl => ttbl.MaTinhTrang).Single();
                bl.ThoiGianBinhLuan = DateTime.Now;
                dt.BinhLuans.InsertOnSubmit(bl);

                dt.SubmitChanges();

                Th_BinhLuanMoi.Text = "";
                //Response.Redirect("/phim/chitietphim.aspx");
            }
            catch
            {
                //Response.Redirect("/phim/chitietphim.aspx");
            }
        }