public ActionResult DeletePeople(People person) { PeopleService peopleService = new PeopleService(); peopleService.DeletePeople(person.ID); return(RedirectToAction("ListPeople")); }
protected void repeaterPeople_ItemCommand(object sender, RepeaterCommandEventArgs e) { var personID = Convert.ToInt32(e.CommandArgument); if (e.CommandName == "edit") { Response.Redirect("AddPeople.aspx?id=" + personID); } if (e.CommandName == "delete") { PeopleService peopleService = new PeopleService(); peopleService.DeletePeople(Convert.ToInt32(personID)); Response.Redirect("ListPeople.aspx"); } if (e.CommandName == "details") { Response.Redirect("DetailsPeople.aspx?id=" + personID); } }