public async Task <ActionResult> Edit(int id, ActoresModel collection)
 {
     try
     {
         await _Actores.Update(collection, (String)Session["usuarioLogin"], (String)Session["passLogin"]);
     }
     catch
     {
     }
     return(RedirectToAction("Index"));
 }
예제 #2
0
        public ActionResult Delete(int id, ActoresModel modelo)
        {
            try
            {
                // TODO: Add delete logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #3
0
        public async Task <ActionResult> Edit(int id, ActoresModel modelo)
        {
            try
            {
                // TODO: Add update logic here
                await _actores.Update(modelo);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #4
0
        public async Task <ActionResult> Create(ActoresModel modelo)
        {
            try
            {
                // TODO: Add insert logic here
                await _actores.Add(modelo);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        public async Task <ActionResult> Create(ActoresModel collection)
        {
            Session["ActorCreado"] = collection;

            try
            {
                await _Actores.Add(collection, (String)Session["usuarioLogin"], (String)Session["passLogin"]);

                Session["ActorCreado"] = null;
            }
            catch
            {
            }
            return(RedirectToAction("Index"));
        }
        // GET: Actores/Create
        public ActionResult Create(int?idPelicula)
        {
            var actor = new ActoresModel();

            if (Session["ActorCreado"] != null)
            {
                actor = (ActoresModel)Session["ActorCreado"];
            }

            if (idPelicula != null)
            {
                actor.idPelicula = (int)idPelicula;
            }

            return(View(actor));
        }