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);
        }
Exemplo n.º 2
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",
            }));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> AdvancedSearch()
        {
            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 ContentSearch = new ContentAdvancedSearchPost();
                ContentSearch.Classifications = await _classificationProvider.ClassificationsWithValues(CurrentUser.Id);

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

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

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

                ContentSearch.ContentStatuses = await _contentStatusProvider.List(CurrentUser.Id);

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

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

                foreach (var x in ContentSearch.Classifications)
                {
                    x.ClassificationValues = await _classificationValueProvider.ListPerClassification(CurrentUser.Id, x.ClassificationId);
                }

                return(Ok(ContentSearch));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Exemplo n.º 4
0
        private async Task <UserCreateGet> CreateAddDropDownBoxes(UserCreateGet User, string UserId)
        {
            var Organizations = await _organizationProvider.List(UserId);

            var Genders = await _genderProvider.List(UserId);

            var Languages = await _languageProvider.List(UserId);

            var SecurityLevels = await _securityLevelProvider.List(UserId);

            User.Organizations  = Organizations;
            User.SecurityLevels = SecurityLevels;
            User.Genders        = Genders;
            User.Languages      = Languages;

            return(User);
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Update(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 Setting = await _settingProvider.UpdateGet(CurrentUser.Id, Id);

                if (Setting.TypeId == 1)
                {
                    var LanguageList = await _languageProvider.List(CurrentUser.Id);

                    Setting.Languages = LanguageList;
                }
                return(Ok(Setting));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Create(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var testifallowed = new FrontProcessNewProcessLogic(_userProvider, _processProvider, _frontProcessProvider);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))              //11
            {
                List <NewProcessTypeList> x = await testifallowed.ReturnProcessTypeList(CurrentUser);

                if (x.Exists(x => x.ProcessTypeId == Id))
                {
                    //TOFIX PETER
                    var newprocess = await _processProvider.CreateGet(CurrentUser.Id, Id);

                    var newProcessWithMaster = new FrontProcessNewProcessWithMaster();

                    newProcessWithMaster.ProcessTypeId = Id;
                    newProcessWithMaster.ProcessFields = newprocess;
                    foreach (var y in newprocess)
                    {
                        if (y.ProcessTypeStageFieldStatusId == 4)
                        {
                            var xd = @$ "function {y.ControlIdOnFocusOutFunction.Trim()} {{var x = document.getElementById('{y.ControlId.Trim()}');console.log(x);if (x.value==='') {{ document.getElementById('{y.ControlIdWarning.Trim()}').style.display = 'block';}}else{{ document.getElementById('{y.ControlIdWarning.Trim()}').style.display = 'none';}}}}";
                            //var xd = @$"function {y.ControlIdOnFocusOutFunction.Trim()} {{var x = document.getElementById('{y.ControlId.Trim()}');if (x.value==='') {{alert('{y.MissingValueText.Trim()}a');}}else{{alert('{y.MissingValueText.Trim()}b');}}}}";
                            // var xe = String.Format($"function {0} {{var x = document.getElementById(\"{1}\");if (x.value===\"\") {{alert(\"{2}\");}}}}", y.ControlIdOnFocusOutFunction.Trim(), y.ControlId.Trim(), y.MissingValueText.Trim());
                            newProcessWithMaster.ErrorHandlingScript = newProcessWithMaster.ErrorHandlingScript + xd;
                            //@"function " +
                            //y.ControlIdOnFocusOutFunction + @" {var x = document.getElementById("""+
                            //y.ControlId + "\");if (x.value===\"\") {alert(\"" +
                            //y.MissingValueText + "\");}}";
                        }
                    }
                    //for(int i = 0; i < newprocess.Count; i++)
                    //{
                    //if(newprocess[i].ValueUpdateTypeId==2 && new[] { 1, 2 }.Contains(newprocess[i].ProcessTypeFieldTypeId))
                    //    {
                    //        newprocess[i].StringValue
                    //    }

                    //}
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 12) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 13))
                    {
                        var Users = await _userProvider.List();

                        newProcessWithMaster.Users = Users;
                    }
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 14) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 15))
                    {
                        var organizations = await _organizationProvider.List(CurrentUser.Id);

                        newProcessWithMaster.Organizations = organizations;
                    }
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 16) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 17))
                    {
                        var projects = await _projectProvider.List(CurrentUser.Id);

                        newProcessWithMaster.Projects = projects;
                    }
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 18) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 19))
                    {
                        var Languages = await _languageProvider.List(CurrentUser.Id);

                        newProcessWithMaster.Languages = Languages;
                    }
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 20) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 21))
                    {
                        var Classifications = await _classificationProvider.List(CurrentUser.Id);

                        newProcessWithMaster.Classifications = Classifications;
                    }
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 22) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 23))
                    {
                        var ClassificationValues = await _classificationValueProvider.List(CurrentUser.Id);

                        newProcessWithMaster.ClassificationValues = ClassificationValues;
                    }
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 24) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 25))
                    {
                        var Contents = await _contentProvider.List();

                        newProcessWithMaster.Contents = Contents;
                    }
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 26) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 27))
                    {
                        var Countries = await _masterListProvider.CountryList(CurrentUser.Id);

                        newProcessWithMaster.Countries = Countries;
                    }
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 28) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 29))
                    {
                        var SecurityLevels = await _securityLevelProvider.List(CurrentUser.Id);

                        newProcessWithMaster.SecurityLevels = SecurityLevels;
                    }
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 30) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 31))
                    {
                        var Roles = await _roleProvider.List(CurrentUser.Id);

                        newProcessWithMaster.Roles = Roles;
                    }
                    if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 36) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 37))
                    {
                        var Persons = await _personProvider.List();

                        newProcessWithMaster.Persons = Persons;
                    }
                    return(Ok(newProcessWithMaster));// CurrentUser.LanguageId));
                }
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }