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); string nganh = cboNganh.SelectedValue.ToString(); bool kt = trinhdoCMBUL.xoaTDCM(maNV, nganh); 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); } UCQLTrinhDoChuyenMon uCQLTrinhDoChuyen = new UCQLTrinhDoChuyenMon(); uCQLTrinhDoChuyen.hienThi(); this.Close(); } else { this.Close(); } }
private void btnSuaTDCM_Click_1(object sender, EventArgs e) { int maNV = Convert.ToInt32(txtMaNV.Text); string nganh = cboNganh.SelectedValue.ToString(); string trinhdo = cboTrinhDo.SelectedValue.ToString(); string loaihinhDT = cboLoaiHinhDT.SelectedValue.ToString(); string truongDT = txtTruongDT.Text.ToString(); bool kt = trinhdoCMBUL.suaTDCM(maNV, nganh, trinhdo, loaihinhDT, truongDT); 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); } UCQLTrinhDoChuyenMon uCQLTrinhDoChuyen = new UCQLTrinhDoChuyenMon(); uCQLTrinhDoChuyen.hienThi(); this.Close(); }
private void btnThemTDCM_Click_1(object sender, EventArgs e) { int maNV = Convert.ToInt32(cbbMaNV.SelectedValue); txtTenNV.Text = hosoBUL.LayTenTheoMaNhanVien(Convert.ToInt32(cbbMaNV.SelectedValue.ToString())); string nganh = txtNganh.Text.ToString(); string trinhdo = cboTrinhDo.SelectedValue.ToString(); string loaihinhDT = cbbLoaiHinhDT.SelectedValue.ToString(); string truongDT = txtTruongDT.Text.ToString(); bool kt = trinhDoChuyenMonBUL.ThemTDCM(maNV, nganh, trinhdo, loaihinhDT, truongDT); if (kt) { MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Thêm thất bại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } UCQLTrinhDoChuyenMon uCQLTrinhDoChuyen = new UCQLTrinhDoChuyenMon(); uCQLTrinhDoChuyen.hienThi(); this.Close(); }