Beispiel #1
0
        public bool UpdatePost(AddressTypeUpdateGet AddressType)
        {
            string usp = "usp_AddressTypeUpdatePost @AddressTypeId, @StatusId, @ModifierId";

            _sqlDataAccess.SaveData <AddressTypeUpdateGet>(usp, AddressType);
            return(true);
        }
        public async Task <IActionResult> Update(AddressTypeUpdateGet AddressType)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

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

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