Exemplo n.º 1
0
        public ActionResult Cadastrar(PessoaViewModel pessoa)
        {
            Pessoa p = new Pessoa();

            p.Nome         = pessoa.Nome;
            p.DtNascimento = pessoa.DtNascimento;
            p.Telefone     = pessoa.Telefone;
            _pessoaService.Inserir(p);
            return(RedirectToAction("Cadastrar"));
        }
Exemplo n.º 2
0
        public ActionResult Cadastrar(EmprestimoViewModel emprestimo)
        {
            Emprestimo e = new Emprestimo();

            e.DtDevolucao  = emprestimo.DtDevolucao;
            e.DtEmprestimo = emprestimo.DtEmprestimo;
            e.LivroId      = emprestimo.LivroId;
            e.PessoaId     = emprestimo.PessoaId;
            _emprestimoService.Inserir(e);
            return(RedirectToAction("Cadastrar"));
        }
Exemplo n.º 3
0
        public ActionResult Create(LivroViewModel livro)
        {
            Livro l = new Livro();

            l.Id    = livro.Id;
            l.Nome  = livro.Nome;
            l.Ano   = livro.Ano;
            l.Autor = livro.Autor;
            _livroService.Inserir(l);
            return(RedirectToAction("Create"));
        }