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