예제 #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);
        }
예제 #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);
            }
        }
예제 #3
0
        internal async void DeletePerson(int id)
        {
            await _peopleService.DeletePerson(id);

            LoadData();
        }