コード例 #1
0
ファイル: Principal.cs プロジェクト: whatanaka/estudos
 private void btnConfigBusiness_Click(object sender, EventArgs e)
 {
     try
     {
         this.BiderConnection();
         this.BinderProgram();
         if ((Program.SqlTableList == null) || (Program.SqlTableList.Count == 0))
         {
             Program.SqlTableList = LoadDataBaseSchema.GetTables();
         }
         new Configuracoes().Show();
         Program.configProgram = true;
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, "CSGen", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
     }
 }
コード例 #2
0
ファイル: Principal.cs プロジェクト: whatanaka/estudos
 private void btnGerar_Click(object sender, EventArgs e)
 {
     if (!Program.configProgram)
     {
         this.sbFileLog.AppendLine("Start Process - " + DateTime.Now.ToString());
         this.sbFileLog.AppendLine();
         this.BiderConnection();
         this.BinderProgram();
         Program.SqlTableList = LoadDataBaseSchema.GetTables();
         this.GerarQueryConfig();
         this.GerarDBClassConfig();
         this.GerarBusinessClassConfig();
         this.sbFileLog.AppendLine("Finish Process - " + DateTime.Now.ToString());
         this.persisteLog();
     }
     else
     {
         this.sbFileLog.AppendLine("Start Process - " + DateTime.Now.ToString());
         this.sbFileLog.AppendLine();
         if (!Directory.Exists(this.txtPath.Text + @"\CSGen"))
         {
             Directory.CreateDirectory(this.txtPath.Text + @"\CSGen");
         }
         Program.outputPath = this.txtPath.Text + @"\CSGen";
         this.BinderProgram();
         this.GerarQueryConfig();
         this.GerarDBClassConfig();
         this.GerarBusinessClassConfig();
         this.sbFileLog.AppendLine("Finish Process - " + DateTime.Now.ToString());
         this.persisteLog();
     }
     if (Program.createSolution)
     {
         CreateProject project = new CreateProject(TipoProjeto.DataBase);
         project.Build();
         CreateProject project2 = new CreateProject(TipoProjeto.Business);
         project2.stringDataBaseGuide = project.stringGuid;
         project2.Build();
         new CSGen.CreateSolution.CreateSolution(project.stringGuid, project2.stringGuid).Build();
     }
     MessageBox.Show("Processo Executado com Sucesso!", "CSGen", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
 }