/// <summary> /// Método que faz o Load da classe /// </summary> public override void Load() { Util.CL_Files.WriteOnTheLog("MD_Cenario.Load()", Util.Global.TipoLog.DETALHADO); string sentenca = base.table.CreateCommandSQLTable() + " WHERE CODIGOCEN = " + this.codigo + " AND TAREFA = " + project.NumeroTarefa; SQLiteDataReader reader = Util.DataBase.Select(sentenca); if (reader == null) { this.Empty = true; } else if (reader.Read()) { EhReparo = reader["REPARO"].ToString().Equals("0") ? Reparo.SIM : Reparo.NAO; Tarefa = int.Parse(reader["NUTAREFA"].ToString()); VersaoSgbd = reader["VERSAOSGBD"].ToString(); TipoBanco = reader["TIPOBANCO"].ToString().Equals(0) ? Banco.ORACLE : Banco.SQLSERVER; BancoUtilizado = reader["BANCOUTIL"].ToString(); Entrada = reader["ENTRADA"].ToString(); Saida = reader["SAIDA"].ToString(); Passos = reader["PASSOS"].ToString(); TipoDoSistema = (TipoSistema)int.Parse((reader["SISTEMA"].ToString())); Status = new MD_Status(int.Parse(reader["CODIGOSTAT"].ToString())); DataCriacao = Util.DataBase.Int_to_Date(int.Parse(reader["DATA_CRIACAO"].ToString())); this.Empty = false; reader.Close(); } else { this.Empty = true; reader.Close(); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Util.CL_Files.CreateMainDirectories(); Util.DataBase.OpenConnection(); Util.Global.log_system = Util.DataBase.GetLog(); Util.CL_Files.WriteOnTheLog("--------------------------------------Iniciando sistema", Util.Global.TipoLog.SIMPLES); // Chamadas das classes modelo para criação das tabelas Model.MD_Status status = new Model.MD_Status(0); Model.MD_Project project = new Model.MD_Project(0, 0); Model.MD_Estimativa estimativa = new Model.MD_Estimativa(0, project); Model.MD_Cenario cenario = new Model.MD_Cenario(0, project); Model.MD_Anexos a = new Model.MD_Anexos(0, cenario); Model.MD_Status.InserirPrincipais(); Application.Run(new FO_Principal()); Util.DataBase.CloseConnection(); Util.CL_Files.WriteOnTheLog("--------------------------------------Finalizando sistema", Util.Global.TipoLog.SIMPLES); }