public ActionResult EditActor(string firstName, string lastName, DateTime dob, int id, bool gender) { var model = new ActorViewModel() { FirstName = firstName, LastName = lastName, DOB = dob, IsFemale = gender, Id = id }; return this.PartialView("_PartialEditActor", model); }
public ActionResult AddActor(ActorViewModel model) { if (ModelState.IsValid) { this.actorsRepo.Add(new Actor() { FirstName = model.FirstName, LastName = model.LastName, DOB = model.DOB, IsFemale = model.IsFemale }); this.actorsRepo.SaveChanges(); return this.Redirect("/Actors"); } else { return this.PartialView("Error"); } }