public async Task <IActionResult> Delete(PersonTelecomDeleteGet PersonTelecom) { var CurrentUser = await _userManager.GetUserAsync(User); if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString())) { PersonTelecom.UserId = CurrentUser.Id; //var CheckString = await _PersonTelecomProvider.DeletePostCheck(PersonTelecom); //if (CheckString.Length == 0) //{ _personTelecomProvider.DeletePost(CurrentUser.Id, PersonTelecom.PersonTelecomId); return(Ok(PersonTelecom)); //} return(BadRequest(new { IsSuccess = false, //Message = CheckString, })); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }
public async Task <IActionResult> Delete(PersonTelecomDeleteGet PersonTelecom) { var token = HttpContext.Session.GetString("Token"); if (token == null) { return(RedirectToAction("Login", "FrontAuth")); } await _client.PostProtectedAsync <PersonTelecomDeleteGet>($"{_configuration["APIUrl"]}api/PersonTelecom/Delete", PersonTelecom, token); return(RedirectToAction("Index", new { id = PersonTelecom.PersonId })); }