Esempio n. 1
0
        private void btnXoa_Click_1(object sender, EventArgs e)
        {
            DialogResult tl = MessageBox.Show("Bạn có chắc chắn muốn xóa?", "Xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (tl == DialogResult.Yes)
            {
                int maNV = Convert.ToInt32(txtMaNV.Text);
                txtTenNV2.Text = hoSoBUL.LayTenTheoMaNhanVien(maNV);
                string ngoaingu = cboNgoaiNgu.SelectedValue.ToString();
                string trinhdo  = txtTrinhDO.Text.ToString();
                bool   kt       = trinhdoNNBUL.xoaTrinhDoNN(maNV, ngoaingu);
                if (kt)
                {
                    MessageBox.Show("Xóa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Xóa thất bại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                UCQLTDNN ucQLTDNgoaiNgu = new UCQLTDNN();
                ucQLTDNgoaiNgu.hienThi();
                this.Close();
            }
            else
            {
                this.Close();
            }
        }
Esempio n. 2
0
        private void btnSuaTDNN_Click_1(object sender, EventArgs e)
        {
            int maNV = Convert.ToInt32(txtMaNV.Text);

            txtTenNV2.Text = hoSoBUL.LayTenTheoMaNhanVien(maNV);
            string ngoaingu = cboNgoaiNgu.SelectedValue.ToString();
            string trinhdo  = txtTrinhDo.Text.ToString();
            bool   kt       = trinhdoNNBUL.suaTrinhDoNN(maNV, ngoaingu, trinhdo);

            if (kt)
            {
                MessageBox.Show("Sửa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Sửa thất bại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            UCQLTDNN ucQLTDNgoaiNgu = new UCQLTDNN();

            ucQLTDNgoaiNgu.hienThi();
            this.Close();
        }