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

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

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

            return(RedirectToAction("Index", new { id = ClassificationValueProperty.ClassificationValueId }));
        }