예제 #1
0
        private void btnXoa_Click(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)
            {
                string maNV = lblMaNV.Text;
                hoSoBUL.xoaHoSo(maNV);
                this.Close();
                UCQLHoSo uCQLHo = new UCQLHoSo();
                uCQLHo.HienThi();
            }
            else
            {
                this.Close();
            }
        }
예제 #2
0
        private void btnThem_Click_1(object sender, EventArgs e)
        {
            string   hodem    = txtHodem.Text.ToString();
            string   ten      = txtTen.Text.ToString();
            DateTime ngaysinh = dtNgaySinh.Value;
            string   ns       = ngaysinh.ToString("MM/dd/yyyy");
            string   gioitinh = "";

            if (rdoNam.Checked)
            {
                gioitinh = rdoNam.Text;
            }
            else if (rdoNu.Checked)
            {
                gioitinh = rdoNu.Text;
            }
            string   sdt        = txtSodt.Text.ToString();
            string   email      = txtEmail.Text.ToString();
            DateTime ngaytd     = dtNgayTD.Value;
            string   ntd        = ngaytd.ToString("MM/dd/yyyy");
            int      maphongban = Convert.ToInt32(cbbMaPhongBan.SelectedValue);
            bool     kt         = hosoBUL.ThemHoSo(hodem, ten, ns, gioitinh, sdt, email, ntd, maphongban);

            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);
            }
            UCQLHoSo ucQLHS = new UCQLHoSo();
            int      ma     = hosoBUL.LayMaHoSoMoiThem();

            lbMaNhanVien.Text = ma.ToString();

            cbbMaChucVu.DataSource    = chucVuBUL.LayDSChucVu();
            cbbMaChucVu.DisplayMember = "tenchucvu";
            cbbMaChucVu.ValueMember   = "machucvu";
            dtTuNgay.Format           = DateTimePickerFormat.Custom;
            dtTuNgay.CustomFormat     = "dd/MM/yyyy";
            dtDenNgay.Format          = DateTimePickerFormat.Custom;
            dtDenNgay.CustomFormat    = "dd/MM/yyyy";
            lblTen.Text = hosoBUL.LayTenTheoMaNhanVien(ma);

            lbMaNhanVienTDCM.Text           = ma.ToString();
            lbTenNhanVienTDCM.Text          = hosoBUL.LayTenTheoMaNhanVien(ma);
            cboTrinhDo.DataSource           = trinhDoChuyenMonBUL.LayThongTinTrinhDoCHuyenMongopTD();
            cboTrinhDo.DisplayMember        = "TrinhDo";
            cboTrinhDo.ValueMember          = "TrinhDo";
            cbbLoaihinhDaoTao.DataSource    = trinhDoChuyenMonBUL.LayThongTinTrinhDoCHuyenMongopLHDT();
            cbbLoaihinhDaoTao.DisplayMember = "LoaiHinhDaoTao";
            cbbLoaihinhDaoTao.ValueMember   = "LoaiHinhDaoTao";

            lbMaNhanVienTDNN.Text     = ma.ToString();
            lbTenNhanVienTDNN.Text    = hosoBUL.LayTenTheoMaNhanVien(ma);
            cboNgoaiNgu.DataSource    = trinhdoNNBUL.LayThongTinTDNNgopNN();
            cboNgoaiNgu.DisplayMember = "NgoaiNgu";
            cboNgoaiNgu.ValueMember   = "NgoaiNgu";

            lbMaNhanvienQTCT.Text = ma.ToString();

            dtTuNgay.Format         = DateTimePickerFormat.Custom;
            dtTuNgay.CustomFormat   = "dd/MM/yyyy";
            dtDenNgay.Format        = DateTimePickerFormat.Custom;
            dtDenNgay.CustomFormat  = "dd/MM/yyyy";
            cbbChucVu.DataSource    = chucVuBUL.LayDSChucVu();
            cbbChucVu.DisplayMember = "tenchucvu";
            cbbChucVu.ValueMember   = "tenchucvu";
            lbTenNhanVienQTCT.Text  = hosoBUL.LayTenTheoMaNhanVien(ma);

            ucQLHS.HienThi();
        }