Пример #1
0
        public async Task <List <ErrorMessage> > UpdatePostCheck(PageSectionUpdateGet PageSection)
        {
            string usp           = "usp_PageSectionUpdatePostCheck @PageSectionId, @PageSectionTypeId, @PageSectionDataTypeId, @ShowSectionTitleName, @ShowSectionTitleDescription, @ShowContentTypeTitleName, @ShowContentTypeTitleDescription, @SizeX, @SizeY, @DashboardRow, @DashboardColumn, @ContentTypeId, @SortById, @MaxContent, @HasPaging, @Name, @Description, @MenuName , @MouseOver, @TitleName, @TitleDescription , @ModifierId ";
            var    ErrorMessages = await _sqlDataAccess.LoadData <ErrorMessage, dynamic>(usp, PageSection);

            return(ErrorMessages);
        }
        public bool UpdatePost(PageSectionUpdateGet PageSection)
        {
            string usp = "usp_PageSectionUpdatePost @PageSectionId, @Sequence, @PageSectionTypeId, @PageSectionDataTypeId, @ShowSectionTitleName, @ShowSectionTitleDescription, @ShowContentTypeTitleName, @ShowContentTypeTitleDescription, @OneTwoColumns, @ContentTypeId, @SortById, @MaxContent, @HasPaging, @Name, @Description, @MenuName, @MouseOver, @TitleName, @TitleDescription, @SizeX, @SizeY, @DashboardRow, @DashboardColumn, @ModifierID";

            _sqlDataAccess.SaveData <PageSectionUpdateGet>(usp, PageSection);
            return(true);
        }
Пример #3
0
        public async Task <IActionResult> Update(PageSectionUpdateGet PageSection)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            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 _pageSectionProvider.UpdatePostCheck(PageSection);

                if (ErrorMessages.Count > 0)
                {
                    PageSection = await UpdateAddDropDownBoxes(PageSection, CurrentUser.Id);
                }
                else
                {
                    _pageSectionProvider.UpdatePost(PageSection);
                }
                PageSectionUpdateGetWithErrorMessages PageSectionWithErrorMessage = new PageSectionUpdateGetWithErrorMessages {
                    PageSection = PageSection, ErrorMessages = ErrorMessages
                };
                return(Ok(PageSectionWithErrorMessage));
            }
            ErrorMessages = await _checkProvider.NoRightsMessage(CurrentUser.Id);

            PageSectionUpdateGetWithErrorMessages PageSectionWithNoRights = new PageSectionUpdateGetWithErrorMessages {
                PageSection = PageSection, ErrorMessages = ErrorMessages
            };

            return(Ok(PageSectionWithNoRights));
        }
        public async Task <IActionResult> Update(PageSectionUpdateGet PageSection)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            PageSection.UserId = CurrentUser.Id;
            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                //var CheckString = await _userPageProvider.UserPageUpdatePostCheck(Page);
                //if (CheckString.Length == 0)
                //{
                _frontUserPageSectionProvider.UpdatePost(PageSection);
                return(Ok(PageSection));
                //}
                //return BadRequest(new
                //{
                //    IsSuccess = false,
                //    Message = CheckString,
                //});
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Пример #5
0
        public async Task <IActionResult> Edit(PageSectionUpdateGet PageSection)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var PageSectionUpdateGetWithErrorMessage = await _client.PostProtectedAsync <PageSectionUpdateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/PageSection/Update", PageSection, token);

            if (PageSectionUpdateGetWithErrorMessage.ErrorMessages.Count > 0)
            {
                var AllStuff = await _loadViewBagModel.ViewBagLoad(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), token, _hostingEnv.EnvironmentName, _configuration, false, 0, "");

                AllStuff.ErrorMessages = PageSectionUpdateGetWithErrorMessage.ErrorMessages;
                ViewBag.AllStuff       = AllStuff;
                //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/PageSection/Edit", token);
                //ViewBag.Env = _hostingEnv.EnvironmentName;

                //ViewBag.ErrorMessages = PageSectionUpdateGetWithErrorMessage.ErrorMessages;
                return(View(PageSectionUpdateGetWithErrorMessage.PageSection));
            }

            return(RedirectToAction("Index", new { id = PageSection.PageId }));
        }
Пример #6
0
        public async Task <IActionResult> Edit(PageSectionUpdateGet UserPageSection)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            await _client.PostProtectedAsync <PageSectionUpdateGet>($"{_configuration["APIUrl"]}api/FrontUserPageSection/Update", UserPageSection, token);

            return(RedirectToAction("Index", new { id = UserPageSection.PageId }));
        }
Пример #7
0
        private async Task <PageSectionUpdateGet> UpdateAddDropDownBoxes(PageSectionUpdateGet PageSection, string UserId)
        {
            var PageSectionTypes = await _pageSectionTypeProvider.List(UserId);

            var PageSectionDataTypes = await _pageSectionDataTypeProvider.List(UserId);

            var ContentTypes = await _contentTypeProvider.List(UserId);

            var SortBys = await _masterListProvider.SortByList(UserId);

            var UserLanguage = await _masterProvider.UserLanguageUpdateGet(UserId);

            PageSection.PageSectionDataTypes = PageSectionDataTypes;
            PageSection.PageSectionTypes     = PageSectionTypes;
            PageSection.ContentTypes         = ContentTypes;
            PageSection.SortBys = SortBys;
            return(PageSection);
        }