Example #1
0
        public async Task <IActionResult> PutCategorias_Produtos(int id, Categorias_Produtos categorias_Produtos)
        {
            if (id != categorias_Produtos.Id)
            {
                return(BadRequest());
            }

            _context.Entry(categorias_Produtos).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Categorias_ProdutosExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutEnderecos(int id, Enderecos enderecos)
        {
            if (enderecos.Pais != "" && enderecos.Bairro != "" && enderecos.Estado != "" && enderecos.Cidade != "" && enderecos.Cep != "" && enderecos.Numero != 0)
            {
                if (id != enderecos.Id)
                {
                    return(BadRequest());
                }

                _context.Entry(enderecos).State = EntityState.Modified;

                try
                {
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EnderecosExists(id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }

                return(NoContent());
            }
            else
            {
                return(Content("Devem ser preenchidos todos os campo obrigatórios"));
            }
        }
Example #3
0
        public async Task <IActionResult> PutUsuario(int id, Usuario usuario)
        {
            if (id != usuario.id)
            {
                return(BadRequest());
            }

            _context.Entry(usuario).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UsuarioExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
 public ActionResult Edit([Bind(Include = "Id,Nome,Tipo,Numero")] telefone telefone)
 {
     if (ModelState.IsValid)
     {
         db.Entry(telefone).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(telefone));
 }
 public ActionResult Edit([Bind(Include = "ID,Nome")] SubCategoria subCategoria)
 {
     if (ModelState.IsValid)
     {
         db.Entry(subCategoria).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(subCategoria));
 }
Example #6
0
 public ActionResult Edit([Bind(Include = "Codigo,Nome,Categoria,Valor,Desconto,Status")] locacao locacao)
 {
     if (ModelState.IsValid)
     {
         db.Entry(locacao).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(locacao));
 }
Example #7
0
 public JsonResult Edit(Cliente cliente)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cliente).State = EntityState.Modified;
         db.SaveChanges();
         return(Json(cliente, JsonRequestBehavior.AllowGet));
     }
     return(Json(cliente, JsonRequestBehavior.AllowGet));
 }
Example #8
0
 public ActionResult Edit([Bind(Include = "FilmeID,FilmeNome,FilmeCriacao,FilmeAtivo")] Filme filme) // atualizando após edição
 {
     if (ModelState.IsValid)
     {
         db.Entry(filme).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(filme));
 }
 public ActionResult Edit([Bind(Include = "idProduto,Nome,Preco,Quantidade")] produto produto)
 {
     if (ModelState.IsValid)
     {
         db.Entry(produto).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(produto));
 }
Example #10
0
 public ActionResult Edit([Bind(Include = "ClienteID,ClienteCPF,ClienteNome")] Cliente cliente)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cliente).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cliente));
 }
 public ActionResult Edit([Bind(Include = "id,dataEntrega,usuarioEntrega,enderecoEntrega,animal")] AgendamentoModel agendamentoModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(agendamentoModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(agendamentoModel));
 }
 public ActionResult Edit([Bind(Include = "Codigo,Identificador,Volume,Frete,Placa,Capacidade")] Registro registro)
 {
     if (ModelState.IsValid)
     {
         db.Entry(registro).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(registro));
 }
 public ActionResult Edit([Bind(Include = "cpf,nome,sobrenome,sexo,idade,cep,estado,codade,bairro,rua,numero,email,senha,nascimento")] UsuarioModel usuarioModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(usuarioModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(usuarioModel));
 }
Example #14
0
 public ActionResult Edit([Bind(Include = "Codigo,Nome,Sobrenome,Cidade,Email,Telefone,Data_Nascimento")] pessoa pessoa)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pessoa).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pessoa));
 }
 public ActionResult Edit([Bind(Include = "TrabalhadorId,Nome")] trabalhador trabalhador)
 {
     if (ModelState.IsValid)
     {
         db.Entry(trabalhador).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(trabalhador));
 }
Example #16
0
 public ActionResult Edit([Bind(Include = "codigo,nome,telefone,endereco,cnpj")] padaria padaria)
 {
     if (ModelState.IsValid)
     {
         db.Entry(padaria).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(padaria));
 }
 public ActionResult Edit([Bind(Include = "CPF,Nome,Logadouro,Telefone,Animal,Cartao")] cliente cliente)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cliente).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cliente));
 }
Example #18
0
 public ActionResult Edit([Bind(Include = "ClinicaID,NomeClinica,IDMedico")] Clinicas clinicas)
 {
     if (ModelState.IsValid)
     {
         db.Entry(clinicas).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(clinicas));
 }
Example #19
0
 public ActionResult Edit([Bind(Include = "VeiculoID,Marca,Modelo,ItensAdd")] motorista motorista)
 {
     if (ModelState.IsValid)
     {
         db.Entry(motorista).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(motorista));
 }
Example #20
0
 public ActionResult Edit([Bind(Include = "Titulo,Temporada,Episodio,Sinopse")] Filme filme)
 {
     if (ModelState.IsValid)
     {
         db.Entry(filme).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(filme));
 }
Example #21
0
 public ActionResult Edit([Bind(Include = "id,especie,raca,descricao")] AnimalModel animalModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(animalModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(animalModel));
 }
Example #22
0
 public ActionResult Edit([Bind(Include = "UsuarioID,UsuarioLogin,UsuarioSenha,UsuarioAtivo")] Usuario usuario)
 {
     if (ModelState.IsValid)
     {
         db.Entry(usuario).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(usuario));
 }
Example #23
0
 public ActionResult Edit([Bind(Include = "LocacaoID,LocacaoData")] Locacao locacao)
 {
     if (ModelState.IsValid)
     {
         db.Entry(locacao).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(locacao));
 }
Example #24
0
 public ActionResult Edit([Bind(Include = "idAnimal,Nome,Descricao,Peso,Idade")] animal animal)
 {
     if (ModelState.IsValid)
     {
         db.Entry(animal).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(animal));
 }
Example #25
0
 public ActionResult Edit([Bind(Include = "ID_Dono,Nome")] dono dono)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dono).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dono));
 }
Example #26
0
 public ActionResult Edit([Bind(Include = "ID,nome,descricao,date")] tarefa tarefa)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tarefa).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tarefa));
 }
Example #27
0
 public ActionResult Edit([Bind(Include = "codigo,aparelho,descricao")] eletronico eletronico)
 {
     if (ModelState.IsValid)
     {
         db.Entry(eletronico).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(eletronico));
 }
Example #28
0
 public ActionResult Edit([Bind(Include = "GeneroID,GeneroNome,GeneroCriacao,GeneroAtivo")] Genero genero)
 {
     if (ModelState.IsValid)
     {
         db.Entry(genero).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(genero));
 }
Example #29
0
 public ActionResult Edit([Bind(Include = "Codigo,Nome,Email")] Pessoa pessoa)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pessoa).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pessoa));
 }
 public ActionResult Edit([Bind(Include = "codigo,filme,sessoes,salas,cinemas,cidade")] ing ing)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ing).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(ing));
 }