public void gerarAccess(Type objType)
        {
            try
            {
                sfdPlanilhaInterop.ShowDialog();

                if (objType == typeof(Preferencias_BLL))
                {
                    Preferencias_BLL objGenerico = new Preferencias_BLL();
                    objGenerico.gerarAccess(sfdPlanilhaInterop.FileName);
                }
                else if (objType == typeof(Familiares_BLL))
                {
                    Familiares_BLL objGenerico = new Familiares_BLL();
                    objGenerico.gerarAccess(sfdPlanilhaInterop.FileName);
                }
                else
                {
                    Preferencias_De_Familiares_BLL objGenerico = new Preferencias_De_Familiares_BLL();
                    objGenerico.gerarAccess(sfdPlanilhaInterop.FileName);
                }
                MessageBox.Show("Exportaçao do Excel Realizada ", "aviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            catch (Exception ex)
            {
                throw new Exception("Falhas na geraçao do Access " + ex.Message);
            }
        }
        public void ExcluirBDPreferenciaDeFamiliares(int intCodPrefFamExc, int intIDPrefFamExc)
        {
            try
            {
                objPreferenciasDeFamiliaresVO = new Preferencias_De_Familiares_VO();

                objPreferenciasDeFamiliaresVO.ObjFamiliarVO     = new Familiares_VO();
                objPreferenciasDeFamiliaresVO.ObjFamiliarVO.Cod = intCodPrefFamExc;

                objPreferenciasDeFamiliaresVO.ObjPreferenciasVO    = new Preferencias_VO();
                objPreferenciasDeFamiliaresVO.ObjPreferenciasVO.ID = intIDPrefFamExc;

                objPreferenciasDeFamiliaresBLL = new Preferencias_De_Familiares_BLL();

                if (objPreferenciasDeFamiliaresBLL.ExcluirBD(objPreferenciasDeFamiliaresVO))
                {
                    MessageBox.Show("Exclusao De Preferencia De Familiar Realizada ");
                }
                else
                {
                    MessageBox.Show("Problemas na Exclusao De Preferencia De Familiar");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Falhas ao Excluir Banco De Dados De Preferencia De Familiares " + ex.Message);
            }
        }
        public void AlterarBDPreferenciaDeFamiliar(int intCod, int intiD, float fltIntensidade, string strNome = null, string strDescricao = null, string strObservaçao = null)
        {
            try
            {
                objPreferenciasDeFamiliaresVO = new Preferencias_De_Familiares_VO();

                objPreferenciasDeFamiliaresVO.ObjFamiliarVO      = new Familiares_VO();
                objPreferenciasDeFamiliaresVO.ObjFamiliarVO.Cod  = intCod;
                objPreferenciasDeFamiliaresVO.ObjFamiliarVO.Nome = strNome;

                objPreferenciasDeFamiliaresVO.ObjPreferenciasVO           = new Preferencias_VO();
                objPreferenciasDeFamiliaresVO.ObjPreferenciasVO.ID        = intiD;
                objPreferenciasDeFamiliaresVO.ObjPreferenciasVO.Descricao = strDescricao;

                objPreferenciasDeFamiliaresVO.Intensidade = fltIntensidade;
                objPreferenciasDeFamiliaresVO.Observaçao  = strObservaçao;

                objPreferenciasDeFamiliaresBLL = new Preferencias_De_Familiares_BLL();

                if (objPreferenciasDeFamiliaresBLL.AlterarBD(objPreferenciasDeFamiliaresVO))
                {
                    MessageBox.Show("Alteraçao De Preferencia De Familiar Realizada ");
                }
                else
                {
                    MessageBox.Show("Problemas na Alteraçao De Preferencia De Familiar");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Falhas ao Alterar Banco De Dados De Preferencia De Familiares " + ex.Message);
            }
        }
        public void ConsultarBDPreferenciaDeFamiliar(int?intCod = null, int?intiD = null, string strNome = null, string strDescricao = null)
        {
            try
            {
                objPreferenciasDeFamiliaresBLL = new Preferencias_De_Familiares_BLL();

                objPreferenciasDeFamiliaresVO = new Preferencias_De_Familiares_VO();
                objFamiliaresVO      = new Familiares_VO();
                objFamiliaresVO.Cod  = Convert.ToInt32(intCod == null ? 0 : intCod);
                objFamiliaresVO.Nome = strNome;

                objPreferenciasVO           = new Preferencias_VO();
                objPreferenciasVO.ID        = Convert.ToInt32(intiD == null ? 0 : intiD);
                objPreferenciasVO.Descricao = strDescricao;

                objPreferenciasDeFamiliaresVO.ObjFamiliarVO     = objFamiliaresVO;
                objPreferenciasDeFamiliaresVO.ObjPreferenciasVO = objPreferenciasVO;

                bndsrcPrefFam.DataSource = objPreferenciasDeFamiliaresBLL.ConsultarBD(objPreferenciasDeFamiliaresVO);

                dtgvwPrefFam.Columns.Clear();
                dtgvwPrefFam.DataSource         = null;
                dtgvwPrefFam.AllowUserToAddRows = false;

                Preferencias_BLL objPreferencias = new Preferencias_BLL();
                bndsrcPrefFamLookUp.DataSource = objPreferenciasBLL.ConsultarBD(objPreferenciasVO);

                DataGridViewComboBoxColumn objColunaComboFamiliarLookUp = new DataGridViewComboBoxColumn();
                objColunaComboFamiliarLookUp.DataSource       = bndsrcFamiliar.DataSource;
                objColunaComboFamiliarLookUp.HeaderText       = "Codigo Do Familiar";
                objColunaComboFamiliarLookUp.Name             = "Cod";
                objColunaComboFamiliarLookUp.DisplayMember    = "Nome";
                objColunaComboFamiliarLookUp.ValueType        = typeof(int);
                objColunaComboFamiliarLookUp.ValueMember      = "Cod";
                objColunaComboFamiliarLookUp.DataPropertyName = "Cod";
                dtgvwPrefFam.Columns.Add(objColunaComboFamiliarLookUp);
                dtgvwPrefFam.Columns["Cod"].ValueType = typeof(int);

                DataGridViewComboBoxColumn objColunaComboPreferenciaLookUp = new DataGridViewComboBoxColumn();
                objColunaComboPreferenciaLookUp.DataSource    = bndsrcPrefFamLookUp.DataSource;
                objColunaComboPreferenciaLookUp.HeaderText    = "Descricao Do Familiar";
                objColunaComboPreferenciaLookUp.Name          = "ID";
                objColunaComboPreferenciaLookUp.ValueType     = typeof(int);
                objColunaComboPreferenciaLookUp.ValueMember   = "ID";
                objColunaComboPreferenciaLookUp.DisplayMember = "Descricao";
                dtgvwPrefFam.Columns.Add(objColunaComboPreferenciaLookUp);
                objColunaComboPreferenciaLookUp.DataPropertyName = "ID";


                dtgvwPrefFam.Columns["ID"].ValueType = typeof(int);

                dtgvwPrefFam.Columns.Add("Intensidade", "Intensidade Do Familiar");
                dtgvwPrefFam.Columns["Intensidade"].DataPropertyName = "Intensidade";

                dtgvwPrefFam.Columns.Add("Observaçao", "Observaçao Do Familiar");
                dtgvwPrefFam.Columns["Observaçao"].DataPropertyName = "Observaçao";

                dtgvwPrefFam.DataSource = bndsrcPrefFam;

                cmbbxPrefFam.Items.Clear();

                foreach (DataRow objPreferenciaLinha in ((DataTable)bndsrcPreferencias.DataSource).Rows)
                {
                    cmbbxPrefFam.Items.Add(objPreferenciaLinha["ID"].ToString() + "-" + objPreferenciaLinha["Descricao"].ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Falhas ao Consultar Banco De Dados De Preferencia De Familiares " + ex.Message);
            }
        }