Beispiel #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()))
            {
                //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",
            }));
        }
        private async Task <ContentTypeUpdateGet> UpdateAddDropDownBoxes(ContentTypeUpdateGet ContentType, string UserId)
        {
            var icons = await _masterListProvider.IconList(UserId);

            var ContentTypeGroups = await _contentTypeGroupProvider.List(UserId);

            var SecurityLevels = await _securityLevelProvider.List(UserId);

            var ProcessTypes = await _processTypeProvider.List(UserId);

            var ContentTypeClassifications = await _contentTypeClassificationProvider.UpdateGetClassifications(UserId, ContentType.ContentTypeId);


            var ContentTypeClassificationStatuses = await _contentTypeClassificationStatusProvider.List(UserId);

            ContentType.ContentTypeClassificationStatuses = ContentTypeClassificationStatuses;
            ContentType.ContentTypeGroups          = ContentTypeGroups;
            ContentType.ContentTypeClassifications = ContentTypeClassifications;

            ContentType.SecurityLevels = SecurityLevels;
            ContentType.ProcessTypes   = ProcessTypes;
            ContentType.Icons          = icons;

            return(ContentType);
        }