예제 #1
0
        public async Task <IActionResult> Update(LanguageUpdateGet language)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                language.ModifierId = CurrentUser.Id;
                //var CheckString = await _languageProvider.UpdatePostCheck(language);
                //if (CheckString.Length == 0)
                //{
                _languageProvider.UpdatePost(language);
                return(Ok(language));

                //}
                return(BadRequest(new
                {
                    IsSuccess = false,
                    //Message = CheckString,
                }));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }