Beispiel #1
0
 public void Put(int perfilId, [FromBody] PerfilModel perfil)
 {
     try
     {
         PerfilService.Put(perfilId, perfil);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
 public PerfilModel Post([FromBody] PerfilModel perfil)
 {
     try
     {
         return(PerfilService.Post(perfil));
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #3
0
 public PerfilModel Post(PerfilModel perfil)
 {
     try
     {
         return(PerfilRepository.Create(perfil));
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #4
0
        public void Put(int perfilId, PerfilModel perfil)
        {
            try
            {
                var where = $"PERFIL_ID = {perfilId}";
                if (string.IsNullOrEmpty(MetodosGenericosService.DlookupOrcamentaria("PERFIL_ID", "T_ORCA_PERFIL", where)))
                {
                    throw new Exception();
                }

                PerfilRepository.Update(perfilId, perfil);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #5
0
        public PerfilModel Create(PerfilModel perfil)
        {
            try
            {
                using (var cn = Conexao.AbrirConexao())
                {
                    cn.Execute(@"INSERT INTO T_ORCA_PERFIL (NOME_PERFIL, VALOR_D, VALOR_BF, 
                                VALOR_TW, VALOR_TF, VALOR_KG_M, TIPO_PERFIL) VALUES(@NOME_PERFIL, @VALOR_D, @VALOR_BF, 
                                @VALOR_TW, @VALOR_TF, @VALOR_KG_M, @TIPO_PERFIL)", perfil);

                    return(Find(cn.Query <int>("SELECT LAST_INSERT_ID()").ToArray()[0]));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #6
0
 public ItensOrcamentoIntumescenteModel(string referencia, int numeroFaces, double valorHp, double valorHpA, double valorWD,
                                        int qtde, double valorEspessura, double qtdeLitros, PerfilModel perfilModel, CartaCoberturaModel cartaCoberturaModel,
                                        int itensOrcamentoId, int orcamentoId, int numeroLinha, double valorComprimento, double area)
     : base(itensOrcamentoId, orcamentoId, numeroLinha, valorComprimento, area)
 {
     REFERENCIA         = referencia;
     NUMERO_FACES       = numeroFaces;
     VALOR_HP           = valorHp;
     VALOR_HP_A         = valorHpA;
     VALOR_WD           = valorWD;
     QTDE               = qtde;
     VALOR_ESPESSURA    = valorEspessura;
     QTDE_LITROS        = qtdeLitros;
     PERFIL             = perfilModel;
     ITENS_ORCAMENTO_ID = itensOrcamentoId;
     ORCAMENTO_ID       = orcamentoId;
     NUMERO_LINHA       = numeroLinha;
     VALOR_COMPRIMENTO  = valorComprimento;
     AREA               = area;
 }
Beispiel #7
0
        public dynamic CalcularValoresIntumescente(ItensOrcamentoIntumescenteModel itemItumescente, PerfilModel perfil, double valorEspessura)
        {
            try
            {
                double HpAux   = ((2 * perfil.VALOR_D) + (itemItumescente.NUMERO_FACES * perfil.VALOR_BF)) / 1000;
                double WDAux   = 39.70008 / (perfil.VALOR_KG_M * 2.2);
                double HpAAux  = HpAux / (perfil.VALOR_KG_M / 7850);
                double AreaAux = itemItumescente.VALOR_COMPRIMENTO * itemItumescente.QTDE * HpAux;

                double TotalLitrosAux = 0;
                if (valorEspessura > 0)
                {
                    TotalLitrosAux = 1.4 * valorEspessura * AreaAux;
                }

                return(new
                {
                    Hp = float.Parse(HpAux.ToString("N2")),
                    WD = float.Parse(WDAux.ToString("N2")),
                    HpA = float.Parse(HpAAux.ToString("N2")),
                    Area = float.Parse(AreaAux.ToString("N2")),
                    TotalLitros = float.Parse(TotalLitrosAux.ToString("N2"))
                });
            }
            catch (Exception)
            {
                throw;
            }
        }