public IActionResult OnPostSave() { foreach (var people in PeopleList) { peopleData.AddPeople(people); } peopleData.Commit(); return(RedirectToPage("../PeoplePage/List")); }
public IActionResult Create(PersonEditViewModel model) { if (ModelState.IsValid) { string[] split = model.Name.Split(new char[0]); var newPerson = new Person(); newPerson.FirstName = split[0]; newPerson.LastName = split[1]; newPerson.Interests = model.Interests; newPerson.Birth = model.Birth; newPerson = _peopleData.Add(newPerson); _peopleData.Commit(); return(RedirectToAction("Search")); } return(View()); }
public IActionResult OnPost() { Genders = htmlHelper.GetEnumSelectList <GenderType>(); if (ModelState.IsValid) { if (PeopleEntity.Id > 0) { peopleData.UpdatePeople(PeopleEntity); } else { peopleData.AddPeople(PeopleEntity); } peopleData.Commit(); return(RedirectToPage("./List")); } return(Page()); }
public IActionResult OnPost(int peopleId) { peopleData.DeletePeople(peopleId); peopleData.Commit(); return(RedirectToPage("./List")); }