Ejemplo n.º 1
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 ClassificationPageSectionCreateGet          = new ClassificationPageSectionCreateGet();
                var ClassificationPageSectionCreateGetSequences = await _classificationPageSectionProvider.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);

                ClassificationPageSectionCreateGet.LanguageId           = UserLanguage.LanguageId;
                ClassificationPageSectionCreateGet.LanguageName         = UserLanguage.Name;
                ClassificationPageSectionCreateGet.PageSectionDataTypes = PageSectionDataTypes;
                ClassificationPageSectionCreateGet.PageSectionTypes     = PageSectionTypes;
                ClassificationPageSectionCreateGet.ContentTypes         = ContentTypes;
                ClassificationPageSectionCreateGet.SortBys          = SortBys;
                ClassificationPageSectionCreateGet.ClassificationId = Id;
                return(Ok(ClassificationPageSectionCreateGet));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
        private async Task <PageSectionContentConditionCreateGet> CreateAddDropDownBoxes(PageSectionContentConditionCreateGet PageSectionContentCondition, string UserId, int PageSectionId)
        {
            PageSectionContentCondition.PageSectionContentConditionTypes = await _pageSectionContentConditionTypeProvider.ListExtended(UserId);

            PageSectionContentCondition.Users = await _userProvider.List();

            PageSectionContentCondition.Projects = await _projectProvider.List(UserId);

            PageSectionContentCondition.ContentTypes = await _contentTypeProvider.List(UserId);

            PageSectionContentCondition.ContentStatuses = await _contentStatusProvider.List(UserId);

            PageSectionContentCondition.Languages = await _languageProvider.List(UserId);

            PageSectionContentCondition.SecurityLevels = await _securityLevelProvider.List(UserId);

            PageSectionContentCondition.Classifications = await _pageSectionContentConditionProvider.CreateGetClassifications(UserId);

            for (int i = 0; i < PageSectionContentCondition.Classifications.Count(); i++)
            {
                PageSectionContentCondition.Classifications[i].ClassificationValues = await _pageSectionContentConditionProvider.CreateGetClassificationValues(UserId, PageSectionContentCondition.Classifications[i].ClassificationId);
            }
            PageSectionContentCondition.PageSectionId = PageSectionId;
            var SortBys = await _masterListProvider.SortByList(UserId);

            return(PageSectionContentCondition);
        }
Ejemplo n.º 3
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()))
            {
                //PETER TODO add security with message like missing in contentcondition
                var PageSectionProcessConditionCreateGet = new PageSectionProcessConditionCreateGet();
                PageSectionProcessConditionCreateGet.PageSectionProcessConditionTypes = await _pageSectionProcessConditionTypeProvider.ListExtended(CurrentUser.Id);

                PageSectionProcessConditionCreateGet.ProcessTypes = await _processTypeProvider.List(CurrentUser.Id);

                PageSectionProcessConditionCreateGet.ProcessTypeGroups = await _processTypeGroupProvider.List(CurrentUser.Id);

                PageSectionProcessConditionCreateGet.Organizations = await _organizationProvider.List(CurrentUser.Id);

                PageSectionProcessConditionCreateGet.Projects = await _projectProvider.List(CurrentUser.Id);

                PageSectionProcessConditionCreateGet.Roles = await _roleProvider.List(CurrentUser.Id);

                PageSectionProcessConditionCreateGet.SecurityLevels = await _securityLevelProvider.List(CurrentUser.Id);

                PageSectionProcessConditionCreateGet.Users = await _userProvider.List();

                PageSectionProcessConditionCreateGet.ProcessTypeStageTypes = await _processTypeStageTypeProvider.List(CurrentUser.Id);

                PageSectionProcessConditionCreateGet.Languages = await _languageProvider.List(CurrentUser.Id);

                PageSectionProcessConditionCreateGet.Persons = await _personProvider.List();

                PageSectionProcessConditionCreateGet.Contents = await _contentProvider.List();

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

                PageSectionProcessConditionCreateGet.ContentTypeGroups = await _contentTypeGroupProvider.List(CurrentUser.Id);


                //PageSectionProcessConditionCreateGet.ProcessTypes = await _ProcessTypeProvider.List(CurrentUser.Id);
                //PageSectionProcessConditionCreateGet.ProcessStatuses = await _ProcessStatusProvider.List(CurrentUser.Id);
                PageSectionProcessConditionCreateGet.Classifications = await _pageSectionProcessConditionProvider.CreateGetClassifications(CurrentUser.Id);

                for (int i = 0; i < PageSectionProcessConditionCreateGet.Classifications.Count(); i++)
                {
                    PageSectionProcessConditionCreateGet.Classifications[i].ClassificationValues = await _pageSectionProcessConditionProvider.CreateGetClassificationValues(CurrentUser.Id, PageSectionProcessConditionCreateGet.Classifications[i].ClassificationId);
                }
                PageSectionProcessConditionCreateGet.PageSectionId = Id;
                //PageSectionProcessConditionCreateGet.Classifications = await _classificationProvider.List(CurrentUser.Id);
                //  var PageSectionCreateGetSequences = await _pageSectionProvider.CreateGetSequence(CurrentUser.Id, Id);
                var SortBys = await _masterListProvider.SortByList(CurrentUser.Id);

                //                PageSectionCreateGet.Sequences = PageSectionCreateGetSequences;
                return(Ok(PageSectionProcessConditionCreateGet));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Ejemplo n.º 4
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);
        }