示例#1
0
        /// <summary>
        /// Método que gera as classes de um projeto
        /// </summary>
        /// <param name="projeto"></param>
        public void GerarClasses(Model.MD_Projeto projeto)
        {
            Util.CL_Files.WriteOnTheLog("FO_Principal.GerarClasses()", Util.Global.TipoLog.DETALHADO);

            string mensagemErro                 = string.Empty;
            List <Model.MD_Tabela> tabelas      = projeto.GetTabelasProjeto();
            List <Model.MD_Tabela> tabelas_erro = projeto.GetTabelasProjeto();
            bool houveErro = false;

            if (tabelas.Count < 1)
            {
                Message.MensagemAlerta("Não há tabelas cadastradas para o projeto selecionado!");
            }
            else
            {
                BarraDeCarregamento barra = new BarraDeCarregamento(tabelas.Count * 2, "Gerando as classes");
                barra.Show();

                foreach (Model.MD_Tabela t in tabelas)
                {
                    barra.AvancaBarra(1);
                    if (!this.GerarClasse(t, ref mensagemErro))
                    {
                        tabelas_erro.Add(t);
                        houveErro = true;
                    }
                }

                barra.Close();
                barra.Dispose();
                barra = null;

                if (houveErro)
                {
                    string retorno = "Houve erro nas tabelas:" + Environment.NewLine;

                    foreach (Model.MD_Tabela t in tabelas_erro)
                    {
                        retorno += t.DAO.Nome + Environment.NewLine;
                    }

                    Message.MensagemAlerta(retorno);
                }
                else
                {
                    Message.MensagemSucesso("As classes foram geradas no diretórios: " + Util.Global.app_classesSaida_directory + "!");
                }
            }
        }
示例#2
0
        /// <summary>
        /// Método que carrega o tree view
        /// </summary>
        private void CarregaTreeView()
        {
            Util.CL_Files.WriteOnTheLog("FO_Principal.CarregaTreeView()", Util.Global.TipoLog.DETALHADO);

            this.trv_projetos.Nodes.Clear();
            BarraDeCarregamento aguarde = new BarraDeCarregamento(this.BuscaTotalItensTreeView(), "Carregando TreeView");

            aguarde.Show();
            this.trv_projetos.Scrollable = true;

            this.trv_projetos.Nodes.Add(this.CarregaProjetos(ref aguarde));

            aguarde.Close();
            aguarde.Dispose();
            aguarde = null;
        }