Exemple #1
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var user = await service.GetUserById(id);

            await service.DeleteUser(user);

            return(RedirectToAction(nameof(Index)));
        }
Exemple #2
0
        protected async Task DeleteUser()
        {
            await UserDataService.DeleteUser(User.Id);

            StatusClass = "alert-success";
            Message     = "Deleted successfully";
            ShowDialog  = false;
            Saved       = true;
        }
Exemple #3
0
 public string DeleteUser(int iduser)
 {
     try
     {
         return(_userService.DeleteUser(iduser) ? "Amigo Delete Successfully" : "Error in delete Amigo");
     }
     catch (Exception e)
     {
         return(e.Message);
     }
 }
Exemple #4
0
        public async Task DeleteUserTest()
        {
            var fake        = Mock.Of <IAllRepo>();
            var roleService = new UserDataService(fake);

            var role = new User()
            {
                login = "******"
            };
            await roleService.DeleteUser(role);
        }
        public async void DeleteUser(long id)
        {
            if (!await JSRuntime.InvokeAsync <bool>("confirm", "Are you sure you want to delete this user"))
            {
                return;
            }
            await UserDataService.DeleteUser(id);

            Users = (await UserDataService.GetAllUsers()).ToList();
            StateHasChanged();
            ToastService.ShowSuccess("User Deleted Successfuly", "Confirm");
        }
        public Result DeleteUser(string userId)
        {
            bool result = service.DeleteUser(userId);

            if (result)
            {
                return new Result
                       {
                           status = Status.OK,
                           data   = result
                       }
            }
            ;
            else
            {
                return new Result
                       {
                           status = Status.BadRequest,
                           data   = Messages.BadRequest
                       }
            };
        }
Exemple #7
0
 public bool DeleteUser(Int64 Id)
 {
     return(objUDS.DeleteUser(Id));
 }