Beispiel #1
0
        public void LoadProjetistasCadastrados(string idOOPR)
        {
            string QryStr = null;

            QryStr = "Select Code, Name from [@FLX_FB_PRJ]";
            projetistas = ((SAPbobsCOM.Recordset)(ConexaoSAP.Instance.getOCompany().GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            projetistas.DoQuery(QryStr);
            RecCount = projetistas.RecordCount;
        }
Beispiel #2
0
 public Ambiente(string idOOPR)
 {
     ambientes = LoadAmbientesCadastrados(idOOPR);
     RecCount = ambientes.RecordCount;
 }
Beispiel #3
0
        public string GetProxCodeItensComplementares()
        {
            SAPbobsCOM.Recordset RecSet = null;
            string QryStr = null;
            string proxCod = "";

            RecSet = ((SAPbobsCOM.Recordset)(conexao.getOCompany().GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            QryStr = "DECLARE @Numero AS INT SELECT @Numero = (select top 1 cast (Code as INT) + 1 from [SBO_SEA_Design_Prod].[dbo].[@FLX_FB_ITC] order by Code desc) if @Numero is null begin set @Numero = 1 end select @Numero";
            RecSet.DoQuery(QryStr);
            proxCod = Convert.ToString(RecSet.Fields.Item(0).Value);

            return proxCod;
        }
Beispiel #4
0
        public string GetIdPendenciasParaUpdate(string descricao, int idOOPR)
        {
            SAPbobsCOM.Recordset RecSet = null;
            string QryStr = null;
            string code = "";

            RecSet = ((SAPbobsCOM.Recordset)(conexao.getOCompany().GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            QryStr = "SELECT top 1 [Code] FROM [SBO_SEA_Design_Prod].[dbo].[@FLX_FB_PEN] where U_FLX_FB_PEN_DESC = '" + descricao + "' and U_FLX_FB_PEN_IDOOPR ='" + idOOPR + "'  order by CreateDate desc";
            RecSet.DoQuery(QryStr);
            code = Convert.ToString(RecSet.Fields.Item(0).Value);

            return code;
        }
Beispiel #5
0
        public string GetProxCodeConferenciaMedicao()
        {
            SAPbobsCOM.Recordset RecSet = null;
            string QryStr = null;
            string proxCod = "";

            RecSet = ((SAPbobsCOM.Recordset)(conexao.getOCompany().GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            QryStr = "DECLARE @Numero AS INT SELECT @Numero = (select top 1 cast (Code as INT) + 1 from [SBO_SEA_Design_Prod].[dbo].[@FLX_FB_CONFMED] order by Code desc) if @Numero is null begin set @Numero = 0000000 + 1 end SELECT case len(CAST(@Numero AS varchar(7))) WHEN 1 THEN '000000' + CAST(@Numero AS varchar(7)) WHEN 2 THEN '00000' + CAST(@Numero AS varchar(7)) WHEN 3 THEN '0000' + CAST(@Numero AS varchar(7)) WHEN 4 THEN '000' + CAST(@Numero AS varchar(7)) WHEN 5 THEN '00' + CAST(@Numero AS varchar(7)) WHEN 6 THEN '0' + CAST(@Numero AS varchar(7)) WHEN 7 THEN CAST(@Numero AS varchar(7)) END";
            RecSet.DoQuery(QryStr);
            proxCod = Convert.ToString(RecSet.Fields.Item(0).Value);

            return proxCod;
        }
Beispiel #6
0
        private void SBO_Application_DataEvent(ref SAPbouiCOM.BusinessObjectInfo pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;

            if ((pVal.FormTypeEx == "320" & pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD) & (pVal.BeforeAction == false))
            {
                string idOOPR = ((SAPbouiCOM.EditText)oForm.Items.Item("74").Specific).Value;
                ambiente = new Ambiente(idOOPR);
                projetista = new Projetista(idOOPR);
                projetistas = projetista.getProjetistas();

                if (ambiente.possuiAmbientesCadastrados())
                {
                    //Seta todas a Matrizes para carregar os ambientes cadastrados.
                    LoadAmbientesInMatrix();
                    oMatrix.LoadFromDataSource();
                }

                //Grids com Tabela de Usuário - Inclui o select em um datatable e seta este datatable para a matriz específica.
                idAmbiente = 1000;
                iRowAmbiente = 1000;
                iIdAmbienteMedicao = 1000;
                idAmbientePendencia = 1000;
                LoadGridConferenciaMedicao();
                LoadGridAvarias();
                LoadGridPendencias();
                LoadGridItensComplementares();

                //Limpa a variável que pega o id do ambiente selecionado e carrega a grid de analise critica com parâmetro idAmbiente = 0
                LoadGridAnaliseCritica();

                /**** INÍCIO - CARREGAMENTO DE COMBOS *******/

                loadCombo("Ent_Amb", ambiente.getAmbientes());

                oEditItem = ((SAPbouiCOM.EditText)oForm.Items.Item("Ent_Det").Specific);
                string selectedValue = ((SAPbouiCOM.ComboBox)oForm.Items.Item("Ent_Amb").Specific).Value;
                oEditItem.Value = ambiente.getDescricaoEntrevista(selectedValue);

                //Apresentação - Pega o valor cadastrado na drop de projetistas, lista o nome e todos os projetistas.
                loadCombo("Apr_Proj", projetistas);
                //Entrevista - Pega o valor cadastrado na drop de projetistas, lista o nome e todos os projetistas.
                loadCombo("Ent_Proj", projetistas);
                //Medição - Pega o valor cadastrado na drop de projetistas, lista o nome e todos os projetistas.
                loadCombo("Med_Proj", projetistas);

                if (ambiente.possuiAmbientesCadastrados())
                {
                    //Projetistas - Grid Elaboração
                    loadComboEmGrid("Ela_Amb", "Ela_Amb_C2", projetistas);
                    //Projetistas - Grid Detalhamento
                    loadComboEmGrid("Det_Amb", "Det_Amb_C2", projetistas);
                    //Projetistas - Grid Verificação
                    loadComboEmGrid("Ver_Amb", "Ver_Amb_C2", projetistas);
                    //Projetistas - Grid Aprovação
                    loadComboEmGrid("Apv_Amb", "Apv_Amb_C1", projetistas);
                    //Projetistas - Grid Pedido
                    loadComboEmGrid("Ped_Amb", "Ped_Amb_C5", projetistas);
                    //Projetistas - Grid Fabrica
                    loadComboEmGrid("Fab_Amb", "Fab_Amb_C3", projetistas);
                    //Projetistas - Grid Montagem
                    loadComboEmGrid("Mon_Amb", "Mon_Amb_C1", projetistas);
                    //Projetistas - Grid Entrega
                    loadComboEmGrid("Etg_Amb", "Etg_Amb_C2", projetistas);
                }
                /**** FIM - CARREGAMENTO DE COMBOS *******/

                oNewItem = oForm.Items.Item("Apr_Proj");
                oComboItenPrjApr = ((SAPbouiCOM.ComboBox)(oNewItem.Specific));

                //Entrevista - Pega o valor cadastrado na drop de projetistas, lista o nome e todos os projetistas.
                oNewItem = oForm.Items.Item("Ent_Proj");
                oComboItenPrjEntrevista = ((SAPbouiCOM.ComboBox)(oNewItem.Specific));

                //Medição - Pega o valor cadastrado na drop de projetistas, lista o nome e todos os projetistas.
                oNewItem = oForm.Items.Item("Med_Proj");
                oComboItenPrjMed = ((SAPbouiCOM.ComboBox)(oNewItem.Specific));

                //LoadComboProjetistaCadastradoElaboracao(idOOPR);
                LoadComboProjetistaCadastradoOOPR(oComboItenPrjEntrevista, oComboItenPrjMed, oComboItenPrjApr, idOOPR);

                ContarLinhasIniciaisMatrix();
                resumo.disableCampos();
                PreencherCamposResumo(idOOPR);
            }

            if (pVal.FormTypeEx == "651" & pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD & !pVal.BeforeAction)
            {
                if (oFormAtual.Items.Item("67").Specific.Value == "M")
                {
                    atividade.habilitaBotaoAta();
                }
                else
                {
                    atividade.desabilitaBotaoAta();
                }
            }
        }
Beispiel #7
0
        public string GetIdConferenciaMedicaoParaUpdate(string data, int idOOPR, string conferente, int idAmbiente)
        {
            SAPbobsCOM.Recordset RecSet = null;
            string QryStr = null;
            string code = "";

            RecSet = ((SAPbobsCOM.Recordset)(conexao.getOCompany().GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            QryStr = "SELECT top 1 [Code] FROM [SBO_SEA_Design_Prod].[dbo].[@FLX_FB_CONFMED] where U_FLX_FB_CONFMED_DAT = '" + data + "' and U_FLX_FB_CONFMED_PRJ = '" + conferente +
                "' and U_FLX_FB_CONFMED_ID ='" + idOOPR + "' and U_FLX_FB_CONFMED_IDA ='" + iIdAmbienteMedicao + "'  order by CreateDate desc";
            RecSet.DoQuery(QryStr);
            code = Convert.ToString(RecSet.Fields.Item(0).Value);

            return code;
        }
Beispiel #8
0
        private void LoadResumo(SAPbouiCOM.EditText etvResp, SAPbouiCOM.EditText medResp, SAPbouiCOM.EditText elbIni, SAPbouiCOM.EditText elbFim, SAPbouiCOM.EditText elbResp, SAPbouiCOM.EditText verificacao, SAPbouiCOM.EditText verResp, SAPbouiCOM.EditText apsResp, SAPbouiCOM.EditText aprovacao, SAPbouiCOM.EditText aprResp, SAPbouiCOM.EditText pedido, SAPbouiCOM.EditText pedResp, SAPbouiCOM.EditText detIni, SAPbouiCOM.EditText detFim, SAPbouiCOM.EditText detResp, SAPbouiCOM.EditText fabIni, SAPbouiCOM.EditText fabFim, SAPbouiCOM.EditText fabResp, SAPbouiCOM.EditText montagem, SAPbouiCOM.EditText montagemFim, SAPbouiCOM.EditText montResp, SAPbouiCOM.EditText entrega, SAPbouiCOM.EditText etgResp, string idOOPR)
        {
            SAPbobsCOM.Recordset RecSet = null;
            string QryStr = null;

            RecSet = ((SAPbobsCOM.Recordset)(conexao.getOCompany().GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            QryStr = "SELECT TOP 1 T2.Name as etvResp, T4.Name as medResp,CONVERT(char,T0.U_FLX_FB_ELB_INICIOR,103) as elaboracaoIni, CONVERT(char,T0.U_FLX_FB_ELB_TERMINR,103) as elaboracaoFim, T5.Name as elbResp, CONVERT(char,T0.U_FLX_FB_VRF_DATEVER,103) as verificacao, T0.U_FLX_FB_VRF_VERIFPO as verResp,T6.Name as apsResp,CONVERT(char,T0.U_FLX_FB_APR_DATAAPR,103)as aprovacao, T0.U_FLX_FB_APR_APROVAD as aprovPor,CONVERT(char,T0.U_FLX_FB_PED_DATE,103)as pedido, T0.U_FLX_FB_PED_SOLICIT as pedSolicitante,CONVERT(char,T0.U_FLX_FB_DET_INICIRE,103)as detIni,CONVERT(char,T0.U_FLX_FB_DET_TERMINO,103) as detFim, T7.Name as detResp,CONVERT(char,T0.U_FLX_FB_FAB_EXPEDIC,103)as fabIni,CONVERT(char,T0.U_FLX_FB_FAB_RECEBIM,103)as fabFim,T0.U_FLX_FB_FAB_CONFERE as fabConf,T0.U_FLX_FB_MTG_RESPONS as montResp,CONVERT(char,T0.U_FLX_FB_ENT_ENTREGA,103)as entrega, T0.U_FLX_FB_ENT_RESPONS as etgResp FROM OPR4 T0 left join OOPR T1 on T1.OpprId = T0.OprId left join [@FLX_FB_PRJ] T2 on T2.Code = T1.U_FLX_FB_ETV_RESP left join [@FLX_FB_MED] T3 on T3.U_FLX_FB_MED_IDOOPR = T0.OprId left join [@FLX_FB_PRJ] T4 on T4.Code = T3.U_FLX_FB_MED_PROJT left join [@FLX_FB_PRJ] T5 on T5.Code = T0.U_FLX_FB_ELB_PROJETI left join [@FLX_FB_PRJ] T6 on T6.Code = T1.U_FLX_FB_APS_PROJT left join [@FLX_FB_PRJ] T7 on T7.Code = T0.U_FLX_FB_DET_PROJETI WHERE OprId = " + idOOPR + "order by OprId asc";
            RecSet.DoQuery(QryStr);
            etvResp.Value = RecSet.Fields.Item(0).Value.ToString();
            medResp.Value = RecSet.Fields.Item(1).Value.ToString();
            elbIni.Value = RecSet.Fields.Item(2).Value.ToString();
            elbFim.Value = RecSet.Fields.Item(3).Value.ToString();
            elbResp.Value = RecSet.Fields.Item(4).Value.ToString();
            verificacao.Value = RecSet.Fields.Item(5).Value.ToString();
            verResp.Value = RecSet.Fields.Item(6).Value.ToString();
            apsResp.Value = RecSet.Fields.Item(7).Value.ToString();
            aprovacao.Value = RecSet.Fields.Item(8).Value.ToString();
            aprResp.Value = RecSet.Fields.Item(9).Value.ToString();
            pedido.Value = RecSet.Fields.Item(10).Value.ToString();
            pedResp.Value = RecSet.Fields.Item(11).Value.ToString();
            detIni.Value = RecSet.Fields.Item(12).Value.ToString();
            detFim.Value = RecSet.Fields.Item(13).Value.ToString();
            detResp.Value = RecSet.Fields.Item(14).Value.ToString();
            fabIni.Value = RecSet.Fields.Item(15).Value.ToString();
            fabFim.Value = RecSet.Fields.Item(16).Value.ToString();
            fabResp.Value = RecSet.Fields.Item(17).Value.ToString();
            //montagem.Value = RecSet.Fields.Item(18).Value.ToString();
            //montagemFim.Value = RecSet.Fields.Item(18).Value.ToString();
            montResp.Value = RecSet.Fields.Item(18).Value.ToString();
            entrega.Value = RecSet.Fields.Item(19).Value.ToString();
            etgResp.Value = RecSet.Fields.Item(20).Value.ToString();
        }
Beispiel #9
0
        private void LoadDataHoraMedicao(SAPbouiCOM.EditText data, SAPbouiCOM.EditText hora, SAPbouiCOM.EditText dataResumo, string idOOPR)
        {
            RecSet = null;
            string QryStr = null;

            RecSet = ((SAPbobsCOM.Recordset)(conexao.getOCompany().GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            QryStr = "Select CONVERT(char,U_FLX_FB_MED_DATAMED,103), Convert(varchar(05),U_FLX_FB_MED_HORAMED,108) from [SBO_SEA_Design_Prod].[dbo].[@FLX_FB_MED] where U_FLX_FB_MED_IDOOPR =" + idOOPR;
            RecSet.DoQuery(QryStr);
            data.Value = RecSet.Fields.Item(0).Value.ToString();
            dataResumo.Value = RecSet.Fields.Item(0).Value.ToString();
            hora.Value = RecSet.Fields.Item(1).Value.ToString();
        }
Beispiel #10
0
        private void LoadComboProjetistaCadastradoOOPR(SAPbouiCOM.ComboBox oComboEntrevista, SAPbouiCOM.ComboBox oComboMedicao, SAPbouiCOM.ComboBox oComboApresentacao, string idOOPR)
        {
            RecSet = projetista.trazerProjetistasOportunidade(idOOPR);
            RecSet.MoveFirst();
            int RecCount = RecSet.RecordCount;

            if (RecCount == 0)
            {
                oComboEntrevista.Select("", SAPbouiCOM.BoSearchKey.psk_ByValue);
                oComboApresentacao.Select("", SAPbouiCOM.BoSearchKey.psk_ByValue);
            }

            for (int RecIndex = 0; RecIndex <= RecCount - 1; RecIndex++)
            {
                string valorComboEntrevista = RecSet.Fields.Item(0).Value.ToString();
                string valorComboApresentacao = RecSet.Fields.Item(1).Value.ToString();
                string valorComboMedicao = RecSet.Fields.Item(2).Value.ToString();

                oComboEntrevista.Select(valorComboEntrevista, SAPbouiCOM.BoSearchKey.psk_ByValue);
                oComboApresentacao.Select(valorComboApresentacao, SAPbouiCOM.BoSearchKey.psk_ByValue);
                oComboMedicao.Select(valorComboMedicao, SAPbouiCOM.BoSearchKey.psk_ByValue);

                RecSet.MoveNext();
            }

            RecSet = null;
            System.GC.Collect();
        }
Beispiel #11
0
        public string[] VerificarSeExisteCadastroMedicao(int idOOPR)
        {
            SAPbobsCOM.Recordset RecSet = null;
            string QryStr = null;
            string retorno = "";
            string code = "";

            RecSet = ((SAPbobsCOM.Recordset)(conexao.getOCompany().GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            QryStr = " declare @retorno INT declare @code INT select @retorno = (select U_FLX_FB_MED_IDOOPR from [SBO_SEA_Design_Prod].[dbo].[@FLX_FB_MED] where U_FLX_FB_MED_IDOOPR =" + idOOPR + ") if @retorno is null begin set @retorno = 0 select @retorno, @code end else begin select @retorno, Code from [SBO_SEA_Design_Prod].[dbo].[@FLX_FB_MED] where U_FLX_FB_MED_IDOOPR =" + idOOPR + " end";
            RecSet.DoQuery(QryStr);
            retorno = Convert.ToString(RecSet.Fields.Item(0).Value);
            code = Convert.ToString(RecSet.Fields.Item(1).Value);

            string[] valores = { retorno, code };

            return valores;
        }
Beispiel #12
0
        public string GetQtdEmEstoque(string itemCode)
        {
            SAPbobsCOM.Recordset RecSet = null;
            string QryStr = null;
            string qtdEstoque = "";

            RecSet = ((SAPbobsCOM.Recordset)(conexao.getOCompany().GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            QryStr = "SELECT T0.[OnHand] FROM OITM T0 WHERE T0.ItemCode = '" + itemCode + "'";
            RecSet.DoQuery(QryStr);
            qtdEstoque = Convert.ToString(RecSet.Fields.Item(0).Value);

            return qtdEstoque;
        }