// GET: RealBooks
        public ActionResult Index()
        {
            EditoraBusiness editora = new EditoraBusiness();
            var             lista   = editora.listarEditoras();

            return(View(lista));
        }
Beispiel #2
0
        public IEnumerable <Editora> Get()
        {
            editora = new EditoraBusiness();
            var result = editora.listarEditoras();

            return(result);
        }
Beispiel #3
0
        public Editora Get(int id)
        {
            editora = new EditoraBusiness();
            var result = editora.listarEditorasPorId(id);

            return(result.FirstOrDefault());
        }
Beispiel #4
0
        //public JsonResult<List<Editora>> Get()
        //{
        //	editora = new EditoraBusiness();

        //	var lista = editora.ListarEditoras();

        //	return Json(lista, JsonRequestBehavior.AllowGet);
        //}


        // GET: api/WebApiEditora/5
        public Editora Get(int id)
        {
            editora = new EditoraBusiness();
            var result = editora.ObterEditora(id);

            return(result);
        }
        public ActionResult Edit(int id)
        {
            EditoraBusiness editoraEF = new EditoraBusiness();
            var             editora   = editoraEF.listarEditorasPorId(id).FirstOrDefault();

            return(View(editora));
        }
Beispiel #6
0
        //GET: api/WebApiEditora
        public IEnumerable <Editora> Get()
        {
            editora = new EditoraBusiness();

            var lista = editora.ListarEditoras();

            return(lista);
        }
Beispiel #7
0
        // GET: RealBooks/Delete/5
        public ActionResult Delete(int id)
        {
            EditoraBusiness editoraBusiness = new EditoraBusiness();

            var editora = editoraBusiness.ObterEditora(id);

            return(View(editora));
        }
Beispiel #8
0
        public ActionResult ListarNovasEditoras()
        {
            EditoraBusiness editoraBusiness = new EditoraBusiness();

            var listaEditora = editoraBusiness.ListarEditoras();

            return(View(listaEditora));
        }
        public ActionResult Delete(int id)
        {
            EditoraBusiness editoraEF = new EditoraBusiness();

            if (editoraEF.RemoverEditora(id))
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
        public ActionResult Edit(int id, Editora editora)
        {
            EditoraBusiness editoraEF = new EditoraBusiness();

            if (editoraEF.AlterarEditora(id, editora))
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
        public ActionResult RegistraEditora(Editora editora)
        {
            EditoraBusiness editoraEF = new EditoraBusiness();

            if (editoraEF.RegistraEditora(editora))
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
Beispiel #12
0
        public ActionResult Edit(int id, Editora editora)
        {
            try
            {
                EditoraBusiness editoraBusiness = new EditoraBusiness();

                editoraBusiness.AlterarEditora(editora);

                return(RedirectToAction("ListarNovasEditoras"));
            }
            catch
            {
                return(View());
            }
        }
Beispiel #13
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                EditoraBusiness editoraBusiness = new EditoraBusiness();

                editoraBusiness.ExcluirEditora(id);

                return(RedirectToAction("ListarNovasEditoras"));
            }
            catch
            {
                return(View());
            }
        }
Beispiel #14
0
        public ActionResult Create(Editora editora)
        {
            try
            {
                EditoraBusiness editoraBusiness = new EditoraBusiness();

                editoraBusiness.CriarEditora(editora);


                return(RedirectToAction("ListarNovasEditoras"));
            }
            catch
            {
                return(View());
            }
        }
Beispiel #15
0
 // POST: api/WebApiEditora
 public void Post(Editora objEditora)
 {
     editora = new EditoraBusiness();
     editora.CriarEditora(objEditora);
 }
Beispiel #16
0
 public void Delete(int id)
 {
     editora = new EditoraBusiness();
     editora.RemoverEditora(id);
 }
Beispiel #17
0
        // GET: RealBooks/Create
        public ActionResult Create()
        {
            EditoraBusiness editoraBusiness = new EditoraBusiness();

            return(View());
        }
Beispiel #18
0
        // PUT: api/WebApiEditora/5
        public void Put(int id, Editora objEditora)
        {
            editora = new EditoraBusiness();

            editora.AlterarEditora(objEditora);
        }
Beispiel #19
0
        // DELETE: api/WebApiEditora/5
        public void Delete(int id)
        {
            editora = new EditoraBusiness();

            editora.ExcluirEditora(id);
        }
Beispiel #20
0
 public void Post(Editora objEditora)
 {
     editora = new EditoraBusiness();
     editora.RegistraEditora(objEditora);
 }