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