Exemplo n.º 1
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            // Khởi tạo đối tượng LoaiCongVanDTO
            LoaiCongVanDTO lcvDTO = new LoaiCongVanDTO();

            lcvDTO.IMaLCV  = int.Parse(txtMalcv.Text);
            lcvDTO.STenLCV = txtTenlcv.Text;
            // Gọi lớp nghiệp vụ LoaiCongVanBLL
            if (LoaiCongVanBLL.SuaLoaiCongVan(lcvDTO))
            {
                MessageBox.Show("Sửa thành công.", "Thông báo!");
                // Load lại dữ liệu
                LoadLoaiCongvan();
                return;
            }
            MessageBox.Show("Sửa thất bại.", "Thông báo!");
        }
Exemplo n.º 2
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            if (txtMalcv.Text == "")
            {
                MessageBox.Show("Hãy chọn cơ quan cần xóa.", "Thông báo!");
                return;
            }
            // Khởi tạo đối tượng LoaiCongVanDTO
            LoaiCongVanDTO lcvDTO = new LoaiCongVanDTO();

            lcvDTO.IMaLCV = int.Parse(txtMalcv.Text);
            // Gọi lớp nghiệp vụ LoaiCongVanBLL
            if (LoaiCongVanBLL.XoaLoaiCongVan(lcvDTO))
            {
                MessageBox.Show("Xóa thành công.", "Thông báo!");
                // Load lại dữ liệu
                LoadLoaiCongvan();
                return;
            }
            MessageBox.Show("Xóa thất bại.", "Thông báo!");
        }
Exemplo n.º 3
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            // Kiểm tra tính hợp lệ của dữ liệu
            if (txtTenlcv.Text == "")
            {
                MessageBox.Show("Bạn phải nhập đày đủ thông tin.", "Thông báo!");
                return;
            }
            // Khởi tạo đối tượng LoaiCongVanDTO
            LoaiCongVanDTO lcvDTO = new LoaiCongVanDTO();

            lcvDTO.STenLCV = txtTenlcv.Text;
            // Gọi tới lơp nghiệp vụ LoaiCongVanBLL
            if (LoaiCongVanBLL.ThemLoaiCongVan(lcvDTO))
            {
                MessageBox.Show("Thêm thành công.", "Thông báo!");
                LoadLoaiCongvan();
                return;
            }
            MessageBox.Show("Thêm thất bại.", "Thông báo!");
        }
Exemplo n.º 4
0
 // Sửa loại công văn
 public static bool SuaLoaiCongVan(LoaiCongVanDTO lcvDTO)
 {
     return(LoaiCongVanDAL.SuaLoaiCongVan(lcvDTO));
 }
Exemplo n.º 5
0
 // Thêm loại công văn
 public static bool ThemLoaiCongVan(LoaiCongVanDTO lcvDTO)
 {
     return(LoaiCongVanDAL.ThemLoaiCongVan(lcvDTO));
 }