示例#1
0
 public IActionResult Delete(int id)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(this.ModelState));
     }
     else
     {
         _organizationsService.DeleteOrganization(id);
         return(Ok());
     }
 }
示例#2
0
        private async void DeleteInternal(ModalResult modalResult)
        {
            if (!modalResult.Cancelled)
            {
                var isDeleted = await OrganizationsService.DeleteOrganization((int)modalResult.Data);

                if (isDeleted)
                {
                    StateHasChanged();
                    await Refresh();
                }
                else
                {
                    ToastService.ShowToast("Unable to delete! Projects exists on this Organization!", ToastLevel.Error);
                }
            }

            Modal.OnClose -= DeleteInternal;
        }