public void Excluir(int id)
        {
            Igrejas dExcluir = BuscarID(id);

            if (dExcluir != null)
            {
                contexto.IgrejasSet.Remove(dExcluir);
                contexto.SaveChanges();
            }
        }
        public void Editar(int id, Igrejas NovosDadosIgrejas)
        {
            Igrejas IgrejasAntigo = BuscarID(id);

            if (IgrejasAntigo != null)
            {
                IgrejasAntigo.NomeIgreja     = NovosDadosIgrejas.NomeIgreja;
                IgrejasAntigo.EnderecoIgreja = NovosDadosIgrejas.EnderecoIgreja;
                IgrejasAntigo.NumeroIgreja   = NovosDadosIgrejas.NumeroIgreja;
                IgrejasAntigo.BairroIgreja   = NovosDadosIgrejas.BairroIgreja;
                IgrejasAntigo.UFIgreja       = NovosDadosIgrejas.UFIgreja;
                IgrejasAntigo.CNPJIgreja     = NovosDadosIgrejas.CNPJIgreja;
                IgrejasAntigo.SiteIgreja     = NovosDadosIgrejas.SiteIgreja;


                contexto.Entry(IgrejasAntigo).State = System.Data.Entity.EntityState.Modified;
                contexto.SaveChanges();
            }
        }
 public void inserirIgreja(Igrejas f)
 {
     contexto.IgrejasSet.Add(f);
     contexto.SaveChanges();
 }
Ejemplo n.º 4
0
 public ActionResult Create(Igrejas igrejas)
 {
     _interfaceIgrejas.Add(igrejas);
     return(RedirectToAction(nameof(Index)));
 }
Ejemplo n.º 5
0
 public void Update(Igrejas Objeto)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
 public void Add(Igrejas Objeto)
 {
     _interfaceIgrejas.Add(Objeto);
 }