public ActionResult Lista()
 {
     try {
         return(PartialView(EditorialBLL.List2()));
     } catch {
         return(View("~/Views/Shared/Error.cshtml"));
     }
 }
 public ActionResult Create(Editorial editorial)
 {
     try {
         EditorialBLL.Create(editorial);
         return(RedirectToAction("Index"));
     } catch (Exception ex) {
         return(View("~/Views/Shared/Error.cshtml", new Models.ManejadorError(ex)));
     }
 }
Exemplo n.º 3
0
        //
        // GET: /Libro/Create

        public ActionResult Create()
        {
            ViewBag.ffFecha         = DateTime.Now.ToString("dd/MM/yyyy");
            ListaLibEjem            = null;
            ListaLibEjemDel         = null;
            ViewBag.Autores         = AutorBLL.ListActivos();
            ViewBag.Editoriales     = EditorialBLL.ListActivos();
            ViewBag.Clasificaciones = ClasificacionBLL.ListActivos();
            return(View());
        }
 public ActionResult Edit(int id, Editorial editorial)
 {
     try {
         editorial.Id = id;
         EditorialBLL.Update(editorial);
         return(RedirectToAction("Index"));
     } catch (Exception ex) {
         return(View("~/Views/Shared/Error.cshtml", new Models.ManejadorError(ex)));
     }
 }
Exemplo n.º 5
0
        public void registrarEditorial()
        {
            Editorial e = new Editorial();

            e.Estado = 1;
            e.Nombre = "Editorial1";
            e.Pais   = PaisBLL.Get(1);
            EditorialBLL.Create(e);
            Assert.AreNotEqual(0, e.Id);
        }
Exemplo n.º 6
0
 public ActionResult Create(Libro libro)
 {
     try {
         libro.Ejemplares = ListaLibEjem;
         LibroBLL.Create(libro);
         return(RedirectToAction("Index"));
     } catch (Excepcion ec) {
         ViewBag.mensaje         = new Models.Mensaje(ec.CreateMensaje(), Models.Mensaje.TipoMsg.error);
         ViewBag.Autores         = AutorBLL.ListActivos();
         ViewBag.Editoriales     = EditorialBLL.ListActivos();
         ViewBag.Clasificaciones = ClasificacionBLL.ListActivos();
         return(View("Create", libro));
     } catch (Exception ex) {
         return(View("~/Views/Shared/Error.cshtml", new Models.ManejadorError(ex)));
     }
 }
        //
        // GET: /Editorial/Details/5

        public ActionResult Details(int id)
        {
            try {
                Editorial e = EditorialBLL.Get(id);
                if (e != null)
                {
                    return(View(EditorialBLL.Get(id)));
                }
                else
                {
                    return(View("~/Views/Shared/Error.cshtml", new Models.ManejadorError("Nulo", "", "", "", "")));
                }
            } catch (Exception ex) {
                return(View("~/Views/Shared/Error.cshtml", new Models.ManejadorError(ex)));
            }
        }
        //
        // GET: /Editorial/Edit/5

        public ActionResult Edit(int id)
        {
            try {
                ViewBag.Paises = BLL.PaisBLL.ListActivos();
                Editorial e = EditorialBLL.Get(id);
                if (e != null && ViewBag.Paises != null)
                {
                    return(View(e));
                }
                else
                {
                    return(View("~/Views/Shared/Error.cshtml", new Models.ManejadorError("Nulo", "", "", "", "")));
                }
            } catch (Exception ex) {
                return(View("~/Views/Shared/Error.cshtml", new Models.ManejadorError(ex)));
            }
        }
Exemplo n.º 9
0
        //
        // GET: /Libro/Edit/5

        public ActionResult Edit(int id)
        {
            ListaLibEjem    = null;
            ListaLibEjemDel = null;
            try {
                Libro l = LibroBLL.Get(id);
                if (l != null)
                {
                    ViewBag.Autores         = AutorBLL.ListActivos();
                    ViewBag.Editoriales     = EditorialBLL.ListActivos();
                    ViewBag.Clasificaciones = ClasificacionBLL.ListActivos();
                    return(View(l));
                }
                else
                {
                    return(View("~/Views/Shared/Error.cshtml", new Models.ManejadorError("Nulo", "", "", "", "")));
                }
            } catch (Exception ex) {
                return(View("~/Views/Shared/Error.cshtml", new Models.ManejadorError(ex)));
            }
        }