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

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

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

            //return RedirectToAction("Index", new { id = UserMenu.UserMenuTemplateId });
            return(RedirectToAction("Index"));
        }