コード例 #1
0
        public OrcamentoIntumescenteModel GetValoresCalculados(OrcamentoIntumescenteModel orcamentoIntumescente)
        {
            try
            {
                ItensOrcamentoIntumescenteService.GetValoresCalculados(orcamentoIntumescente.LIST_ITENS_ORCAMENTO_INTUMESCENTE, orcamentoIntumescente.PRODUTO.MATERIAL_ID, orcamentoIntumescente.TEMPO_RESISTENCIA_FOGO);

                return(orcamentoIntumescente);
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #2
0
        public OrcamentoIntumescenteModel Post(OrcamentoIntumescenteModel orcamentoIntumescente)
        {
            try
            {
                orcamentoIntumescente.PRODUTO = MaterialService.GetComParametro(new MaterialQO(orcamentoIntumescente.PRODUTO.MATERIAL_ID, "", "")).FirstOrDefault();

                OrcamentoIntumescenteRepository.Create(orcamentoIntumescente);

                return(orcamentoIntumescente);
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #3
0
        public void Put(int orcamentoId, OrcamentoIntumescenteModel orcamentoIntumescente)
        {
            try
            {
                var where = $"ORCAMENTO_ID = {orcamentoId}";
                if (string.IsNullOrEmpty(MetodosGenericosService.DlookupOrcamentaria("ORCAMENTO_ID", "T_ORCA_ORCAMENTO", where)))
                {
                    throw new Exception();
                }

                if (string.IsNullOrEmpty(MetodosGenericosService.DlookupOrcamentaria("ORCAMENTO_ID", "T_ORCA_ORCAMENTO_INTUMESCENTE", where)))
                {
                    orcamentoIntumescente.ORCAMENTO_ID = orcamentoId;
                    Post(orcamentoIntumescente);
                }
                else
                {
                    var orcamentoIntumescenteDB = Get(orcamentoId).FirstOrDefault();

                    if (orcamentoIntumescente.CLIENTE_ORCAMENTO.PESSOA_ID != orcamentoIntumescenteDB.CLIENTE_ORCAMENTO.PESSOA_ID)
                    {
                        orcamentoIntumescente.CLIENTE_ORCAMENTO = PessoaService.GetComParametro(new PessoaQO(orcamentoIntumescente.CLIENTE_ORCAMENTO.PESSOA_ID, "")).ToArray()[0];
                    }

                    if (orcamentoIntumescente.PRODUTO.MATERIAL_ID != orcamentoIntumescenteDB.PRODUTO.MATERIAL_ID)
                    {
                        orcamentoIntumescente.PRODUTO = MaterialService.GetComParametro(new MaterialQO(orcamentoIntumescente.PRODUTO.MATERIAL_ID, "", "")).FirstOrDefault();
                    }

                    OrcamentoIntumescenteRepository.Update(orcamentoId, orcamentoIntumescente);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }