protected void btnInsert_Update_Phim_Click(object sender, EventArgs e) { PhimBLL phimbll = new PhimBLL(); Phim phim = new Phim(); bool kq = phimbll.KT_MaPhim(Int32.Parse(txtMaPhim.Text)); phim.MaPhim = Int32.Parse(txtMaPhim.Text); phim.TenPhimGoc = txtTenPhimGoc.Text; phim.TenPhim = txtTenPhimTV.Text; phim.QuocGia = txtQuocGia.Text; phim.NoiDung = txtNoiDung.Text; phim.TheLoai = txtTheLoai.Text; phim.TrangThai = txtTrangThai.Text; phim.NamPhatSong = txtNamPhatSong.Text; phim.HinhAnh = LocDuLieuFileUpload(Fupload_HinhAnh, true); phim.DuongDan = LocDuLieuFileUpload(Fupload_DuongDanPhim, false); phim.ThoiLuong = Int32.Parse(txtThoiLuong.Text); if (kq) { kq = phimbll.CapNhapPhim(phim); if (kq) { Page.ClientScript.RegisterStartupScript(this.GetType(), "Thành Công", "alert('" + "Update Successed!" + "');", true); XoaThongTin(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "alert('" + "Update Failed!" + "');", true); XoaThongTin(); } } else { kq = phimbll.ThemPhimMoi(phim); if (kq) { Page.ClientScript.RegisterStartupScript(this.GetType(), "Thành Công", "alert('" + "Insert Successed!" + "');", true); XoaThongTin(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "alert('" + "Insert Failed!" + "');", true); XoaThongTin(); } } }