Ejemplo n.º 1
0
        static private void loadBitiData()
        {
            DateTime Dt_Inicio_Geral = DateTime.Now;

            String   Mensagem = "";
            DateTime Dt_Inicio;
            DateTime Dt_Fim;
            long     Tempo = 0;

            Connection SGQConn = new Connection();

            Dt_Inicio = DateTime.Now;
            var projetos = new sgq.biti.Projetos(TypeUpdate.IncrementFullUpdate);

            projetos.LoadData();
            Dt_Fim    = DateTime.Now;
            Tempo     = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Projetos.<br/>";


            DateTime Dt_Fim_Geral = DateTime.Now;

            SGQConn.Dispose();

            Mensagem =
                @"<br/>Início: " + Dt_Inicio_Geral.ToString("dd-MM-yyyy HH:mm:ss") +
                @"<br/>Fim:   " + Dt_Fim_Geral.ToString("dd-MM-yyyy HH:mm:ss") +
                @"<br/>Tempo: " + DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio_Geral, Dt_Fim_Geral).ToString() + " min<br/><br/>" +
                Mensagem;

            Gerais.Enviar_Email(Gerais.Get_Lista_To_Aviso_Carga(), Gerais.Get_Lista_CC_Aviso_Carga(), "SGQ-BITI: Atualizou - Tipo Atualização: COMPLETA", Mensagem);
        }
Ejemplo n.º 2
0
        public void loadData()
        {
            DateTime Dt_Inicio_Geral = DateTime.Now;

            var SGQConn = new Connection();

            var List_Nome_Projetos = new List <String>();

            List <Projeto_Template_05> projectList = this.GetProjects <Projeto_Template_05>();

            foreach (var project in projectList)
            {
                DateTime Dt_Inicio = DateTime.Now;

                var tests = new Tests(project, typeUpdate, database);
                tests.LoadData();

                var steps = new Steps(project, typeUpdate, database);
                steps.LoadData();

                var cts = new CTs(project, typeUpdate, database);
                cts.LoadData();

                var execucoes = new Execucoes(project, typeUpdate, database);
                execucoes.LoadData();

                var defeitos = new Defeitos(project, typeUpdate, database);
                defeitos.LoadData();

                var defeitosLinks = new Defeitos_Links(project, typeUpdate, database);
                defeitosLinks.LoadData();

                // Defeitos_Tempos.LoadData(project, typeUpdate, alm.Database);

                var historicos = new Historicos(project, typeUpdate, database);
                historicos.LoadData();

                DateTime Dt_Fim = DateTime.Now;

                long   Tempo             = DataEHora.DateDiff(DataEHora.DateInterval.Second, Dt_Inicio, Dt_Fim);
                string Nome_Projeto_BITI = SGQConn.Get_String($"select Nome from biti_subprojetos where id = '{project.Subprojeto}'");
                List_Nome_Projetos.Add(Tempo.ToString().PadLeft(4, '0') + " seg, " + project.Nome + " - " + Nome_Projeto_BITI);
            }

            SGQConn.Dispose();

            DateTime Dt_Fim_Geral = DateTime.Now;

            if (projectList.Count > 0)
            {
                List_Nome_Projetos.Sort();
                Gerais.Enviar_Email_Atualizacao_Projetos(
                    Assunto: string.Format($"[SGQLoader]{database.name} - projetos - {this.typeUpdate}"),
                    projectList: List_Nome_Projetos,
                    Dt_Inicio: Dt_Inicio_Geral,
                    Dt_Fim: Dt_Fim_Geral
                    );
            }
        }
Ejemplo n.º 3
0
        public static void LoadData(Projeto projeto, TypeUpdate typeUpdate, alm.Database database)
        {
            DateTime Dt_Inicio = DateTime.Now;

            Connection SGQConn = new Connection();

            if (typeUpdate == TypeUpdate.Full)
            {
                SGQConn.Executar($"delete ALM_Defeitos_Tempos where Subprojeto = '{projeto.Subprojeto}' and Entrega = '{projeto.Entrega}'");
            }

            Defeitos_Tempos_Processar(projeto, database);

            DateTime Dt_Fim = DateTime.Now;

            if (typeUpdate == TypeUpdate.Increment || typeUpdate == TypeUpdate.IncrementFullUpdate)
            {
                SGQConn.Executar($@"
                    update 
                        alm_projetos 
                    set Defeitos_Tempos_Incremental_Inicio='{Dt_Inicio.ToString("dd-MM-yy HH:mm:ss")}',
                        Defeitos_Tempos_Incremental_Fim='{Dt_Fim.ToString("dd-MM-yy HH:mm:ss")}',
                        Defeitos_Tempos_Incremental_Tempo={DataEHora.DateDiff(DataEHora.DateInterval.Second, Dt_Inicio, Dt_Fim)}
                    where 
                        subprojeto='{projeto.Subprojeto}' and entrega='{projeto.Entrega}'
                ");
            }
            else if (typeUpdate == TypeUpdate.Full)
            {
                SGQConn.Executar($@"
                    update 
                        alm_projetos 
                    set Defeitos_Tempos_Completa_Inicio='{Dt_Inicio.ToString("dd-MM-yy HH:mm:ss")}',
                        Defeitos_Tempos_Completa_Fim='{Dt_Fim.ToString("dd-MM-yy HH:mm:ss")}',
                        Defeitos_Tempos_Completa_Tempo={DataEHora.DateDiff(DataEHora.DateInterval.Second, Dt_Inicio, Dt_Fim)}
                    where 
                        subprojeto='{projeto.Subprojeto}' and entrega='{projeto.Entrega}'
                ");
            }

            SGQConn.Dispose();

            //====================================================================
            //Connection SGQConn = new Connection();
            //SGQConn.Executar(
            //    @"update ALM_Defeitos
            //            set Qtd_Reopen =
            //                (select count(*)
            //                    from
            //                    (select distinct Dt_Ate from ALM_Defeitos_Tempos t
            //                        where t.Subprojeto = '{Subprojeto}' and t.Entrega = '{Entrega}' and t.Defeito = ALM_Defeitos.Defeito and t.Status = 'REOPEN') x
            //                ) ".Replace("{Subprojeto}", projeto.Subprojeto).Replace("{Entrega}", projeto.Entrega));
            //SGQConn.Dispose();
            //====================================================================

            //Gerais.Enviar_Email_Atualizacao_Tabela("ALM", "ALM_Defeitos_Tempos - " + projeto.Subprojeto + " - " + projeto.Entrega, Dt_Inicio, Dt_Fim);
        }
Ejemplo n.º 4
0
        static private void RunMain()
        {
            DateTime Dt_Inicio_Geral = DateTime.Now;

            String   Mensagem = "";
            DateTime Dt_Inicio;
            DateTime Dt_Fim;
            long     Tempo = 0;

            Connection SGQConn = new Connection();

            Dt_Inicio = DateTime.Now;
            var projetos = new Projetos(TypeUpdate.IncrementFullUpdate);

            projetos.LoadData();
            Dt_Fim    = DateTime.Now;
            Tempo     = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Projetos.<br/>";

            //// Com Chave, Insert + Update
            //Dt_Inicio = DateTime.Now;
            //         //SGQConn.Executar("truncate table BITI_Sistemas");
            //         Sistemas.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Sistemas.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Ideias");
            //         Ideias.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Ideias.<br/>";

            //         //Dt_Inicio = DateTime.Now;
            //         //SGQConn.Executar("truncate table BITI_Projetos");
            //         //Projetos.Atualizar(TypeUpdate.Full);
            //         //Dt_Fim = DateTime.Now;
            //         //Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         //Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Projetos.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Subprojetos");
            //         Subprojetos.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Subprojetos.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_CRs");
            //         CRs.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: CRs.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Entregas");
            //         Entregas.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Entregas.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Frentes_Trabalho");
            //         Frentes_Trabalho.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Frentes_Trabalho.<br/>";

            //Dt_Inicio = DateTime.Now;
            //SGQConn.Executar("truncate table BITI_Desenhos");
            //Desenhos.Atualizar(TypeUpdate.Full);
            //Dt_Fim = DateTime.Now;
            //Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Desenho.<br/>";

            //Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Execucoes");
            //         Execucoes.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Execucoes.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Aprovacoes_Financeiras");
            //         Aprovacoes_Financeiras.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Aprovacoes_Financeiras.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Aprovacoes_Financeiras_FT");
            //         Aprovacoes_Financeiras_FT.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Aprovacoes_Financeiras_FT.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Propostas");
            //         Propostas.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Propostas.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Metricas");
            //         Metricas.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Metricas.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Fases_Contratadas");
            //         Fases_Contratadas.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Fases_Contratadas.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Macro_Estimativas");
            //         Macro_Estimativas.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Macro_Estimativas.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Documentos_Controlados");
            //         Documentos_Controlados.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Documentos_Controlados.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Usuarios");
            //         Usuarios.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Usuarios.<br/>";


            //         // Sem Chave, truncate + Insert
            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Cronogramas_Subprojetos");
            //         Cronogramas_Subprojetos.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Cronogramas_Subprojetos.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Cronogramas_Entregas");
            //         Cronogramas_Entregas.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Cronogramas_Entregas.<br/>";

            //         Dt_Inicio = DateTime.Now;
            //         SGQConn.Executar("truncate table BITI_Mudancas_Estados");
            //         Mudancas_Estados.Atualizar(TypeUpdate.Full);
            //         Dt_Fim = DateTime.Now;
            //         Tempo = DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio, Dt_Fim);
            //         Mensagem += Tempo.ToString().PadLeft(4, '0') + " min, Tabela: Mudancas_Estados.<br/>";

            //         Subprojetos.Atualizar_Classificacao();
            //         Entregas.Atualizar_Release();


            DateTime Dt_Fim_Geral = DateTime.Now;

            SGQConn.Dispose();

            Mensagem =
                @"<br/>Início: " + Dt_Inicio_Geral.ToString("dd-MM-yyyy HH:mm:ss") +
                @"<br/>Fim:   " + Dt_Fim_Geral.ToString("dd-MM-yyyy HH:mm:ss") +
                @"<br/>Tempo: " + DataEHora.DateDiff(DataEHora.DateInterval.Minute, Dt_Inicio_Geral, Dt_Fim_Geral).ToString() + " min<br/><br/>" +
                Mensagem;

            Gerais.Enviar_Email(Gerais.Get_Lista_To_Aviso_Carga(), Gerais.Get_Lista_CC_Aviso_Carga(), "SGQ-BITI: Atualizou - Tipo Atualização: COMPLETA", Mensagem);
        }
Ejemplo n.º 5
0
        private static List <Evento> Get_Eventos(Defeito defeito, List <Logs> List_Logs)
        {
            string Ultimo_Data             = "";
            string Ultimo_Status           = "";
            string Ultimo_Encaminhado_Para = "";
            var    List_Eventos            = new List <Evento>();
            var    evento = new Evento();

            evento.Dt_De = "";

            foreach (Logs oLogs in List_Logs)
            {
                if (evento.Dt_De == "")
                {
                    evento.Dt_De = oLogs.Data;
                }

                if (oLogs.Data != evento.Dt_De)
                {
                    evento.Dt_Ate = oLogs.Data;

                    if (evento.Status == null && Ultimo_Status != "")
                    {
                        evento.Status = Ultimo_Status;
                    }

                    if (evento.Encaminhado_Para == null && Ultimo_Encaminhado_Para != "")
                    {
                        evento.Encaminhado_Para = Ultimo_Encaminhado_Para;
                    }

                    Ultimo_Data             = evento.Dt_Ate;
                    Ultimo_Status           = evento.Status;
                    Ultimo_Encaminhado_Para = evento.Encaminhado_Para;

                    evento.Tempo_Util_Min = (long)DataEHora.BusinessTimeDelta(
                        DateTime.ParseExact(evento.Dt_De, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture),
                        DateTime.ParseExact(evento.Dt_Ate, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture)
                        ).TotalMinutes;

                    evento.Tempo_Decorrido_Min = DataEHora.DateDiff(
                        DataEHora.DateInterval.Minute,
                        DateTime.ParseExact(evento.Dt_De, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture),
                        DateTime.ParseExact(evento.Dt_Ate, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture)
                        );

                    List_Eventos.Add(evento);
                    evento       = new Evento();
                    evento.Dt_De = oLogs.Data;
                }

                evento.Operador = oLogs.Operador.ToUpper();

                if (oLogs.Valor != null)
                {
                    if (oLogs.Campo == "BG_STATUS")
                    {
                        evento.Status = oLogs.Valor.ToUpper();
                    }
                    else
                    {
                        evento.Encaminhado_Para = oLogs.Valor.ToUpper();
                    }
                }
            }

            if (evento.Dt_De != null && evento.Dt_De != "")
            {
                if (evento.Status == null && Ultimo_Status != "")
                {
                    evento.Status = Ultimo_Status;
                }

                if (evento.Encaminhado_Para == null && Ultimo_Encaminhado_Para != "")
                {
                    evento.Encaminhado_Para = Ultimo_Encaminhado_Para;
                }

                if (evento.Status == "CLOSED" || evento.Status == "CANCELLED")
                {
                    evento.Dt_Ate = evento.Dt_De;
                }
                else
                {
                    evento.Dt_Ate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }

                evento.Tempo_Util_Min = (long)DataEHora.BusinessTimeDelta(
                    DateTime.ParseExact(evento.Dt_De, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture),
                    DateTime.ParseExact(evento.Dt_Ate, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture)
                    ).TotalMinutes;

                evento.Tempo_Decorrido_Min = DataEHora.DateDiff(
                    DataEHora.DateInterval.Minute,
                    DateTime.ParseExact(evento.Dt_De, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture),
                    DateTime.ParseExact(evento.Dt_Ate, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture)
                    );

                List_Eventos.Add(evento);
            }

            return(List_Eventos);
        }
Ejemplo n.º 6
0
        public void LoadData()
        {
            DateTime Dt_Inicio = DateTime.Now;

            ALMConnection ALMConn = new ALMConnection(this.database);
            Connection    SGQConn = new Connection();

            SqlMaker2 sqlMaker2 = new SqlMaker2()
            {
                sqlMaker2Param = this.sqlMaker2Param
            };

            if (typeUpdate == TypeUpdate.Increment || typeUpdate == TypeUpdate.IncrementFullUpdate)
            {
                if (typeUpdate == TypeUpdate.IncrementFullUpdate)
                {
                    SGQConn.Executar($@"
                        update 
                            alm_projetos 
                        set Defeitos_Incremental_Inicio='00-00-00 00:00:00',
                            Defeitos_Incremental_Fim='00-00-00 00:00:00',
                            Defeitos_Incremental_Tempo=0
                        where 
                            subprojeto='{projeto.Subprojeto}' and entrega='{projeto.Entrega}'
                    ");
                }

                string           Sql_Insert        = sqlMaker2.Get_Oracle_Insert().Replace("{Esquema}", projeto.Esquema).Replace("{Subprojeto}", projeto.Subprojeto).Replace("{Entrega}", projeto.Entrega);
                OracleDataReader DataReader_Insert = ALMConn.Get_DataReader(Sql_Insert);
                if (DataReader_Insert != null && DataReader_Insert.HasRows == true)
                {
                    SGQConn.Executar(ref DataReader_Insert, 1);
                }

                string           Sql_Update        = sqlMaker2.Get_Oracle_Update().Replace("{Esquema}", projeto.Esquema).Replace("{Subprojeto}", projeto.Subprojeto).Replace("{Entrega}", projeto.Entrega);
                OracleDataReader DataReader_Update = ALMConn.Get_DataReader(Sql_Update);
                if (DataReader_Update != null && DataReader_Update.HasRows == true)
                {
                    SGQConn.Executar(ref DataReader_Update, 1);
                }

                //this.LoadData_Etapa();
                //this.LoadData_Etapa_Final();
                //this.LoadData_Improcedente();

                DateTime Dt_Fim = DateTime.Now;

                SGQConn.Executar($@"
                    update 
                        alm_projetos 
                    set Defeitos_Incremental_Inicio='{Dt_Inicio.ToString("dd-MM-yy HH:mm:ss")}',
                        Defeitos_Incremental_Fim='{Dt_Fim.ToString("dd-MM-yy HH:mm:ss")}',
                        Defeitos_Incremental_Tempo={DataEHora.DateDiff(DataEHora.DateInterval.Second, Dt_Inicio, Dt_Fim)}
                    where 
                        subprojeto='{projeto.Subprojeto}' and entrega='{projeto.Entrega}'
                ");
            }
            else if (typeUpdate == TypeUpdate.Full)
            {
                SGQConn.Executar($"delete alm_defeitos where subprojeto='{projeto.Subprojeto}' and entrega='{projeto.Entrega}'");

                string           Sql_Insert        = sqlMaker2.Get_Oracle_Insert().Replace("{Esquema}", projeto.Esquema).Replace("{Subprojeto}", projeto.Subprojeto).Replace("{Entrega}", projeto.Entrega);
                OracleDataReader DataReader_Insert = ALMConn.Get_DataReader(Sql_Insert);
                if (DataReader_Insert != null && DataReader_Insert.HasRows == true)
                {
                    SGQConn.Executar(ref DataReader_Insert, 1);
                }

                //this.LoadData_Etapa();
                //this.LoadData_Etapa_Final();
                //this.LoadData_Improcedente();

                DateTime Dt_Fim = DateTime.Now;

                SGQConn.Executar($@"
                    update 
                        alm_projetos 
                    set Defeitos_Completa_Inicio='{Dt_Inicio.ToString("dd-MM-yy HH:mm:ss")}',
                        Defeitos_Completa_Fim='{Dt_Fim.ToString("dd-MM-yy HH:mm:ss")}',
                        Defeitos_Completa_Tempo={DataEHora.DateDiff(DataEHora.DateInterval.Second, Dt_Inicio, Dt_Fim)}
                    where 
                        subprojeto='{projeto.Subprojeto}' and entrega='{projeto.Entrega}'
                ");
            }

            SGQConn.Dispose();
        }