示例#1
0
        public void Put(int itensCartaCoberturaId, ItensCartaCoberturaModel itensCartaCobertura)
        {
            try
            {
                var where = $"ITENS_CARTA_COBERTURA_ID = {itensCartaCobertura.ITENS_CARTA_COBERTURA_ID}";
                if (string.IsNullOrEmpty(MetodosGenericosService.DlookupOrcamentaria("ITENS_CARTA_COBERTURA_ID", "T_ORCA_ITENS_CARTA_COBERTURA", where)))
                {
                    throw new Exception();
                }

                ItensCartaCoberturaRepository.Update(itensCartaCoberturaId, itensCartaCobertura);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        public ItensCartaCoberturaModel Post(ItensCartaCoberturaModel itensCartaCobertura)
        {
            try
            {
                var where = $"CARTA_COBERTURA_ID = {itensCartaCobertura.CARTA_COBERTURA_ID}";
                if (string.IsNullOrEmpty(MetodosGenericosService.DlookupOrcamentaria("CARTA_COBERTURA_ID", "T_ORCA_CARTA_COBERTURA", where)))
                {
                    throw new Exception();
                }

                return(ItensCartaCoberturaRepository.Create(itensCartaCobertura));
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#3
0
 public void Update(int itensCartaCoberturaId, ItensCartaCoberturaModel itensCartaCobertura)
 {
     try
     {
         using (var cn = Conexao.AbrirConexao())
         {
             cn.Execute(@"UPDATE T_ORCA_ITENS_CARTA_COBERTURA SET VALOR_HP_A = @VALOR_HP_A, TEMPO_RESISTENCIA_FOGO = @TEMPO_RESISTENCIA_FOGO,
                         VALOR_ESPESSURA = @VALOR_ESPESSURA WHERE ITENS_CARTA_COBERTURA_ID = @itensCartaCoberturaId", new
             {
                 itensCartaCobertura.VALOR_HP_A,
                 itensCartaCobertura.TEMPO_RESISTENCIA_FOGO,
                 itensCartaCobertura.VALOR_ESPESSURA,
                 itensCartaCoberturaId
             });
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#4
0
        public ItensCartaCoberturaModel Create(ItensCartaCoberturaModel itensCartaCobertura)
        {
            try
            {
                using (var cn = Conexao.AbrirConexao())
                {
                    cn.Execute(@"INSERT INTO T_ORCA_ITENS_CARTA_COBERTURA (CARTA_COBERTURA_ID, VALOR_HP_A, 
                                TEMPO_RESISTENCIA_FOGO, VALOR_ESPESSURA) VALUES(@CARTA_COBERTURA_ID, 
                                @VALOR_HP_A, @TEMPO_RESISTENCIA_FOGO, @VALOR_ESPESSURA)", new
                    {
                        itensCartaCobertura.CARTA_COBERTURA_ID,
                        itensCartaCobertura.VALOR_HP_A,
                        itensCartaCobertura.TEMPO_RESISTENCIA_FOGO,
                        itensCartaCobertura.VALOR_ESPESSURA
                    });

                    return(Find(cn.Query <int>("SELECT LAST_INSERT_ID()").ToArray()[0]));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }