Esempio n. 1
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 PersonSearch = new PersonAdvancedSearchPost();
                PersonSearch.Classifications = await _classificationProvider.List(CurrentUser.Id);

                PersonSearch.ClassificationValues = await _classificationValueProvider.List(CurrentUser.Id);

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

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

                PersonSearch.Countries = await _masterListProvider.CountryList(CurrentUser.Id);

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

                return(Ok(PersonSearch));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Esempio 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",
            }));
        }
Esempio n. 3
0
        private async Task <PersonCreateGet> CreateAddDropDownBoxes(PersonCreateGet Person, string UserId)
        {
            var Genders = await _genderProvider.List(UserId);

            var Organizations = await _organizationProvider.List(UserId);

            Person.Genders       = Genders;
            Person.Organizations = Organizations;
            Person.Users         = await _personProvider.CreateGetUsers();

            return(Person);
        }
Esempio n. 4
0
        private async Task <PersonPositionCreateGet> CreateAddDropDownBoxes(PersonPositionCreateGet PersonPosition, string UserId, int PersonId)
        {
            var Positions = await _positionProvider.List(UserId);

            var Organizations = await _organizationProvider.List(UserId);

            //PETER TODO --Should exclude maybe some persons and positions
            PersonPosition.Positions     = Positions;
            PersonPosition.Organizations = Organizations;
            PersonPosition.PersonId      = PersonId;
            return(PersonPosition);
        }
        public async Task <IActionResult> Create()
        {
            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 PageCreateGet = new PageCreateGet();
                var Statuses      = await _masterListProvider.StatusList(CurrentUser.Id);

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

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

                var Classifications = await _classificationProvider.List(CurrentUser.Id);

                var Users = await _userProvider.List();

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

                PageCreateGet.LanguageId      = UserLanguage.LanguageId;
                PageCreateGet.LanguageName    = UserLanguage.Name;
                PageCreateGet.Statuses        = Statuses;
                PageCreateGet.Projects        = Projects;
                PageCreateGet.Organizations   = Organizations;
                PageCreateGet.Classifications = Classifications;
                PageCreateGet.Users           = Users;

                return(Ok(PageCreateGet));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
        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",
            }));
        }
Esempio n. 7
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);
        }
Esempio n. 8
0
        private async Task <PageCreateGet> CreateAddDropDownBoxes(PageCreateGet Page, string UserId)
        {
            var Statuses = await _masterListProvider.StatusList(UserId);

            var Projects = await _projectProvider.List(UserId);

            var Organizations = await _organizationProvider.List(UserId);

            var Classifications = await _classificationProvider.List(UserId);

            var Users = await _userProvider.List();

            var UserLanguage = await _masterProvider.UserLanguageUpdateGet(UserId);

            Page.LanguageId      = UserLanguage.LanguageId;
            Page.LanguageName    = UserLanguage.Name;
            Page.Statuses        = Statuses;
            Page.Projects        = Projects;
            Page.Organizations   = Organizations;
            Page.Classifications = Classifications;
            Page.Users           = Users;
            Page.StatusId        = 1;
            return(Page);
        }
        private async Task <ProcessTypeFlowPassCreateGet> CreateAddDropDownBoxes(ProcessTypeFlowPassCreateGet ProcessTypeFlowPass, string UserId, int ProcessTypeFlowId)
        {
            var ProcessTypeFlowPassCreateGetSequences = await _processTypeFlowPassProvider.CreateGetSequence(UserId, ProcessTypeFlowId);

            var ProcessTypeFlowPassTypes = await _processTypeFlowPassTypeProvider.List(UserId);

            var ProcessTypeFields = await _processTypeFlowPassProvider.CreateGetFieldList(UserId, ProcessTypeFlowId);

            var ProcessTypeFieldRoles = await _processTypeFlowPassProvider.CreateGetFieldRoleList(UserId, ProcessTypeFlowId);

            var ComparisonOperators = await _processTypeFlowPassComparisonOperatorProvider.List(UserId);

            var UserLanguage = await _masterProvider.UserLanguageUpdateGet(UserId);

            var SecurityLevels = await _securityLevelProvider.List(UserId);

            var Roles = await _roleProvider.List(UserId);

            var Organizations = await _organizationProvider.List(UserId);

            var Projects = await _projectProvider.List(UserId);

            var Users = await _userProvider.List();

            ProcessTypeFlowPass.LanguageId               = UserLanguage.LanguageId;
            ProcessTypeFlowPass.LanguageName             = UserLanguage.Name;
            ProcessTypeFlowPass.Sequences                = ProcessTypeFlowPassCreateGetSequences;
            ProcessTypeFlowPass.ProcessTypeFlowPassTypes = ProcessTypeFlowPassTypes;
            ProcessTypeFlowPass.ProcessTypeFieldRoles    = ProcessTypeFieldRoles;
            ProcessTypeFlowPass.ProcessTypeFields        = ProcessTypeFields;
            ProcessTypeFlowPass.ComparisonOperators      = ComparisonOperators;
            ProcessTypeFlowPass.ProcessTypeFlowId        = ProcessTypeFlowId;
            ProcessTypeFlowPass.UserId         = UserId;
            ProcessTypeFlowPass.SecurityLevels = SecurityLevels;
            ProcessTypeFlowPass.Roles          = Roles;
            ProcessTypeFlowPass.Organizations  = Organizations;
            ProcessTypeFlowPass.Projects       = Projects;
            ProcessTypeFlowPass.Users          = Users;

            return(ProcessTypeFlowPass);
        }
Esempio n. 10
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 OrganizationAdvancedSearch = new OrganizationAdvancedSearchPost();
                OrganizationAdvancedSearch.ParentOrganizations = await _organizationProvider.List(CurrentUser.Id);

                OrganizationAdvancedSearch.Statuses = await _masterListProvider.StatusList(CurrentUser.Id);

                OrganizationAdvancedSearch.OrganizationTypes = await _organizationTypeProvider.List(CurrentUser.Id);

                OrganizationAdvancedSearch.Persons = await _personProvider.List();

//                OrganizationAdvancedSearch = await _organizationProvider.FrontOrganizationAdvancedSearchGet(CurrentUser.Id);
                return(Ok(OrganizationAdvancedSearch));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Esempio n. 11
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",
            }));
        }