Ejemplo n.º 1
0
        private void UCTacGia_Load(object sender, EventArgs e)
        {
            DataTable tb;
            TacGia_BO tgBO = new TacGia_BO();

            tb = tgBO.DS();
            dgTacGia.DataSource = tb;
        }
Ejemplo n.º 2
0
        private void btnXoaTG_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 MaTG;

                MaTG = txtMaTG.Text;
                TacGia_BO tgBO   = new TacGia_BO();
                int       result = tgBO.Xoa(MaTG);
                if (result > 0)
                {
                    MessageBox.Show("Xóa thành công");
                }
                else
                {
                    MessageBox.Show("Xóa không thành công");
                }
            }
        }
Ejemplo n.º 3
0
        private void btnSuaTG_Click(object sender, EventArgs e)
        {
            TacGia_DTO tgDTO = new TacGia_DTO();

            tgDTO.MaTG   = txtMaTG.Text;
            tgDTO.TenTG  = txtTenTG.Text;
            tgDTO.TieuSu = txTieuSuTG.Text;

            TacGia_BO tgBO   = new TacGia_BO();
            int       result = 0;

            result = tgBO.Sua(tgDTO);
            if (result > 0)
            {
                MessageBox.Show("Sửa thành công!");
            }
            else
            {
                MessageBox.Show("Sửa thất bại!");
            }
        }
Ejemplo n.º 4
0
        private void btnThemTG_Click(object sender, EventArgs e)
        {
            TacGia_DTO tgDTO = new TacGia_DTO();

            tgDTO.MaTG   = txtMaTG.Text;
            tgDTO.TenTG  = txtTenTG.Text;
            tgDTO.TieuSu = txTieuSuTG.Text;

            TacGia_BO tgBO   = new TacGia_BO();
            int       result = 0;

            result = tgBO.Them(tgDTO);
            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!");
            }
        }