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 x = await _frontUserPreferenceProvider.UpdateGet(CurrentUser.Id, Id);

                switch (x.PreferenceTypeId)
                {
                case 1:
                    x.Languages = await _LanguageProvider.ActiveList(CurrentUser.Id);

                    break;

                case 2:
                    x.Pages = await _pageProvider.ListForMenuTemplate(CurrentUser.Id);

                    break;
                }
                return(Ok(x));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
        public async Task <IActionResult> GetLanguagesActive()
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                return(Ok(await _languageProvider.ActiveList(CurrentUser.Id)));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
        public async Task <IActionResult> ContentNew(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 ContentNew = new FrontContentContentNew();
                ContentNew = await _frontContentProvider.ContentNewGetContentType(Id);

                ContentNew.ContentTypeId = Id;
                ContentNew.Organizations = await _organizationProvider.ListofUser(CurrentUser.Id);

                ContentNew.Projects = await _projectProvider.ListofUser(CurrentUser.Id);

                ContentNew.Languages = await _languageProvider.ActiveList(CurrentUser.Id);

                ContentNew.SecurityLevels = await _securityLevelProvider.ListofUser(CurrentUser.Id);

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

                ContentNew.Classifications = await _frontContentProvider.NewClassifications(CurrentUser.Id, Id);

                ContentNew.ContentTypeName = await _contentTypeProvider.ReturnName(CurrentUser.Id, Id);

                ContentNew.OrganizationId = ContentNew.Organizations.First().OrganizationId;
                foreach (var Classification in ContentNew.Classifications)
                {
                    Classification.ClassificationLevels = await _frontContentProvider.NewClassificationLevels(Classification.ClassificationId);

                    foreach (var Classificationlevel in Classification.ClassificationLevels)
                    {
                        Classificationlevel.ClassificationValues = await _frontContentProvider.NewClassificationValues(CurrentUser.Id, Classification.ClassificationId, Classificationlevel.Sequence, Classificationlevel.Alphabetically);
                    }
                }
                return(Ok(ContentNew));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Beispiel #4
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 ProcessSearch = new ProcessAdvancedSearchPost();
                ProcessSearch.SelectedUsers = await _userProvider.List();

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

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

                ProcessSearch.Languages = await _languageProvider.ActiveList(CurrentUser.Id);

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

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

                ProcessSearch.Contents = await _contentProvider.List();

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

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

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

                ProcessSearch.Persons = await _personProvider.List();

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

                return(Ok(ProcessSearch));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }