Example #1
0
        public void InserirVinculo(VinculoClienteProduto vinculo)
        {
            try
            {
                using (var context = new TesteStefaniniEntities1())
                {
                    context.Entry(vinculo).State = EntityState.Added;
                    context.VinculoClienteProduto.Add(vinculo);

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public void Inserir(Cliente cliente)
        {
            try
            {
                using (var context = new TesteStefaniniEntities1())
                {
                    context.Entry(cliente).State = EntityState.Added;
                    context.Cliente.Add(cliente);

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        public void Inserir(Produto produto)
        {
            try
            {
                using (var context = new TesteStefaniniEntities1())
                {
                    context.Entry(produto).State = EntityState.Added;
                    context.Produto.Add(produto);

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }