Exemplo n.º 1
0
 public ActionResult Grabar(FormCollection collection)
 {
     try
     {
         RegistroPelicula rp   = new RegistroPelicula();
         Pelicula         peli = new Pelicula
         {
             //Codigo = int.Parse(collection["Codigo"]),
             Titulo         = collection["Titulo"],
             Director       = collection["Director"],
             AutorPrincipal = collection["AutorPrincipal"],
             numAutores     = int.Parse(collection["numActores"]),
             Duracion       = double.Parse(collection["Duracion"].ToString()),
             Estreno        = int.Parse(collection["Estreno"])
         };
         rp.GrabarPelicula(peli);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         throw ex;
         //ModelState.AddModelError("", ex.Message + " " + ex.StackTrace);
         //return View("Error", new HandleErrorInfo(ex, "Home", "Grabar"));
     }
 }
Exemplo n.º 2
0
        public ActionResult Grabar(FormCollection collection)
        {
            RegistroPelicula registro = new RegistroPelicula();
            Peliculas        peli     = new Peliculas
            {
                Codigo         = int.Parse(collection["Codigo"]),
                Titulo         = collection["Titulo"].ToString(),
                Director       = collection["Director"].ToString(),
                AutorPrincipal = collection["AutorPrincipal"].ToString(),
                numAutores     = int.Parse(collection["No_Autores"].ToString()),
                Duracion       = double.Parse(collection["Duracion"].ToString()),
                Estreno        = int.Parse(collection["Estreno"].ToString())
            };

            registro.GrabarPelicula(peli);
            return(RedirectToAction("Index"));
        }