public async Task <IActionResult> Delete(ClassificationValueDeleteGet ClassificationValue)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                ClassificationValue.UserId = CurrentUser.Id;
                //var CheckString = await _ClassificationValueProvider.DeletePostCheck(ClassificationValue);
                //if (CheckString.Length == 0)
                //{
                _classificationValueProvider.DeletePost(CurrentUser.Id, ClassificationValue.ClassificationValueId);
                return(Ok(ClassificationValue));

                //}
                return(BadRequest(new
                {
                    IsSuccess = false,
                    //Message = CheckString,
                }));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Example #2
0
        public async Task <IActionResult> Delete(ClassificationValueDeleteGet ClassificationValue)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            await _client.PostProtectedAsync <ClassificationValueDeleteGet>($"{_configuration["APIUrl"]}api/ClassificationValue/Delete", ClassificationValue, token);

            return(RedirectToAction("Index", new { id = ClassificationValue.ClassificationId }));
        }