コード例 #1
0
        private void btnThemE_Click(object sender, EventArgs e)
        {
            EBook_DTO ebookDTO = new EBook_DTO();

            ebookDTO.MaEbook   = txtMaEbook.Text;
            ebookDTO.TenSach   = txtTenSach.Text;
            ebookDTO.MaTG      = txtMaTGEbook.Text;
            ebookDTO.MaTL      = txtMaTLEbook.Text;
            ebookDTO.MaNXB     = txtMaNXBEbook.Text;
            ebookDTO.NamXB     = txtNamXBEbook.Text;
            ebookDTO.FilePDF   = txtPDFEbook.Text;
            ebookDTO.HinhAnh   = txtImageEbook.Text;
            ebookDTO.DinhDang  = txtDinhDang.Text;
            ebookDTO.DungLuong = txtDungLuong.Text;

            EBook_BO ebookBO = new EBook_BO();
            int      result  = 0;

            result = ebookBO.Them(ebookDTO);
            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!");
            }
        }
コード例 #2
0
        private void UCEbook_Load(object sender, EventArgs e)
        {
            DataTable tb;
            EBook_BO  ebookBO = new EBook_BO();

            tb = ebookBO.DS();
            dgEbook.DataSource = tb;
        }
コード例 #3
0
        private void btnThieuNhi_Click(object sender, EventArgs e)
        {
            pnlAudio_User.Visible = true;
            DataTable tb;
            EBook_BO  ebookBO = new EBook_BO();

            tb = ebookBO.DSTheLoai("TL06");
            dgEbookUser.DataSource = tb;
        }
コード例 #4
0
        private void btnTimKiemE_Click(object sender, EventArgs e)
        {
            pnlAudio_User.Visible = true;
            DataTable tb;
            EBook_BO  ebookBO = new EBook_BO();

            tb = ebookBO.TimKiem(txtTimKiemE.Text);
            dgEbookUser.DataSource = tb;
        }
コード例 #5
0
        private void btnXoaE_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 MaEbook;

                MaEbook = txtMaEbook.Text;
                EBook_BO ebookBO = new EBook_BO();
                int      result  = ebookBO.Xoa(MaEbook);
                if (result > 0)
                {
                    MessageBox.Show("Xóa thành công");
                }
                else
                {
                    MessageBox.Show("Xóa không thành công");
                }
            }
        }