コード例 #1
0
        public ActionResult Create([Bind(Include = "UsuarioID,UsuarioLogin,UsuarioSenha,UsuarioAtivo")] Usuario usuario)
        {
            if (ModelState.IsValid)
            {
                db.Usuarios.Add(usuario);
                db.SaveChanges();

                if (Session["UsuarioLogin"] != null)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    return(RedirectToAction("Login", ""));
                }
                //return Redirect("Home/MyIndex");
            }
            else
            {
                if (Session["UsuarioLogin"] != null)
                {
                    return(RedirectToAction("Login"));
                }
            }

            return(View(usuario));
        }
コード例 #2
0
        public ActionResult Create([Bind(Include = "Id,Nome,Tipo,Endereco")] cliente cliente)
        {
            if (ModelState.IsValid)
            {
                db.Cliente.Add(cliente);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cliente));
        }
コード例 #3
0
        public JsonResult Create(Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                db.Clientes.Add(cliente);
                db.SaveChanges();
                return(Json(cliente));
            }

            return(Json(cliente));
        }
コード例 #4
0
        public ActionResult Create([Bind(Include = "id,especie,raca,descricao")] AnimalModel animalModel)
        {
            if (ModelState.IsValid)
            {
                db.AnimalModels.Add(animalModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(animalModel));
        }
コード例 #5
0
        public ActionResult Create([Bind(Include = "Titulo,Temporada,Episodio,Sinopse")] Filme filme)
        {
            if (ModelState.IsValid)
            {
                db.Filmes.Add(filme);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(filme));
        }
コード例 #6
0
        public ActionResult Create([Bind(Include = "Id,Nome,Tipo,Numero")] telefone telefone)
        {
            if (ModelState.IsValid)
            {
                db.Telefone.Add(telefone);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(telefone));
        }
コード例 #7
0
        public ActionResult Create([Bind(Include = "VeiculoID,Marca,Modelo,ItensAdd")] motorista motorista)
        {
            if (ModelState.IsValid)
            {
                db.Motoristas.Add(motorista);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(motorista));
        }
コード例 #8
0
        public ActionResult Create([Bind(Include = "codigo,nome,telefone,endereco,cnpj")] padaria padaria)
        {
            if (ModelState.IsValid)
            {
                db.Padarias.Add(padaria);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(padaria));
        }
コード例 #9
0
        public ActionResult Create([Bind(Include = "ID_cao,Nome,ID_raca")] cao cao)
        {
            if (ModelState.IsValid)
            {
                db.Caes.Add(cao);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cao));
        }
コード例 #10
0
ファイル: locacaosController.cs プロジェクト: SamukaSRB/NS
        public ActionResult Create([Bind(Include = "Codigo,Nome,Categoria,Valor,Desconto,Status")] locacao locacao)
        {
            if (ModelState.IsValid)
            {
                db.Locacaos.Add(locacao);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(locacao));
        }
コード例 #11
0
        public ActionResult Create([Bind(Include = "idAnimal,Nome,Descricao,Peso,Idade")] animal animal)
        {
            if (ModelState.IsValid)
            {
                db.animals.Add(animal);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(animal));
        }
コード例 #12
0
        public ActionResult Create([Bind(Include = "ID_raca,Nome")] raca raca)
        {
            if (ModelState.IsValid)
            {
                db.Racas.Add(raca);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(raca));
        }
コード例 #13
0
        public ActionResult Create([Bind(Include = "Código,Nome")] usuario usuario)
        {
            if (ModelState.IsValid)
            {
                db.Usuários.Add(usuario);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(usuario));
        }
コード例 #14
0
        public ActionResult Create([Bind(Include = "ID_cao_dono,ID_dono,ID_cao")] cao_dono cao_dono)
        {
            if (ModelState.IsValid)
            {
                db.Relacionamento.Add(cao_dono);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cao_dono));
        }
コード例 #15
0
        public ActionResult Create([Bind(Include = "codigo,filme,sessoes,salas,cinemas,cidade")] ing ing)
        {
            if (ModelState.IsValid)
            {
                db.ings.Add(ing);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ing));
        }
コード例 #16
0
        public ActionResult Create([Bind(Include = "codigo,nome,email")] PessoaViewModels pessoaViewModels)
        {
            if (ModelState.IsValid)
            {
                db.PessoaViewModels.Add(pessoaViewModels);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pessoaViewModels));
        }
コード例 #17
0
        public ActionResult Create([Bind(Include = "ID,Nome")] SubCategoria subCategoria)
        {
            if (ModelState.IsValid)
            {
                db.SubCategorias.Add(subCategoria);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(subCategoria));
        }
コード例 #18
0
        public ActionResult Create([Bind(Include = "TrabalhadorId,Nome")] trabalhador trabalhador)
        {
            if (ModelState.IsValid)
            {
                db.trabalhadors.Add(trabalhador);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(trabalhador));
        }
コード例 #19
0
        public ActionResult Create([Bind(Include = "CPF,Nome,Logadouro,Telefone,Animal,Cartao")] cliente cliente)
        {
            if (ModelState.IsValid)
            {
                db.clientes.Add(cliente);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cliente));
        }
コード例 #20
0
        public ActionResult Create([Bind(Include = "Codigo,Nome,Sobrenome,Cidade,Email,Telefone,Data_Nascimento")] pessoa pessoa)
        {
            if (ModelState.IsValid)
            {
                db.Pessoas.Add(pessoa);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pessoa));
        }
コード例 #21
0
        public ActionResult Create([Bind(Include = "ClienteID,ClienteCPF,ClienteNome")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                db.Clientes.Add(cliente);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cliente));
        }
コード例 #22
0
        public ActionResult Create([Bind(Include = "cpf,nome,sobrenome,sexo,idade,cep,estado,codade,bairro,rua,numero,email,senha,nascimento")] UsuarioModel usuarioModel)
        {
            if (ModelState.IsValid)
            {
                db.UsuarioModels.Add(usuarioModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(usuarioModel));
        }
コード例 #23
0
        public ActionResult Create([Bind(Include = "idProduto,Nome,Preco,Quantidade")] produto produto)
        {
            if (ModelState.IsValid)
            {
                db.produtos.Add(produto);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(produto));
        }
コード例 #24
0
        public ActionResult Create([Bind(Include = "Codigo,Identificador,Volume,Frete,Placa,Capacidade")] Registro registro)
        {
            if (ModelState.IsValid)
            {
                db.Registros.Add(registro);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(registro));
        }
コード例 #25
0
        public ActionResult Create([Bind(Include = "ID_Dono,Nome")] dono dono)
        {
            if (ModelState.IsValid)
            {
                db.Donos.Add(dono);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(dono));
        }
コード例 #26
0
        public ActionResult Create([Bind(Include = "ClinicaID,NomeClinica,IDMedico")] Clinicas clinicas)
        {
            if (ModelState.IsValid)
            {
                db.Clinica.Add(clinicas);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(clinicas));
        }
コード例 #27
0
        public ActionResult Create([Bind(Include = "codigo,aparelho,descricao")] eletronico eletronico)
        {
            if (ModelState.IsValid)
            {
                db.Eletronico.Add(eletronico);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(eletronico));
        }
コード例 #28
0
        public ActionResult Create([Bind(Include = "ID,nome,descricao,date")] tarefa tarefa)
        {
            if (ModelState.IsValid)
            {
                db.Tarefas.Add(tarefa);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tarefa));
        }
コード例 #29
0
        public ActionResult Create([Bind(Include = "Codigo,Nome,Email")] Pessoa pessoa)
        {
            if (ModelState.IsValid)
            {
                db.Pessoa.Add(pessoa);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pessoa));
        }
コード例 #30
0
        public ActionResult Create([Bind(Include = "Codigo,Cpf,Nome,Endereco,Numero,Bairro,Cep,Cidade,Estado,Contato,Email")] cliente cliente)
        {
            if (ModelState.IsValid)
            {
                db.Clientes.Add(cliente);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cliente));
        }