Exemple #1
0
        public async Task <ActionResult <Person> > DeletePerson(Guid id)
        {
            _logger.LogTrace("API Endpoint called | DELETE: /api/People/Guid ");
            var person = await _service.DeletePerson(id);

            if (person == null)
            {
                return(NotFound());
            }

            return(person);
        }
Exemple #2
0
        protected void repPerson_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var personId = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "edit")
            {
                Response.Redirect("PersonEdit.aspx?id=" + personId);
            }
            if (e.CommandName == "delete")
            {
                PeopleService service = new PeopleService();
                service.DeletePerson(personId);
                Response.Redirect("PersonList.aspx");
            }
            if (e.CommandName == "details")
            {
                Response.Redirect("PersonDetails.aspx?id=" + personId);
            }
        }
Exemple #3
0
        internal async void DeletePerson(int id)
        {
            await _peopleService.DeletePerson(id);

            LoadData();
        }