void _bindingData()
        {
            _clearData();
            QL_HOATDONG_HNXH_DOITUONG_KHAC item = gvGrid.GetFocusedRow() as QL_HOATDONG_HNXH_DOITUONG_KHAC;

            if (item != null)
            {
                txtHo.Text            = item.DTK_HO;
                txtTen.Text           = item.DTK_TEN;
                txtChucVu.Text        = item.DTK_CHUCVU;
                lueGioiTinh.EditValue = item.DTK_GIOITINH;
                txtEmail.Text         = item.DTK_EMAIL;
                txtFace.Text          = item.DTK_FACEBOOK;
                txtCMND.Text          = item.DTK_CMND_SO;
                if (item.DTK_CMND_NGAYCAP.HasValue)
                {
                    deNgayCap_Ngay.EditValue  = item.DTK_CMND_NGAYCAP.Value.Day;
                    deNgayCap_Thang.EditValue = item.DTK_CMND_NGAYCAP.Value.Month;
                    deNgayCap_Nam.EditValue   = item.DTK_CMND_NGAYCAP.Value.Year;
                }
                txtNoiCap.Text         = item.DTK_CMND_NOICAP;
                txtDiaChi.Text         = item.DTK_DIACHI;
                txtSoDienThoai.Text    = item.DTK_SDT;
                txtMaSoThue.Text       = item.DTK_MASOTHUE;
                txtSTK.Text            = item.DTK_TK_SO;
                txtTenNganHang.Text    = item.DTK_TK_NGANHANG;
                txtDiaChiNganHang.Text = item.DTK_TK_DIACHI;

                txtDonVi_Ten.Text         = item.DTK_DONVI_TEN;
                txtDonVi_SDT.EditValue    = item.DTK_DONVI_SDT;
                txtDonVi_DiaChi.EditValue = item.DTK_DONVI_DIACHI;
            }
        }
        private void _setObjectEntities(ref QL_HOATDONG_HNXH_DOITUONG_KHAC item)
        {
            item.DTK_HO       = txtHo.Text;
            item.DTK_TEN      = txtTen.Text;
            item.DTK_CHUCVU   = txtChucVu.Text;
            item.DTK_GIOITINH = lueGioiTinh.EditValue + string.Empty;
            item.DTK_EMAIL    = txtEmail.Text;
            item.DTK_FACEBOOK = txtFace.Text;
            item.DTK_CMND_SO  = txtCMND.Text;
            if (deNgayCap_Nam.EditValue != null)
            {
                item.DTK_CMND_NGAYCAP = new DateTime(deNgayCap_Nam.Ex_EditValueToInt() ?? 1, deNgayCap_Thang.Ex_EditValueToInt() ?? 1, deNgayCap_Ngay.Ex_EditValueToInt() ?? 0);
            }
            item.DTK_CMND_NOICAP = txtNoiCap.Text;
            item.DTK_DIACHI      = txtDiaChi.Text;
            item.DTK_MASOTHUE    = txtMaSoThue.Text;
            item.DTK_TK_SO       = txtSTK.Text;
            item.DTK_TK_NGANHANG = txtTenNganHang.Text;
            item.DTK_TK_DIACHI   = txtDiaChiNganHang.Text;

            item.DTK_DONVI_TEN    = txtDonVi_Ten.Text;
            item.DTK_DONVI_DIACHI = txtDonVi_DiaChi.Text;
            item.DTK_DONVI_SDT    = txtDonVi_SDT.Text;
            item.DTK_SDT          = txtSoDienThoai.Text;
        }
        private void _saveData()
        {
            if (_validateControl())
            {
                WaitDialogForm _wait = new WaitDialogForm("Đang lưu dữ liệu ...", "Vui lòng đợi giây lát");
                using (var _context = new QL_HOIVIEN_KTEntities())
                {
                    QL_HOATDONG_HNXH_DOITUONG_KHAC item;
                    switch (_formStatus)
                    {
                    case EnumFormStatus.ADD:

                        item = new QL_HOATDONG_HNXH_DOITUONG_KHAC();
                        _setObjectEntities(ref item);
                        idRowSelected = _maxID();
                        item.DTK_ID   = idRowSelected;
                        data.Add(item);

                        break;

                    case EnumFormStatus.MODIFY:
                        Int64 id = Convert.ToInt64(gvGrid.GetFocusedRowCellValue(colDTK_ID));
                        item = (from p in data where p.DTK_ID == id select p).FirstOrDefault();
                        if (item != null)
                        {
                            _setObjectEntities(ref item);
                        }

                        data.Where(p => p.DTK_ID == id).ToList().ForEach(p => p = item);
                        break;

                    case EnumFormStatus.DELETE:
                        Int64 deleteId = Convert.ToInt64(gvGrid.GetFocusedRowCellValue(colDTK_ID));
                        item = (from p in data where p.DTK_ID == deleteId select p).FirstOrDefault();
                        if (item != null)
                        {
                            if (item.PARENT_ID == null)      //Nếu là dòng mới thì xóa luôn
                            {
                                data.Remove(item);
                            }
                            else
                            {
                                data.Where(p => p.DTK_ID == deleteId).ToList().ForEach(p => p.PARENT_ID = clsParameter.statusDeleted);
                            }
                        }

                        break;

                    default:
                        break;
                    }
                    _context.SaveChanges();
                }
                FormStatus = EnumFormStatus.VIEW;
                _wait.Close();
            }
        }