private void btnThemA_Click(object sender, EventArgs e) { Audio_DTO audioDTO = new Audio_DTO(); audioDTO.MaAudio = txtMaAudio.Text; audioDTO.TenSach = txtTenSachA.Text; audioDTO.MaTG = txtMaTGAbook.Text; audioDTO.MaTL = txtMaTLAbook.Text; audioDTO.MaNXB = txtMaNXBAbook.Text; audioDTO.NamXB = txtNamXBAbook.Text; audioDTO.FileAudio = txtMP3Abook.Text; audioDTO.HinhAnh = txtImageAbook.Text; audioDTO.DinhDang = txtDinhDangA.Text; audioDTO.DungLuong = txtDungLuongA.Text; audioDTO.ThoiLuong = txtThoiLuongAbook.Text; audioDTO.MCAudio = txtMCAbook.Text; Audio_BO audioBO = new Audio_BO(); int result = 0; result = audioBO.Them(audioDTO); if (result > 0) { MessageBox.Show("Thêm thông tin thành công"); } else { MessageBox.Show("Thông tin này đã tồn tại!"); } }
private void UCAudio_Load(object sender, EventArgs e) { DataTable tb; Audio_BO audioBO = new Audio_BO(); tb = audioBO.DS(); dgAudio.DataSource = tb; }
private void btnTruyenTranhAudio_Click(object sender, EventArgs e) { pnlAudio_User.Visible = true; DataTable tb; Audio_BO audioBO = new Audio_BO(); tb = audioBO.DSTheLoai("TL08"); dgAudioUser.DataSource = tb; }
private void btnTimKiemA_Click(object sender, EventArgs e) { pnlAudio_User.Visible = true; DataTable tb; Audio_BO audioBO = new Audio_BO(); tb = audioBO.TimKiem(txtTimKiemA.Text); dgAudioUser.DataSource = tb; }
private void btnXoaA_Click(object sender, EventArgs e) { if (MessageBox.Show("Bạn có muốn xóa hay không?", "thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { string MaAudio; MaAudio = txtMaAudio.Text; Audio_BO audioBO = new Audio_BO(); int result = audioBO.Xoa(MaAudio); if (result > 0) { MessageBox.Show("Xóa thành công"); } else { MessageBox.Show("Xóa không thành công"); } } }