public async Task <string> CreatePostCheck(PageSectionCreateGet PageSection)
        {
            string usp         = "usp_UserPageSectionCreatePostCheck @PageId, @Sequence, @PageSectionTypeId, @PageSectionDataTypeId, @@OneTwoColumns, @ContentTypeId, @SortById,, @Name, @CreatorId ";
            var    CheckString = await _sqlDataAccess.LoadSingleRecord <string, dynamic>(usp, PageSection);

            return(CheckString);
        }
        public async Task <string> CreatePost(PageSectionCreateGet PageSection)
        {
            string usp         = "usp_UserPageSectionCreatePost @PageId, @Sequence, @PageSectionTypeId, @PageSectionDataTypeId, @ShowSectionTitleName, @ShowSectionTitleDescription, @ShowContentTypeTitleName, @ShowContentTypeTitleDescription, @OneTwoColumns, @ContentTypeId, @SortById, @MaxContent, @HasPaging, @LanguageId, @Name, @Description, @MenuName, @MouseOver, @TitleName, @TitleDescription, @CreatorId ";
            var    CheckString = await _sqlDataAccess.LoadSingleRecord <string, dynamic>(usp, PageSection);

            return(CheckString);
        }
Exemplo n.º 3
0
        public async Task <List <ErrorMessage> > CreatePostCheck(PageSectionCreateGet PageSection)
        {
            string usp           = "usp_PageSectionCreatePostCheck @PageId, @Sequence, @PageSectionTypeId, @PageSectionDataTypeId, @@OneTwoColumns, @ContentTypeId, @SortById, @LanguageId, @Name, @CreatorId ";
            var    ErrorMessages = await _sqlDataAccess.LoadData <ErrorMessage, dynamic>(usp, PageSection);

            return(ErrorMessages);
        }
Exemplo n.º 4
0
        public async Task <string> CreatePost(PageSectionCreateGet PageSection)
        {
            string usp         = "usp_PageSectionCreatePost @PageId, @PageSectionTypeId, @PageSectionDataTypeId, @ShowSectionTitleName , @ShowSectionTitleDescription , @ShowContentTypeTitleName , @ShowContentTypeTitleDescription , @SizeX, @SizeY, @DashboardRow, @DashboardColumn, @ContentTypeId, @SortById, @MaxContent, @HasPaging , @Name, @Description, @MenuName, @MouseOver, @TitleName, @TitleDescription, @UserId ";
            var    CheckString = await _sqlDataAccess.LoadSingleRecord <string, dynamic>(usp, PageSection);

            return(CheckString);
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Create(PageSectionCreateGet PageSection)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

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

                if (ErrorMessages.Count > 0)
                {
                    PageSection = await CreateAddDropDownBoxes(PageSection, CurrentUser.Id, PageSection.PageId);
                }
                else
                {
                    _pageSectionProvider.CreatePost(PageSection);
                }
                PageSectionCreateGetWithErrorMessages PageSectionWithErrorMessage = new PageSectionCreateGetWithErrorMessages {
                    PageSection = PageSection, ErrorMessages = ErrorMessages
                };
                return(Ok(PageSectionWithErrorMessage));
            }
            ErrorMessages = await _checkProvider.NoRightsMessage(CurrentUser.Id);

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

            return(Ok(PageSectionWithNoRights));
        }
        public async Task <IActionResult> Create(PageSectionCreateGet 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 _frontUserPageSectionProvider.CreatePostCheck(PageSection);

                if (CheckString.Length == 0)
                {
                    _frontUserPageSectionProvider.CreatePost(PageSection);
                    return(Ok(PageSection));
                }
                return(BadRequest(new
                {
                    IsSuccess = false,
                    Message = CheckString,
                }));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
        public async Task <IActionResult> Create(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                var PageSectionCreateGet          = new PageSectionCreateGet();
                var PageSectionCreateGetSequences = await _frontUserPageSectionProvider.CreateGetSequence(CurrentUser.Id, Id);

                var PageSectionTypes = await _pageSectionTypeProvider.List(CurrentUser.Id);

                var PageSectionDataTypes = await _pageSectionDataTypeProvider.List(CurrentUser.Id);

                var ContentTypes = await _contentTypeProvider.List(CurrentUser.Id);

                var SortBys = await _masterListProvider.SortByList(CurrentUser.Id);

                var UserLanguage = await _masterProvider.UserLanguageUpdateGet(CurrentUser.Id);

                PageSectionCreateGet.LanguageId           = UserLanguage.LanguageId;
                PageSectionCreateGet.LanguageName         = UserLanguage.Name;
                PageSectionCreateGet.PageSectionDataTypes = PageSectionDataTypes;
                PageSectionCreateGet.PageSectionTypes     = PageSectionTypes;
                PageSectionCreateGet.Sequences            = PageSectionCreateGetSequences;
                PageSectionCreateGet.PageId = Id;
                return(Ok(PageSectionCreateGet));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Exemplo n.º 8
0
        public async Task <IActionResult> Create(PageSectionCreateGet PageSection)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            await _client.PostProtectedAsync <PageSectionCreateGet>($"{_configuration["APIUrl"]}api/PageSection/Create", PageSection, token);

            var PageSectionCreateGetWithErrorMessage = await _client.PostProtectedAsync <PageSectionCreateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/PageSection/Create", PageSection, token);

            if (PageSectionCreateGetWithErrorMessage.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 = PageSectionCreateGetWithErrorMessage.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/Create", token);
                //ViewBag.Env = _hostingEnv.EnvironmentName;

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

            return(RedirectToAction("Index", new { id = PageSection.PageId }));
        }
Exemplo n.º 9
0
        public async Task <IActionResult> Create(PageSectionCreateGet PageSection)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            await _client.PostProtectedAsync <PageSectionCreateGet>($"{_configuration["APIUrl"]}api/FrontUserPageSection/Create", PageSection, token);

            return(RedirectToAction("Index", new { id = PageSection.PageId }));
        }
Exemplo n.º 10
0
        public async Task <IActionResult> Create(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                var PageSection = new PageSectionCreateGet();
                PageSection = await CreateAddDropDownBoxes(PageSection, CurrentUser.Id, Id);

                return(Ok(PageSection));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Exemplo n.º 11
0
        private async Task <PageSectionCreateGet> CreateAddDropDownBoxes(PageSectionCreateGet PageSection, string UserId, int PageId)
        {
            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.LanguageId           = UserLanguage.LanguageId;
            PageSection.LanguageName         = UserLanguage.Name;
            PageSection.PageSectionDataTypes = PageSectionDataTypes;
            PageSection.PageSectionTypes     = PageSectionTypes;
            PageSection.ContentTypes         = ContentTypes;
            PageSection.SortBys = SortBys;
            PageSection.PageId  = PageId;
            return(PageSection);
        }