private void btnPlanoDeMarketing_Click(object sender, EventArgs e)
        {
            PlanoDeMarketing PMarketing = new PlanoDeMarketing();
            PMarketing.IdPlano = PlanoSelecionado.GetId();

            if (PMarketingDal.VerificarPlanoDeMarketingExistente(PMarketing))
            {
                PMarketing.Id = PMarketingDal.BuscarIdPlanoDeMarketing(PlanoSelecionado.GetId());

                if (!PSCDAL.VerificarProdutoServicoComercializacao(PMarketing.Id))
                {
                    PSCDAL.CadastrarPSC(PMarketing.Id);
                }

                if (!LNegocioDAL.VerificarLocalizacaoDoNegocio(PMarketing.Id))
                {
                    LNegocioDAL.CadastrarLocalizacaoDoNegocio(PMarketing.Id);
                }

               FrmPlanoDeMarketing FormPlanoDeMarketing = new FrmPlanoDeMarketing(PMarketing);
               FormPlanoDeMarketing.ShowDialog();
            }
            else
            {
                PMarketingDal.CadastrarPlanoDeMarketing(PMarketing.IdPlano);
            }
        }
        //funcionando
        public bool VerificarPlanoDeMarketingExistente(PlanoDeMarketing Plano)
        {
            try
            {
                Dal.ConectarBanco();

                //SELECT SELECT * FROM planodemarketing where id_Plano=8;

                string QueryPesquisar = "select * from planodemarketing where id_Plano=@IdPlano;";

                ComandoPesquisarPlanoDeMarketing = new MySqlCommand(QueryPesquisar);
                ComandoPesquisarPlanoDeMarketing.Connection = Dal.Conn;

                ComandoPesquisarPlanoDeMarketing.Parameters.AddWithValue("@IdPlano", Plano.IdPlano);

                ReaderPesquisarPlanoDeMarketing = ComandoPesquisarPlanoDeMarketing.ExecuteReader();

                if (ReaderPesquisarPlanoDeMarketing.HasRows)
                { return true; }
                else
                { return false; }
            }
            catch
            {
                return false;
            }
            finally
            {
                Dal.FecharConexao();
                ReaderPesquisarPlanoDeMarketing.Close();

            }
        }
 public FrmPlanoDeMarketing(PlanoDeMarketing planomarketing)
 {
     InitializeComponent();
     this.PMarketing = planomarketing;
 }