Example #1
0
        public DanhSachHopDong()
        {
            InitializeComponent();
            oHopDong = new Business.HDQD.CNVC_HopDong();
            oLoaiHopDong = new Business.HDQD.LoaiHopDong();

        }
Example #2
0
        private void btn_Delete_Click(object sender, EventArgs e)
        {
            try
            {
                if (p_ma_tuyen_dung_old != null)
                {
                    if (MessageBox.Show("Bạn thực sự muốn xoá hợp đồng này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        oHopdong = new Business.HDQD.CNVC_HopDong();
                        oHopdong.Delete(thongTinCNVC1.txt_MaNV.Text, p_ma_tuyen_dung_old);

                        MessageBox.Show("Xoá thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Xoá không thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Hợp đồng chưa được nhập. Không thể xóa!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Có lỗi xảy ra!\n" + ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #3
0
        //string m_ma_nv = null;

        public QLNS_HopDongTuyenDung()
        {
            InitializeComponent();
            oTTTuyenDung = new Business.CNVC.CNVC_ThongTinTuyenDung();
            oHopDong = new Business.HDQD.CNVC_HopDong();
            dtTTTuyenDung = new DataTable();
            dtHopDong = new DataTable();
        }
Example #4
0
        //string m_ma_nv = null;

        public QLNS_HopDongTuyenDung()
        {
            InitializeComponent();
            oTTTuyenDung  = new Business.CNVC.CNVC_ThongTinTuyenDung();
            oHopDong      = new Business.HDQD.CNVC_HopDong();
            dtTTTuyenDung = new DataTable();
            dtHopDong     = new DataTable();
        }
Example #5
0
        public TiepNhan(Business.HDQD.CNVC_HopDong p_HopDong, string p_ho, string p_ten)
        {
            InitializeComponent();
            InitObject();
            IsUpdate = true;

            oHopdong = p_HopDong;
            DisplayInfo(p_ho, p_ten);

            p_ma_tuyen_dung_old = oHopdong.Ma_Tuyen_Dung;
        }
Example #6
0
        public HopDong(Business.HDQD.CNVC_HopDong p_HopDong)
        {
            InitializeComponent();
            InitObject();
            IsUpdate = true;

            oHopdong = p_HopDong;
            DisplayInfo();

            p_ma_tuyen_dung_old = oHopdong.Ma_Tuyen_Dung;
        }
Example #7
0
        /// <summary>
        /// Refresh Data Source cho dtg sau moi lan thao tac
        /// </summary>
        private void RefreshDataSource()
        {
            Business.HDQD.CNVC_HopDong hopdong = new Business.HDQD.CNVC_HopDong();    // khong dung chung oChucVu duoc ???

            string ma_nv  = txt_MaNV.Text == "" ? null : txt_MaNV.Text;
            string ho_nv  = txt_Ho.Text == "" ? null : txt_Ho.Text;
            string ten_nv = txt_Ten.Text == "" ? null : txt_Ten.Text;
            string ma_hd  = txt_MaHD.Text == "" ? null : txt_MaHD.Text;

            int?ma_loai_hd = null;

            if (comB_Loai.Text != "")
            {
                ma_loai_hd = Convert.ToInt16(comB_Loai.SelectedValue);
            }

            bool?co_thoi_han = null;

            if (comB_CoThoiHan.Text == "Có thời hạn")
            {
                co_thoi_han = true;
            }
            else if (comB_CoThoiHan.Text == "Không thời hạn")
            {
                co_thoi_han = false;
            }
            else
            {
                co_thoi_han = null;
            }

            DateTime?ngay_ky_tu  = null;
            DateTime?ngay_ky_den = null;

            if (dTP_TuNgay.Checked == true)
            {
                ngay_ky_tu  = dTP_TuNgay.Value;
                ngay_ky_den = dTP_DenNgay.Value;
            }

            dtDSHopDong = hopdong.Search_HD(ma_nv, ho_nv, ten_nv, ma_hd, ma_loai_hd, co_thoi_han, ngay_ky_tu, ngay_ky_den);
            //dtDSHopDong = hopdong.Search_HD(ma_nv, ma_hd, ma_loai_hd, ngay_ky_tu, ngay_ky_den);
            PrepareDataSource();
        }
Example #8
0
        private void InitObject()
        {
            oHopdong  = new Business.HDQD.CNVC_HopDong();
            oChucdanh = new ChucDanh();
            oChucvu   = new ChucVu();
            oDonvi    = new DonVi();
            oBacHeSo  = new Business.Luong.BacHeSo();
            dtBacHeSo = new DataTable();
            oLoaiPC   = new Business.HDQD.LoaiPhuCap();
            oFile     = new Business.CNVC.CNVC_File();
            dtLoaiPC  = new DataTable();
            dtPhuCap  = new DataTable();
            oFTP      = new Business.FTP();

            dtLoaiPC  = oLoaiPC.GetList_Cbo();
            dtDSDonVi = new DataTable();

            PreapreDataSource();
            Prepare_Data_BacHeSo();
            PrepareDataTablePhuCap();
            thongTinQuyetDinh1.dTP_NgayHieuLuc.ValueChanged += dTP_NgayHieuLuc_ValueChanged;
        }
Example #9
0
        public QDDungHopDong()
        {
            InitializeComponent();
            oHopDong = new Business.HDQD.CNVC_HopDong();
            oQuyetDinh = new Business.HDQD.QuyetDinh();
            dtDSHopDong = new DataTable();

            thongTinQuyetDinh1.dTP_NgayHetHan.Visible = false;
            thongTinQuyetDinh1.label7.Visible = false;

            #region Xử lý dữ liệu cho cbo Loại Quyết Định
            DataTable dt = new DataTable();
            dt.Columns.Add("loai_quyet_dinh_id", typeof(int));
            dt.Columns.Add("ten_loai_quyet_dinh", typeof(string));

            dt.Rows.Add(new object[2] { 14, "Thôi việc" });

            thongTinQuyetDinh1.comB_Loai.DataSource = dt;
            thongTinQuyetDinh1.comB_Loai.DisplayMember = "ten_loai_quyet_dinh";
            thongTinQuyetDinh1.comB_Loai.ValueMember = "loai_quyet_dinh_id";
            #endregion
        }
Example #10
0
        private void InitObject()
        {
            oHopdong     = new Business.HDQD.CNVC_HopDong();
            oLoaihopdong = new Business.HDQD.LoaiHopDong();
            oChucdanh    = new ChucDanh();
            oChucvu      = new ChucVu();
            oDonvi       = new DonVi();
            oFTP         = new Business.FTP();
            oFile        = new Business.CNVC.CNVC_File();
            oBacHeSo     = new Business.Luong.BacHeSo();
            dtBacHeSo    = new DataTable();

            oLoaiPC     = new Business.HDQD.LoaiPhuCap();
            dtPhuCap    = new DataTable();
            dtLoaiPC    = new DataTable();
            dtDonVi     = new DataTable();
            oCNVCPhuCap = new Business.HDQD.CNVC_PhuCap();

            dtLoaiPC = oLoaiPC.GetList_Cbo();

            PreapreDataSource();
            Prepare_Data_BacHeSo();
            PrepareDataTablePhuCap();
        }
Example #11
0
        public QDDungHopDong()
        {
            InitializeComponent();
            oHopDong    = new Business.HDQD.CNVC_HopDong();
            oQuyetDinh  = new Business.HDQD.QuyetDinh();
            dtDSHopDong = new DataTable();

            thongTinQuyetDinh1.dTP_NgayHetHan.Visible = false;
            thongTinQuyetDinh1.label7.Visible         = false;

            #region Xử lý dữ liệu cho cbo Loại Quyết Định
            DataTable dt = new DataTable();
            dt.Columns.Add("loai_quyet_dinh_id", typeof(int));
            dt.Columns.Add("ten_loai_quyet_dinh", typeof(string));

            dt.Rows.Add(new object[2] {
                14, "Thôi việc"
            });

            thongTinQuyetDinh1.comB_Loai.DataSource    = dt;
            thongTinQuyetDinh1.comB_Loai.DisplayMember = "ten_loai_quyet_dinh";
            thongTinQuyetDinh1.comB_Loai.ValueMember   = "loai_quyet_dinh_id";
            #endregion
        }
Example #12
0
        private void btn_Them_Click(object sender, EventArgs e)
        {
            if (CheckInputData())
            {
                oHopdong = new Business.HDQD.CNVC_HopDong();

                bool bUploadInfoSuccess = false;    // KHANG : dung de biet upload info thanh cong
                                                    // neu thanh cong moi upload file
                oHopdong.Ma_NV = thongTinCNVC1.txt_MaNV.Text;

                oHopdong.Ma_Tuyen_Dung = txt_MaHD.Text;
                oHopdong.Ma_Loai_HD    = Convert.ToInt16(comB_LoaiHD.SelectedValue);

                oHopdong.La_QD_Tiep_Nhan = false;
                oHopdong.Ten_Quyet_Dinh  = null;
                oHopdong.Loai_QD_ID      = null;

                oHopdong.Co_Thoi_Han = cb_ThoiHan.Checked;

                if (dTP_NgayKy.Checked == true)
                {
                    oHopdong.Ngay_Ky = dTP_NgayKy.Value;
                }
                else
                {
                    oHopdong.Ngay_Ky = null;
                }

                oHopdong.Ngay_Hieu_Luc = dtp_TuNgay.Value;

                if (dtp_DenNgay.Checked == true)
                {
                    oHopdong.Ngay_Het_Han = dtp_DenNgay.Value;
                }
                else
                {
                    oHopdong.Ngay_Het_Han = null;
                }

                //if (comB_DonVi.SelectedText != "")
                oHopdong.Don_Vi_ID = Convert.ToInt16(comB_DonVi.SelectedValue);
                //else
                //    oHopdong.Don_Vi_ID = null;

                if (comB_ChucDanh.Text != "")
                {
                    oHopdong.Chuc_Danh_ID = Convert.ToInt16(comB_ChucDanh.SelectedValue);
                }
                else
                {
                    oHopdong.Chuc_Danh_ID = null;
                }

                if (comB_ChucVu.Text != "")
                {
                    oHopdong.Chuc_Vu_ID = Convert.ToInt16(comB_ChucVu.SelectedValue);
                }
                else
                {
                    oHopdong.Chuc_Vu_ID = null;
                }

                oHopdong.Ghi_Chu = rTB_GhiChu.Text;

                oHopdong.Tham_nien_nang_bac = cb_ThamNienNB.Checked;
                oHopdong.Tham_nien_nha_giao = cb_ThamNienNG.Checked;
                oHopdong.Dong_bao_hiem      = cb_DongBaoHiem.Checked;

                #region Lương Info
                try
                {
                    if (comb_Luong.SelectedIndex == 0)      // he so
                    {
                        oHopdong.Khoan_or_HeSo = true;
                        oHopdong.Luong_Khoan   = null;
                        oHopdong.BacHeSo_ID    = Convert.ToInt32(comb_Bac.SelectedValue.ToString());
                        oHopdong.PhanTramHuong = Convert.ToDouble(nup_PhanTram.Value);
                    }
                    else
                    {
                        oHopdong.Khoan_or_HeSo = false;
                        oHopdong.Luong_Khoan   = Convert.ToDouble(txt_Tien.Text);
                        oHopdong.BacHeSo_ID    = null;
                        oHopdong.PhanTramHuong = Convert.ToDouble(nup_PhanTram.Value);
                    }
                }
                catch
                {
                    MessageBox.Show("Có lỗi xảy ra khi xử lý thông tin lương.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                #endregion

                #region Phu cap Info
                oHopdong.Co_Phu_Cap = !cb_CoPhuCap.Checked;

                List <int>      loai_pc_id     = new List <int>();
                List <double>   value_khoan    = new List <double>();
                List <double>   value_heso     = new List <double>();
                List <double>   value_phantram = new List <double>();
                List <double>   phan_tram      = new List <double>();
                List <DateTime> tu_ngay        = new List <DateTime>();
                List <DateTime> den_ngay       = new List <DateTime>();
                List <string>   ghi_chu        = new List <string>();

                foreach (DataRow dr in dtPhuCap.Rows)
                {
                    int loaipc_id = Convert.ToInt16(dr["loai_pc_id"].ToString());
                    loai_pc_id.Add(loaipc_id);

                    int cach_tinh = Convert.ToInt16((from c in dtLoaiPC.AsEnumerable()
                                                     where c.Field <int>("id") == loaipc_id
                                                     select c.Field <int>("cach_tinh")).ElementAt(0).ToString());

                    switch (cach_tinh)
                    {
                    case 1:
                        if (dr["value_khoan"].ToString() == "")
                        {
                            value_khoan.Add(-1);
                        }
                        else
                        {
                            value_khoan.Add(Convert.ToDouble(dr["value_khoan"].ToString()));
                        }

                        value_heso.Add(-1);
                        value_phantram.Add(-1);
                        break;

                    case 2:
                        value_khoan.Add(-1);

                        if (dr["value_he_so"].ToString() == "")
                        {
                            value_heso.Add(-1);
                        }
                        else
                        {
                            value_heso.Add(Convert.ToDouble(dr["value_he_so"].ToString()));
                        }

                        value_phantram.Add(-1);
                        break;

                    case 3:
                        value_khoan.Add(-1);

                        if (dr["value_he_so"].ToString() == "")
                        {
                            value_heso.Add(-1);
                        }
                        else
                        {
                            value_heso.Add(Convert.ToDouble(dr["value_he_so"].ToString()));
                        }

                        value_phantram.Add(-1);
                        break;

                    case 4:
                        value_khoan.Add(-1);
                        value_heso.Add(-1);

                        if (dr["value_phan_tram"].ToString() == "")
                        {
                            value_phantram.Add(-1);
                        }
                        else
                        {
                            value_phantram.Add(Convert.ToDouble(dr["value_phan_tram"].ToString()));
                        }
                        break;

                    default:
                        break;
                    }
                    phan_tram.Add(Convert.ToDouble(dr["phan_tram_huong"].ToString()));
                    tu_ngay.Add(Convert.ToDateTime(dr["tu_ngay"].ToString()).Date);

                    if (dr["den_ngay"].ToString() == "")
                    {
                        den_ngay.Add(Convert.ToDateTime("01/01/1901").Date);
                    }
                    else
                    {
                        den_ngay.Add(Convert.ToDateTime(dr["den_ngay"].ToString()).Date);
                    }

                    ghi_chu.Add(dr["ghi_chu"].ToString());
                }

                oHopdong.Loai_Phu_Cap_ID  = loai_pc_id.ToArray();
                oHopdong.Value_Khoan      = value_khoan.ToArray();
                oHopdong.Value_HeSo       = value_heso.ToArray();
                oHopdong.Value_PhanTram   = value_phantram.ToArray();
                oHopdong.PC_PhanTramHuong = phan_tram.ToArray();
                oHopdong.PC_TuNgay        = tu_ngay.ToArray();
                oHopdong.PC_DenNgay       = den_ngay.ToArray();
                oHopdong.PC_GhiChu        = ghi_chu.ToArray();

                #endregion

                if (IsUpdate == false)
                {
                    try
                    {
                        if (MessageBox.Show("Bạn thực sự muốn thêm hợp đồng cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            //if (oHopdong.Add())
                            //if (oHopdong.Add_wLuong())
                            if (oHopdong.Add_wLuong_PhuCap())
                            {
                                MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                bUploadInfoSuccess = true;
                                ResetInterface();
                            }
                            else
                            {
                                MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }

                            if (oFile.Path.Count > 0 && bUploadInfoSuccess)
                            {
                                UploadFile();
                            }
                        }
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    try
                    {
                        if (MessageBox.Show("Bạn thực sự muốn sửa hợp đồng cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            //if (oHopdong.Add())
                            //if (oHopdong.Add_wLuong())
                            if (oHopdong.Update_wLuong_PhuCap(p_ma_tuyen_dung_old))
                            {
                                MessageBox.Show("Cập nhật thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                bUploadInfoSuccess = true;
                                ResetInterface();
                            }
                            else
                            {
                                MessageBox.Show("Thao tác cập nhật thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }

                            if (oFile.Path.Count > 0 && bUploadInfoSuccess)
                            {
                                UploadFile();
                            }
                        }
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Thao tác cập nhật thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            else
            {
                MessageBox.Show("Vui lòng nhập đầy đủ thông tin.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #13
0
 public DanhSachHopDong()
 {
     InitializeComponent();
     oHopDong     = new Business.HDQD.CNVC_HopDong();
     oLoaiHopDong = new Business.HDQD.LoaiHopDong();
 }
Example #14
0
        private void btn_Them_Click(object sender, EventArgs e)
        {
            if (CheckInputData())
            {
                oHopdong = new Business.HDQD.CNVC_HopDong();

                DateTime dtp_donvi_denngay = DateTime.ParseExact(txt_DenNgay_DV.Text, "dd/MM/yyyy", null);
                if (dtp_DenNgay.Checked == false || dtp_DenNgay.Value > dtp_donvi_denngay)
                {
                    #region Insert multiple donvi
                    int selected_donvi = Convert.ToInt32(comB_DonVi.SelectedValue);

                    DataTable dt_donvi_new = oDonvi.GetDonVi_New(selected_donvi);

                    if (dt_donvi_new.Rows.Count > 0)
                    {
                        string loai_qd = (from c in dt_donvi_new.AsEnumerable()
                                          select c.Field <string>("ten_loai_qd")).ElementAt(0).ToString();
                        string ten_qd = (from c in dt_donvi_new.AsEnumerable()
                                         select c.Field <string>("ten_qd")).ElementAt(0).ToString();
                        string ma_qd = (from c in dt_donvi_new.AsEnumerable()
                                        select c.Field <string>("ma_quyet_dinh")).ElementAt(0).ToString();
                        DateTime ngay_hieu_luc_qd = (from c in dt_donvi_new.AsEnumerable()
                                                     select c.Field <DateTime>("ngay_hieu_luc_qd")).ElementAt(0);

                        MessageBox.Show("Loại quyết định: " + loai_qd + "\nMã quyết định: " + ma_qd + "\nTên quyết định: " + ten_qd + "\nNgày hiệu lực: " + ngay_hieu_luc_qd.ToString("d", CultureInfo.CreateSpecificCulture("vi-VN")) + "\nVui lòng chọn đơn vị phù hợp.",
                                        "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        int m_chuc_vu_ori   = -1;
                        int m_chuc_danh_ori = -1;
                        if (comB_ChucVu.Text != "")
                        {
                            m_chuc_vu_ori = Convert.ToInt32(comB_ChucVu.SelectedValue.ToString());
                        }
                        else
                        {
                            m_chuc_vu_ori = -1;
                        }

                        if (comB_ChucDanh.Text != "")
                        {
                            m_chuc_danh_ori = Convert.ToInt32(comB_ChucDanh.SelectedValue.ToString());
                        }
                        else
                        {
                            m_chuc_danh_ori = -1;
                        }

                        Forms.Popup frPopup = new Forms.Popup(new UCs.DonViCu(dt_donvi_new, dtp_DenNgay.Checked, dtp_DenNgay.Value, selected_donvi, m_chuc_vu_ori, m_chuc_danh_ori), "Danh sách đơn vị");
                        frPopup.ShowDialog();

                        if (nSelectedDonViID.Count() == nSelectedChucDanhID.Count() && nSelectedDonViID.Count() == nSelectedChucVuID.Count())
                        {
                            GatherInfo();
                            if (nChange_DenNgay == true)
                            {
                                oHopdong.Ngay_Het_Han = ndtp_DenNgay_Change;
                            }
                            try
                            {
                                if (MessageBox.Show("Bạn thực sự muốn thêm hợp đồng cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                                {
                                    if (oHopdong.Add_HopDongOld(nSelectedDonViID, nSelectedChucVuID, nSelectedChucDanhID))
                                    {
                                        MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                        ResetInterface();
                                    }
                                    else
                                    {
                                        MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                    }
                                }
                            }
                            catch (Exception)
                            {
                                MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                        else
                        {
                            MessageBox.Show("Có lỗi xảy ra! Vui lòng kiểm tra lại thông tin.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    else
                    {
                        try
                        {
                            if (MessageBox.Show("Không thể tìm thấy đơn vị mới hơn đơn vị được chọn, và thời gian hợp đồng kết thúc lớn hơn thời gian đơn vị ngừng hoạt động. Bạn có muốn thay đổi thời gian hợp đồng kết thúc bằng thời gian đơn vị ngừng hoạt động?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            {
                                GatherInfo();
                                oHopdong.Ngay_Het_Han = dtp_donvi_denngay; //update ngay het han = ngay het han cua don vi
                                oHopdong.Don_Vi_ID    = Convert.ToInt16(comB_DonVi.SelectedValue);

                                if (comB_ChucDanh.Text != "")
                                {
                                    oHopdong.Chuc_Danh_ID = Convert.ToInt16(comB_ChucDanh.SelectedValue);
                                }
                                else
                                {
                                    oHopdong.Chuc_Danh_ID = null;
                                }

                                if (comB_ChucVu.Text != "")
                                {
                                    oHopdong.Chuc_Vu_ID = Convert.ToInt16(comB_ChucVu.SelectedValue);
                                }
                                else
                                {
                                    oHopdong.Chuc_Vu_ID = null;
                                }

                                try
                                {
                                    if (MessageBox.Show("Bạn thực sự muốn thêm hợp đồng cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                                    {
                                        if (oHopdong.Add_wLuong_PhuCap())
                                        {
                                            MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                            ResetInterface();
                                        }
                                        else
                                        {
                                            MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                        }
                                    }
                                }
                                catch (Exception)
                                {
                                    MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("Có lỗi xảy ra!" + ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }

                    #endregion
                }
                else //Insert 1 donvi
                {
                    GatherInfo();
                    oHopdong.Don_Vi_ID = Convert.ToInt16(comB_DonVi.SelectedValue);

                    if (comB_ChucDanh.Text != "")
                    {
                        oHopdong.Chuc_Danh_ID = Convert.ToInt16(comB_ChucDanh.SelectedValue);
                    }
                    else
                    {
                        oHopdong.Chuc_Danh_ID = null;
                    }

                    if (comB_ChucVu.Text != "")
                    {
                        oHopdong.Chuc_Vu_ID = Convert.ToInt16(comB_ChucVu.SelectedValue);
                    }
                    else
                    {
                        oHopdong.Chuc_Vu_ID = null;
                    }

                    try
                    {
                        if (MessageBox.Show("Bạn thực sự muốn thêm hợp đồng cho nhân viên này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (oHopdong.Add_wLuong_PhuCap())
                            {
                                MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                ResetInterface();
                            }
                            else
                            {
                                MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Thao tác thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            else
            {
                MessageBox.Show("Có lỗi xảy ra! Vui lòng kiểm tra lại thông tin.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #15
0
        /// <summary>
        /// Refresh Data Source cho dtg sau moi lan thao tac
        /// </summary>
        private void RefreshDataSource()
        {
            Business.HDQD.CNVC_HopDong hopdong = new Business.HDQD.CNVC_HopDong();    // khong dung chung oChucVu duoc ???
            
            string ma_nv = txt_MaNV.Text == "" ? null : txt_MaNV.Text;
            string ho_nv = txt_Ho.Text == "" ? null : txt_Ho.Text;
            string ten_nv = txt_Ten.Text == "" ? null : txt_Ten.Text;
            string ma_hd = txt_MaHD.Text == "" ? null : txt_MaHD.Text;

            int? ma_loai_hd = null;
            if (comB_Loai.Text != "")
                ma_loai_hd = Convert.ToInt16(comB_Loai.SelectedValue);

            bool? co_thoi_han = null;
            if (comB_CoThoiHan.Text == "Có thời hạn")
                co_thoi_han = true;
            else if (comB_CoThoiHan.Text == "Không thời hạn")
                co_thoi_han = false;
            else
                co_thoi_han = null;
            
            DateTime? ngay_ky_tu = null;
            DateTime? ngay_ky_den = null;
            if (dTP_TuNgay.Checked == true)
            {
                ngay_ky_tu = dTP_TuNgay.Value;
                ngay_ky_den = dTP_DenNgay.Value;
            }

            dtDSHopDong = hopdong.Search_HD(ma_nv, ho_nv, ten_nv, ma_hd, ma_loai_hd, co_thoi_han, ngay_ky_tu, ngay_ky_den);
            //dtDSHopDong = hopdong.Search_HD(ma_nv, ma_hd, ma_loai_hd, ngay_ky_tu, ngay_ky_den);
            PrepareDataSource();

        }
Example #16
0
        private void dtgv_DSHD_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dtgv_DSHD.CurrentRow != null)
            {
                DataGridViewRow row = dtgv_DSHD.CurrentRow;
                oHopDong                 = new Business.HDQD.CNVC_HopDong();
                oHopDong.ID              = Convert.ToInt16(row.Cells["id"].Value.ToString());
                oHopDong.Ma_NV           = row.Cells["ma_nv"].Value.ToString();
                oHopDong.Ma_Tuyen_Dung   = row.Cells["ma_hop_dong"].Value.ToString();
                oHopDong.La_QD_Tiep_Nhan = false;
                oHopDong.Ma_Loai_HD      = Convert.ToInt16(row.Cells["ma_loai_hd"].Value.ToString());
                oHopDong.Loai_Hop_Dong   = row.Cells["loai_hop_dong"].Value.ToString();
                oHopDong.Co_Thoi_Han     = Convert.ToBoolean(row.Cells["co_thoi_han"].Value.ToString());
                if (row.Cells["ngay_ky"].Value.ToString() != "")
                {
                    oHopDong.Ngay_Ky = Convert.ToDateTime(row.Cells["ngay_ky"].Value.ToString());
                }
                if (row.Cells["ngay_hieu_luc"].Value.ToString() != "")
                {
                    oHopDong.Ngay_Hieu_Luc = Convert.ToDateTime(row.Cells["ngay_hieu_luc"].Value.ToString());
                }
                if (row.Cells["ngay_het_han"].Value.ToString() != "")
                {
                    oHopDong.Ngay_Het_Han = Convert.ToDateTime(row.Cells["ngay_het_han"].Value.ToString());
                }
                if (row.Cells["chuc_vu_chinh_id"].Value.ToString() != "")
                {
                    oHopDong.Chuc_Vu_ID = Convert.ToInt16(row.Cells["chuc_vu_chinh_id"].Value.ToString());
                }
                oHopDong.Chuc_Vu = row.Cells["ten_chuc_vu"].Value.ToString();

                if (row.Cells["chuc_danh_chinh_id"].Value.ToString() != "")
                {
                    oHopDong.Chuc_Danh_ID = Convert.ToInt16(row.Cells["chuc_danh_chinh_id"].Value.ToString());
                }
                oHopDong.Chuc_Danh = row.Cells["ten_chuc_danh"].Value.ToString();

                if (row.Cells["don_vi_chinh_id"].Value.ToString() != "")
                {
                    oHopDong.Don_Vi_ID = Convert.ToInt16(row.Cells["don_vi_chinh_id"].Value.ToString());
                }
                oHopDong.Don_Vi     = row.Cells["ten_don_vi"].Value.ToString();
                oHopDong.Tinh_Trang = Convert.ToBoolean(row.Cells["tinh_trang"].Value.ToString());
                oHopDong.Ghi_Chu    = row.Cells["ghi_chu"].Value.ToString();

                if (row.Cells["tham_nien_nang_bac"].Value.ToString() != "")
                {
                    oHopDong.Tham_nien_nang_bac = Convert.ToBoolean(row.Cells["tham_nien_nang_bac"].Value.ToString());
                }
                else
                {
                    oHopDong.Tham_nien_nang_bac = false;
                }
                if (row.Cells["tham_nien_gd"].Value.ToString() != "")
                {
                    oHopDong.Tham_nien_nha_giao = Convert.ToBoolean(row.Cells["tham_nien_gd"].Value.ToString());
                }
                else
                {
                    oHopDong.Tham_nien_nha_giao = false;
                }

                if (row.Cells["dong_bao_hiem"].Value.ToString() != "")
                {
                    oHopDong.Dong_bao_hiem = Convert.ToBoolean(row.Cells["dong_bao_hiem"].Value.ToString());
                }
                else
                {
                    oHopDong.Dong_bao_hiem = false;
                }

                #region Luong Info
                oHopDong.Khoan_or_HeSo = Convert.ToBoolean(row.Cells["tinh_trang"].Value.ToString());
                if (row.Cells["luong_khoan"].Value.ToString() != "")
                {
                    oHopDong.Luong_Khoan = Convert.ToDouble(row.Cells["luong_khoan"].Value.ToString());
                }
                if (row.Cells["ngach_bac_heso_id"].Value.ToString() != "")
                {
                    oHopDong.BacHeSo_ID = Convert.ToInt16(row.Cells["ngach_bac_heso_id"].Value.ToString());
                }
                if (row.Cells["phan_tram_huong"].Value.ToString() != "")
                {
                    oHopDong.PhanTramHuong = Convert.ToDouble(row.Cells["phan_tram_huong"].Value.ToString());
                }
                #endregion

                oHopDong.Co_Phu_Cap = Convert.ToBoolean(row.Cells["co_phu_cap"].Value.ToString());

                UCs.HopDong hopdong = new HopDong(oHopDong);
                Forms.Popup popup   = new Forms.Popup(hopdong, "QUẢN LÝ NHÂN SỰ - HỢP ĐỒNG");
                popup.Show();
            }
        }
Example #17
0
        private void Show_QD_TiepNhan(DataGridViewRow p_row)
        {
            try
            {
                string ma_qd = p_row.Cells["ma_quyet_dinh"].Value.ToString();
                Business.HDQD.CNVC_HopDong oHopDong = new Business.HDQD.CNVC_HopDong();
                DataTable dt = oHopDong.Search_QD_TiepNhan(ma_qd);

                if (dt.Rows.Count > 0)
                {
                    oHopDong.ID = Convert.ToInt16(dt.Rows[0]["id"].ToString());
                    oHopDong.Ma_NV = dt.Rows[0]["ma_nv"].ToString();
                    string cnvc_ho = dt.Rows[0]["ho"].ToString();
                    string cnvc_ten = dt.Rows[0]["ten"].ToString();

                    oHopDong.Ma_Tuyen_Dung = dt.Rows[0]["ma_hop_dong"].ToString();
                    oHopDong.La_QD_Tiep_Nhan = true;
                    oHopDong.Ten_Quyet_Dinh = p_row.Cells["ten"].Value.ToString();
                    oHopDong.Loai_QD_ID = Convert.ToInt16(p_row.Cells["loai_qd_id"].Value.ToString());
                    if (p_row.Cells["ngay_ky"].Value.ToString() != "")
                        oHopDong.Ngay_Ky = Convert.ToDateTime(p_row.Cells["ngay_ky"].Value.ToString());
                    if (p_row.Cells["ngay_hieu_luc"].Value.ToString() != "")
                        oHopDong.Ngay_Hieu_Luc = Convert.ToDateTime(p_row.Cells["ngay_hieu_luc"].Value.ToString());
                    if (p_row.Cells["ngay_het_han"].Value.ToString() != "")
                        oHopDong.Ngay_Het_Han = Convert.ToDateTime(p_row.Cells["ngay_het_han"].Value.ToString());
                    oHopDong.MoTa_QD = p_row.Cells["mo_ta"].Value.ToString();

                    oHopDong.Co_Thoi_Han = Convert.ToBoolean(dt.Rows[0]["co_thoi_han"].ToString());
                    
                    if (dt.Rows[0]["chuc_vu_chinh_id"].ToString() != "")
                        oHopDong.Chuc_Vu_ID = Convert.ToInt16(dt.Rows[0]["chuc_vu_chinh_id"].ToString());
                    oHopDong.Chuc_Vu = dt.Rows[0]["ten_chuc_vu"].ToString();

                    if (dt.Rows[0]["chuc_danh_chinh_id"].ToString() != "")
                        oHopDong.Chuc_Danh_ID = Convert.ToInt16(dt.Rows[0]["chuc_danh_chinh_id"].ToString());
                    oHopDong.Chuc_Danh = dt.Rows[0]["ten_chuc_danh"].ToString();

                    if (dt.Rows[0]["don_vi_chinh_id"].ToString() != "")
                        oHopDong.Don_Vi_ID = Convert.ToInt16(dt.Rows[0]["don_vi_chinh_id"].ToString());
                    oHopDong.Don_Vi = dt.Rows[0]["ten_don_vi"].ToString();
                    oHopDong.Tinh_Trang = Convert.ToBoolean(dt.Rows[0]["tinh_trang"].ToString());
                    oHopDong.Ghi_Chu = dt.Rows[0]["ghi_chu"].ToString();

                    if (dt.Rows[0]["tham_nien_nang_bac"].ToString() != "")
                        oHopDong.Tham_nien_nang_bac = Convert.ToBoolean(dt.Rows[0]["tham_nien_nang_bac"].ToString());
                    else
                        oHopDong.Tham_nien_nang_bac = false;

                    if (dt.Rows[0]["tham_nien_gd"].ToString() != "")
                        oHopDong.Tham_nien_nha_giao = Convert.ToBoolean(dt.Rows[0]["tham_nien_gd"].ToString());
                    else
                        oHopDong.Tham_nien_nha_giao = false;

                    #region Luong Info
                    oHopDong.Khoan_or_HeSo = Convert.ToBoolean(dt.Rows[0]["tinh_trang"].ToString());
                    if (dt.Rows[0]["luong_khoan"].ToString() != "")
                        oHopDong.Luong_Khoan = Convert.ToDouble(dt.Rows[0]["luong_khoan"].ToString());
                    if (dt.Rows[0]["ngach_bac_heso_id"].ToString() != "")
                        oHopDong.BacHeSo_ID = Convert.ToInt16(dt.Rows[0]["ngach_bac_heso_id"].ToString());
                    if (dt.Rows[0]["phan_tram_huong"].ToString() != "")
                        oHopDong.PhanTramHuong = Convert.ToDouble(dt.Rows[0]["phan_tram_huong"].ToString());
                    #endregion

                    oHopDong.Co_Phu_Cap = Convert.ToBoolean(dt.Rows[0]["co_phu_cap"].ToString());

                    UCs.TiepNhan tiepnhan = new TiepNhan(oHopDong, cnvc_ho, cnvc_ten);
                    Forms.Popup popup = new Forms.Popup(tiepnhan, "QUẢN LÝ NHÂN SỰ - QUYẾT ĐỊNH TIẾP NHẬN");
                    popup.Show();
                }
            }
            catch { }
            


        }
Example #18
0
        private void Show_QD_TiepNhan(DataGridViewRow p_row)
        {
            try
            {
                string ma_qd = p_row.Cells["ma_quyet_dinh"].Value.ToString();
                Business.HDQD.CNVC_HopDong oHopDong = new Business.HDQD.CNVC_HopDong();
                DataTable dt = oHopDong.Search_QD_TiepNhan(ma_qd);

                if (dt.Rows.Count > 0)
                {
                    oHopDong.ID    = Convert.ToInt16(dt.Rows[0]["id"].ToString());
                    oHopDong.Ma_NV = dt.Rows[0]["ma_nv"].ToString();
                    string cnvc_ho  = dt.Rows[0]["ho"].ToString();
                    string cnvc_ten = dt.Rows[0]["ten"].ToString();

                    oHopDong.Ma_Tuyen_Dung   = dt.Rows[0]["ma_hop_dong"].ToString();
                    oHopDong.La_QD_Tiep_Nhan = true;
                    oHopDong.Ten_Quyet_Dinh  = p_row.Cells["ten"].Value.ToString();
                    oHopDong.Loai_QD_ID      = Convert.ToInt16(p_row.Cells["loai_qd_id"].Value.ToString());
                    if (p_row.Cells["ngay_ky"].Value.ToString() != "")
                    {
                        oHopDong.Ngay_Ky = Convert.ToDateTime(p_row.Cells["ngay_ky"].Value.ToString());
                    }
                    if (p_row.Cells["ngay_hieu_luc"].Value.ToString() != "")
                    {
                        oHopDong.Ngay_Hieu_Luc = Convert.ToDateTime(p_row.Cells["ngay_hieu_luc"].Value.ToString());
                    }
                    if (p_row.Cells["ngay_het_han"].Value.ToString() != "")
                    {
                        oHopDong.Ngay_Het_Han = Convert.ToDateTime(p_row.Cells["ngay_het_han"].Value.ToString());
                    }
                    oHopDong.MoTa_QD = p_row.Cells["mo_ta"].Value.ToString();

                    oHopDong.Co_Thoi_Han = Convert.ToBoolean(dt.Rows[0]["co_thoi_han"].ToString());

                    if (dt.Rows[0]["chuc_vu_chinh_id"].ToString() != "")
                    {
                        oHopDong.Chuc_Vu_ID = Convert.ToInt16(dt.Rows[0]["chuc_vu_chinh_id"].ToString());
                    }
                    oHopDong.Chuc_Vu = dt.Rows[0]["ten_chuc_vu"].ToString();

                    if (dt.Rows[0]["chuc_danh_chinh_id"].ToString() != "")
                    {
                        oHopDong.Chuc_Danh_ID = Convert.ToInt16(dt.Rows[0]["chuc_danh_chinh_id"].ToString());
                    }
                    oHopDong.Chuc_Danh = dt.Rows[0]["ten_chuc_danh"].ToString();

                    if (dt.Rows[0]["don_vi_chinh_id"].ToString() != "")
                    {
                        oHopDong.Don_Vi_ID = Convert.ToInt16(dt.Rows[0]["don_vi_chinh_id"].ToString());
                    }
                    oHopDong.Don_Vi     = dt.Rows[0]["ten_don_vi"].ToString();
                    oHopDong.Tinh_Trang = Convert.ToBoolean(dt.Rows[0]["tinh_trang"].ToString());
                    oHopDong.Ghi_Chu    = dt.Rows[0]["ghi_chu"].ToString();

                    if (dt.Rows[0]["tham_nien_nang_bac"].ToString() != "")
                    {
                        oHopDong.Tham_nien_nang_bac = Convert.ToBoolean(dt.Rows[0]["tham_nien_nang_bac"].ToString());
                    }
                    else
                    {
                        oHopDong.Tham_nien_nang_bac = false;
                    }

                    if (dt.Rows[0]["tham_nien_gd"].ToString() != "")
                    {
                        oHopDong.Tham_nien_nha_giao = Convert.ToBoolean(dt.Rows[0]["tham_nien_gd"].ToString());
                    }
                    else
                    {
                        oHopDong.Tham_nien_nha_giao = false;
                    }

                    #region Luong Info
                    oHopDong.Khoan_or_HeSo = Convert.ToBoolean(dt.Rows[0]["tinh_trang"].ToString());
                    if (dt.Rows[0]["luong_khoan"].ToString() != "")
                    {
                        oHopDong.Luong_Khoan = Convert.ToDouble(dt.Rows[0]["luong_khoan"].ToString());
                    }
                    if (dt.Rows[0]["ngach_bac_heso_id"].ToString() != "")
                    {
                        oHopDong.BacHeSo_ID = Convert.ToInt16(dt.Rows[0]["ngach_bac_heso_id"].ToString());
                    }
                    if (dt.Rows[0]["phan_tram_huong"].ToString() != "")
                    {
                        oHopDong.PhanTramHuong = Convert.ToDouble(dt.Rows[0]["phan_tram_huong"].ToString());
                    }
                    #endregion

                    oHopDong.Co_Phu_Cap = Convert.ToBoolean(dt.Rows[0]["co_phu_cap"].ToString());

                    UCs.TiepNhan tiepnhan = new TiepNhan(oHopDong, cnvc_ho, cnvc_ten);
                    Forms.Popup  popup    = new Forms.Popup(tiepnhan, "QUẢN LÝ NHÂN SỰ - QUYẾT ĐỊNH TIẾP NHẬN");
                    popup.Show();
                }
            }
            catch { }
        }
Example #19
0
        private void dtgv_HopDong_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dtgv_HopDong.CurrentRow != null)
            {
                #region Old
                /*
                DataGridViewRow row = dtgv_HopDong.CurrentRow;
                Business.HDQD.CNVC_HopDong m_oHopDong = new Business.HDQD.CNVC_HopDong();
                m_oHopDong.ID = Convert.ToInt16(row.Cells["id"].Value.ToString());
                m_oHopDong.Ma_NV = row.Cells["ma_nv"].Value.ToString();
                m_oHopDong.Ma_Hop_Dong = row.Cells["ma_hop_dong"].Value.ToString();
                m_oHopDong.Ma_Loai_HD = Convert.ToInt16(row.Cells["ma_loai_hd"].Value.ToString());
                m_oHopDong.Loai_Hop_Dong = row.Cells["loai_hop_dong"].Value.ToString();
                m_oHopDong.Co_Thoi_Han = Convert.ToBoolean(row.Cells["co_thoi_han"].Value.ToString());
                if (row.Cells["ngay_ky"].Value.ToString() != "")
                    m_oHopDong.Ngay_Ky = Convert.ToDateTime(row.Cells["ngay_ky"].Value.ToString());
                if (row.Cells["ngay_hieu_luc"].Value.ToString() != "")
                    m_oHopDong.Ngay_Hieu_Luc = Convert.ToDateTime(row.Cells["ngay_hieu_luc"].Value.ToString());
                if (row.Cells["ngay_het_han"].Value.ToString() != "")
                    m_oHopDong.Ngay_Het_Han = Convert.ToDateTime(row.Cells["ngay_het_han"].Value.ToString());
                if (row.Cells["chuc_vu_chinh_id"].Value.ToString() != "")
                    m_oHopDong.Chuc_Vu_ID = Convert.ToInt16(row.Cells["chuc_vu_chinh_id"].Value.ToString());
                m_oHopDong.Chuc_Vu = row.Cells["ten_chuc_vu"].Value.ToString();
                if (row.Cells["chuc_danh_chinh_id"].Value.ToString() != "")
                    m_oHopDong.Chuc_Danh_ID = Convert.ToInt16(row.Cells["chuc_danh_chinh_id"].Value.ToString());
                m_oHopDong.Chuc_Danh = row.Cells["ten_chuc_danh"].Value.ToString();
                if (row.Cells["don_vi_chinh_id"].Value.ToString() != "")
                    m_oHopDong.Don_Vi_ID = Convert.ToInt16(row.Cells["don_vi_chinh_id"].Value.ToString());
                m_oHopDong.Don_Vi = row.Cells["ten_don_vi"].Value.ToString();
                m_oHopDong.Tinh_Trang = Convert.ToBoolean(row.Cells["tinh_trang"].Value.ToString());
                m_oHopDong.Ghi_Chu = row.Cells["ghi_chu"].Value.ToString();

                HDQD.UCs.HopDong hopdong = new HDQD.UCs.HopDong(m_oHopDong);
                //UCs.HopDong hopdong = new HopDong(oHopDong);
                Forms.Popup popup = new Forms.Popup("QUẢN LÝ NHÂN SỰ - HỢP ĐỒNG", hopdong);
                popup.Show();*/
                #endregion
               

                DataGridViewRow row = dtgv_HopDong.CurrentRow;
                oHopDong = new Business.HDQD.CNVC_HopDong();
                oHopDong.ID = Convert.ToInt16(row.Cells["id"].Value.ToString());
                oHopDong.Ma_NV = row.Cells["ma_nv"].Value.ToString();
                oHopDong.Ma_Tuyen_Dung = row.Cells["ma_hop_dong"].Value.ToString();
                oHopDong.La_QD_Tiep_Nhan = false;
                oHopDong.Ma_Loai_HD = Convert.ToInt16(row.Cells["ma_loai_hd"].Value.ToString());
                oHopDong.Loai_Hop_Dong = row.Cells["loai_hop_dong"].Value.ToString();
                oHopDong.Co_Thoi_Han = Convert.ToBoolean(row.Cells["co_thoi_han"].Value.ToString());
                if (row.Cells["ngay_ky"].Value.ToString() != "")
                    oHopDong.Ngay_Ky = Convert.ToDateTime(row.Cells["ngay_ky"].Value.ToString());
                if (row.Cells["ngay_hieu_luc"].Value.ToString() != "")
                    oHopDong.Ngay_Hieu_Luc = Convert.ToDateTime(row.Cells["ngay_hieu_luc"].Value.ToString());
                if (row.Cells["ngay_het_han"].Value.ToString() != "")
                    oHopDong.Ngay_Het_Han = Convert.ToDateTime(row.Cells["ngay_het_han"].Value.ToString());
                if (row.Cells["chuc_vu_chinh_id"].Value.ToString() != "")
                    oHopDong.Chuc_Vu_ID = Convert.ToInt16(row.Cells["chuc_vu_chinh_id"].Value.ToString());
                oHopDong.Chuc_Vu = row.Cells["ten_chuc_vu"].Value.ToString();

                if (row.Cells["chuc_danh_chinh_id"].Value.ToString() != "")
                    oHopDong.Chuc_Danh_ID = Convert.ToInt16(row.Cells["chuc_danh_chinh_id"].Value.ToString());
                oHopDong.Chuc_Danh = row.Cells["ten_chuc_danh"].Value.ToString();

                if (row.Cells["don_vi_chinh_id"].Value.ToString() != "")
                    oHopDong.Don_Vi_ID = Convert.ToInt16(row.Cells["don_vi_chinh_id"].Value.ToString());
                oHopDong.Don_Vi = row.Cells["ten_don_vi"].Value.ToString();
                oHopDong.Tinh_Trang = Convert.ToBoolean(row.Cells["tinh_trang"].Value.ToString());
                oHopDong.Ghi_Chu = row.Cells["ghi_chu"].Value.ToString();

                if (row.Cells["tham_nien_nang_bac"].Value.ToString() != "")
                    oHopDong.Tham_nien_nang_bac = Convert.ToBoolean(row.Cells["tham_nien_nang_bac"].Value.ToString());
                else
                    oHopDong.Tham_nien_nang_bac = false;
                if (row.Cells["tham_nien_gd"].Value.ToString() != "")
                    oHopDong.Tham_nien_nha_giao = Convert.ToBoolean(row.Cells["tham_nien_gd"].Value.ToString());
                else
                    oHopDong.Tham_nien_nha_giao = false;

                if (row.Cells["dong_bao_hiem"].Value.ToString() != "")
                    oHopDong.Dong_bao_hiem = Convert.ToBoolean(row.Cells["dong_bao_hiem"].Value.ToString());
                else
                    oHopDong.Dong_bao_hiem = false;

                #region Luong Info
                oHopDong.Khoan_or_HeSo = Convert.ToBoolean(row.Cells["tinh_trang"].Value.ToString());
                if (row.Cells["luong_khoan"].Value.ToString() != "")
                    oHopDong.Luong_Khoan = Convert.ToDouble(row.Cells["luong_khoan"].Value.ToString());
                if (row.Cells["ngach_bac_heso_id"].Value.ToString() != "")
                    oHopDong.BacHeSo_ID = Convert.ToInt16(row.Cells["ngach_bac_heso_id"].Value.ToString());
                if (row.Cells["phan_tram_huong"].Value.ToString() != "")
                    oHopDong.PhanTramHuong = Convert.ToDouble(row.Cells["phan_tram_huong"].Value.ToString());
                #endregion

                oHopDong.Co_Phu_Cap = Convert.ToBoolean(row.Cells["co_phu_cap"].Value.ToString());

                HDQD.UCs.HopDong hopdong = new HDQD.UCs.HopDong(oHopDong); 
                Forms.Popup popup = new Forms.Popup("QUẢN LÝ NHÂN SỰ - HỢP ĐỒNG", hopdong);
                popup.Show();
            }
        }