Ejemplo n.º 1
0
        public bool UpdatePost(PropertyValueUpdateGet PropertyValue)
        {
            string usp = "usp_PropertyValueUpdatePost @PropertyValueId, @Sequence, @PropertyValueInt,@PropertyValueString,@PropertyValueBool,@PropertyValueDate, @Name , @Description , @MenuName , @MouseOver , @UserId ";

            _sqlDataAccess.SaveData <PropertyValueUpdateGet>(usp, PropertyValue);
            return(true);
        }
Ejemplo n.º 2
0
        public async Task <List <ErrorMessage> > UpdatePostCheck(PropertyValueUpdateGet PropertyValue)
        {
            string usp           = "usp_PropertyValueUpdatePostCheck @PropertyValueId, @Sequence, @PropertyValueInt,@PropertyValueString,@PropertyValueBool,@PropertyValueDate, @Name , @Description , @MenuName , @MouseOver , @UserId ";
            var    ErrorMessages = await _sqlDataAccess.LoadData <ErrorMessage, dynamic>(usp, PropertyValue);

            return(ErrorMessages);
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Update(PropertyValueUpdateGet PropertyValue)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            PropertyValue.UserId = CurrentUser.Id;
            var ErrorMessages = new List <ErrorMessage>();

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                ErrorMessages = await _propertyValueProvider.UpdatePostCheck(PropertyValue);

                if (ErrorMessages.Count > 0)
                {
                    PropertyValue = await UpdateAddDropDownBoxes(PropertyValue, CurrentUser.Id);
                }
                else
                {
                    _propertyValueProvider.UpdatePost(PropertyValue);
                }
                PropertyValueUpdateGetWithErrorMessages PropertyValueWithErrorMessage = new PropertyValueUpdateGetWithErrorMessages {
                    PropertyValue = PropertyValue, ErrorMessages = ErrorMessages
                };
                return(Ok(PropertyValueWithErrorMessage));
            }
            ErrorMessages = await _checkProvider.NoRightsMessage(CurrentUser.Id);

            PropertyValueUpdateGetWithErrorMessages PropertyValueWithNoRights = new PropertyValueUpdateGetWithErrorMessages {
                PropertyValue = PropertyValue, ErrorMessages = ErrorMessages
            };

            return(Ok(PropertyValueWithNoRights));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Edit(PropertyValueUpdateGet PropertyValue)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var PropertyValueUpdateGetWithErrorMessage = await _client.PostProtectedAsync <PropertyValueUpdateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/PropertyValue/Update", PropertyValue, token);

            if (PropertyValueUpdateGetWithErrorMessage.ErrorMessages.Count > 0)
            {
                ViewBag.Favorites = await _client.GetProtectedAsync <List <MVCFavoriteMenu> >($"{_configuration["APIUrl"]}api/MVCFavorite/Menu", token);

                ViewBag.FavoriteGroupList = await _client.GetProtectedAsync <List <MVCFavoriteGroupList> >($"{_configuration["APIUrl"]}api/MVCFavorite/GroupList", token);

                ViewBag.UITerms = await _client.GetProtectedAsync <List <UITermLanguageCustomizationList> >($"{_configuration["APIUrl"]}api/MVC/PropertyValue/Edit", token);

                ViewBag.Env = _hostingEnv.EnvironmentName;

                ViewBag.ErrorMessages = PropertyValueUpdateGetWithErrorMessage.ErrorMessages;
                return(View(PropertyValueUpdateGetWithErrorMessage.PropertyValue));
            }

            return(RedirectToAction("Index", new { id = PropertyValue.PropertyId }));
        }
Ejemplo n.º 5
0
        private async Task <PropertyValueUpdateGet> UpdateAddDropDownBoxes(PropertyValueUpdateGet PropertyValue, string UserId)
        {
            PropertyValue.PropertyValues = await _propertyValueProvider.CreateGetSequence(UserId, PropertyValue.PropertyId);

            return(PropertyValue);
        }