Ejemplo n.º 1
0
        public ActionResult Create(Actor actor, HttpPostedFileBase ImageFile, string controllerName, string actionName)
        {
            if (ModelState.IsValid)
            {
                if (ImageFile != null)
                {
                    SaveImage(ImageFile, ref actor);

                    _actorManager.Create(actor);
                    if (controllerName == null && actionName == null)
                    {
                        return(RedirectToAction("Index"));
                    }
                    else
                    {
                        return(RedirectToAction(actionName, controllerName));
                    }
                }
            }

            ViewBag.Gender = new SelectList(_genderManager.GetGenders(), "_Id", "_Name", actor._SelectedGender);
            return(View());
        }