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