public PartialViewResult CreateActorPartialView() { ActorsViewModels actor = new ActorsViewModels(); Movie movie = new Movie(); ViewBag.ProID = new SelectList(db.Producers, "ProID", "Name", movie.ProID); ViewBag.Sex = new SelectList(MoviesController.GetGender(), "Value", "Text", actor.Sex); return(PartialView("CreateActorPartialView")); }
//,ActionName("CreateActor") public ActionResult CreateActorPartialView(ActorsViewModels actorModel) { if (ModelState.IsValid) { Actor actor = new Actor(); actor.Name = actorModel.Name; actor.Sex = (byte)actorModel.Sex; actor.Bio = actorModel.Bio; actor.DOB = actorModel.DOB; actor.MovieActors = actorModel.MovieActors; db.Actors.Add(actor); db.SaveChanges(); return(Content("Actor Added Successfully")); } ViewBag.Sex = new SelectList(MoviesController.GetGender(), "Value", "Text", actorModel.Sex); return(PartialView(actorModel)); }