コード例 #1
0
        public async Task <IActionResult> Index(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 FieldInfo = new ProcessTypeFieldStageIndexGet();
                var x         = await _processTypeFieldProvider.UpdateGet(CurrentUser.Id, Id);

                FieldInfo.ProcessTypeFieldId   = x.ProcessTypeFieldId;
                FieldInfo.ProcessTypeFieldName = x.Name;
                var FieldStages = await _processTypeFieldStageProvider.IndexGet(CurrentUser.Id, Id);

                FieldInfo.Stages = FieldStages;
                return(Ok(FieldInfo));


                // return Ok(await _processTypeStageFieldProvider.IndexGet(CurrentUser.Id, Id));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #2
0
        public async Task <IActionResult> Templates()
        {
            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 ListOfProcessTypeGroups = await _frontProcessProvider.NewProcessShowTemplateGroup(CurrentUser.Id);

                var TemplateLogic      = new FrontProcessNewProcessLogic(_userProvider, _processProvider, _frontProcessProvider);
                var ListOfProcessTypes = await TemplateLogic.ReturnProcessTypeList(CurrentUser);


                // var  = await _frontProcessProvider.NewProcessShowTemplate(CurrentUser.Id);
                foreach (var group in ListOfProcessTypeGroups)
                {
                    var ProcessTypes = ListOfProcessTypes.FindAll(x => x.ProcessTypeGroupId == group.ProcessTypeGroupId);
                    group.templates = ProcessTypes;
                }
                return(Ok(ListOfProcessTypeGroups));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #3
0
        public async Task <IActionResult> Index(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()))
            {
                return(Ok(await _contentTypeClassificationProvider.IndexGet(CurrentUser.Id, Id)));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #4
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()))
            {
                if (await _checkProvider.CheckIfRecordExists("Classifications", "ClassificationID", Id) == 0)
                {
                    return(BadRequest(new
                    {
                        IsSuccess = false,
                        Message = "No record with this ID",
                    }));
                }
                var x = await _classificationProvider.UpdateGet(CurrentUser.Id, Id);

                var u = await _classificationProvider.CreateGetSequence(CurrentUser.Id);

                var z = await _masterListProvider.StatusList(CurrentUser.Id);

                var icons = await _masterListProvider.IconList(CurrentUser.Id);

                x.Icons = icons;

                x.DropDownSequences = u;
                x.Statuses          = z;
                return(Ok(x));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #5
0
        public async Task <IActionResult> ProjectType(int?Id = null)
        {
            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 ProjectTypes = await _projectProvider.ProjectTypes(CurrentUser.Id, Id);

                return(Ok(ProjectTypes));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #6
0
        public async Task <IActionResult> Create(string 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 RoleClaim = new RoleClaimCreateGet();
                RoleClaim = await CreateAddDropDownBoxes(RoleClaim, CurrentUser.Id, Id);

                return(Ok(RoleClaim));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #7
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",
            }));
        }
コード例 #8
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",
            }));
        }
コード例 #9
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 UserMenuCreateGet = new UserMenuCreateGet();
                var iconslist         = await _masterListProvider.IconList(CurrentUser.Id);

                var Pages = await _pageProvider.ListForMenu(CurrentUser.Id);

                var UserMenuCreateGetSequences = await _frontUserMenuProvider.CreateGetSequence(CurrentUser.Id);

                UserMenuCreateGet.UserMenuTypesLeft = await _userMenuTypeProvider.LeftList(CurrentUser.Id);

                UserMenuCreateGet.UserMenuTypesRight = await _userMenuTypeProvider.RightList(CurrentUser.Id);

                UserMenuCreateGetSequences.Add(new SequenceList {
                    Sequence = UserMenuCreateGetSequences.Count, Name = "Add at the end"
                });
                UserMenuCreateGet.UserMenus = UserMenuCreateGetSequences;
                UserMenuCreateGet.Icons     = iconslist;
                UserMenuCreateGet.Pages     = Pages;
                UserMenuCreateGet.UserId    = CurrentUser.Id;
                return(Ok(UserMenuCreateGet));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #10
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",
            }));
        }
コード例 #11
0
        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 UserMenuTemplate = new UserMenuTemplateCreatePost();
                return(Ok(UserMenuTemplate));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #12
0
ファイル: BaseController.cs プロジェクト: peterlegrand/SIPx
        public async Task <IActionResult> LanguageCreate(int Id, [FromQuery(Name = "BaseType")] string BaseType)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight"
                                             , BaseType + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                var BaseLanguage = new BaseLanguageCreateGet();
                BaseLanguage.BaseId   = Id;
                BaseLanguage.BaseType = BaseType;
                BaseLanguage          = await CreateAddDropDownBoxes(BaseLanguage, CurrentUser.Id);

                return(Ok(BaseLanguage));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #13
0
        public async Task <IActionResult> Create(int Id, [FromQuery(Name = "ParentId")] int ParentId = 0)
        {
            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 ClassificationValue = new ClassificationValueCreateGet();
                ClassificationValue = await CreateAddDropDownBoxes(ClassificationValue, CurrentUser.Id, Id, ParentId);

                return(Ok(ClassificationValue));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #14
0
        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",
            }));
        }
コード例 #15
0
        public async Task <IActionResult> NewProcessGet(int ProcessTypeId)
        {
            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 == ProcessTypeId))
                {
                    //TOFIX PETER
                    return(Ok(await _processProvider.CreateGet(CurrentUser.Id, ProcessTypeId)));// CurrentUser.LanguageId));
                }
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #16
0
ファイル: ImageController.cs プロジェクト: peterlegrand/SIPx
//        public async Task<IActionResult> UploadFile(ByteArrayContent file)
        public async Task <IActionResult> UploadFile([FromBody] FileUploadModel file)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            string fName = @"C:\backup\";
            //            FileInfo fi = new FileInfo(file.FileName);
            var newfilename = "dabc";

//            var newfilename = DateTime.Now.ToString("yyyyMMddHHmmssfff") + fi.Extension;
//          var fNamePAth = fName + newfilename;

            return(Ok(new { newfilename }));

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
            }
        }
コード例 #17
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 OrganizationType = new OrganizationTypeCreateGet();
                OrganizationType = await CreateAddDropDownBoxes(OrganizationType, CurrentUser.Id);

                //var UserLanguage = await _masterProvider.UserLanguageUpdateGet(CurrentUser.Id);
                //OrganizationTypeCreateGet.LanguageId = UserLanguage.LanguageId;
                //OrganizationTypeCreateGet.LanguageName = UserLanguage.Name;
                return(Ok(OrganizationType));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #18
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 PersonTelecom = new PersonTelecomCreateGet();
                PersonTelecom.TelecomTypes = await _telecomTypeProvider.List(CurrentUser.Id);

                PersonTelecom = await CreateAddDropDownBoxes(PersonTelecom, CurrentUser.Id, PersonTelecom.PersonId);

                PersonTelecom.PersonId = Id;
                return(Ok(PersonTelecom));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #19
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 ContentTypeProperty = new ObjectTypePropertyCreateGet();
                ContentTypeProperty.ObjectTypeId = Id;
                ContentTypeProperty = await CreateAddDropDownBoxes(ContentTypeProperty, CurrentUser.Id);

                return(Ok(ContentTypeProperty));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #20
0
        public async Task <IActionResult> Create(int Id, [FromQuery(Name = "MetaTypeId")] int MetaTypeId)
        {
            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 MetaContent = new MetaContentCreateGet();
                MetaContent.MetaTypeId   = MetaTypeId;
                MetaContent.MetaRecordId = Id;
                MetaContent = await CreateAddDropDownBoxes(MetaContent, CurrentUser.Id, Id, MetaTypeId);

                return(Ok(MetaContent));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #21
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 OrganizationPosition = new OrganizationPositionCreateGet();
                OrganizationPosition.OrganizationName = await _organizationPositionProvider.CreateGet(CurrentUser.Id, Id);

                OrganizationPosition = await CreateAddDropDownBoxes(OrganizationPosition, CurrentUser.Id, Id);

                return(Ok(OrganizationPosition));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #22
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 ProjectTypeMatrix = new ProjectTypeMatrixCreateGet();
                ProjectTypeMatrix.FromProjectTypeId   = Id;
                ProjectTypeMatrix.FromProjectTypeName = await _projectTypeProvider.ReturnName(CurrentUser.Id, Id);

                ProjectTypeMatrix = await CreateAddDropDownBoxes(ProjectTypeMatrix, CurrentUser.Id);

                return(Ok(ProjectTypeMatrix));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #23
0
        public async Task <IActionResult> Dashboard(int Id)
        {
            SIPUserManager SIPUser     = new SIPUserManager(_hostingEnvironment, _userManager);
            var            CurrentUser = await SIPUser.GetUser(User);

//            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 Organization = new FrontOrganizationDashboard();
                Organization = await _frontOrganizationProvider.Dashboard(CurrentUser.Id, Id);

                var subOrganization = await _frontOrganizationProvider.DashboardSubOrganization(CurrentUser.Id, Id);

                var Content = await _frontOrganizationProvider.DashboardContent(CurrentUser.Id, Id);

                var Process = await _frontOrganizationProvider.DashboardProcess(CurrentUser.Id, Id);

                var PersonRoles = await _frontOrganizationProvider.DashboardPersonRoles(CurrentUser.Id, Id);

                var PersonPositions = await _frontOrganizationProvider.DashboardPersonPositions(CurrentUser.Id, Id);

                var Address = await _frontOrganizationProvider.DashboardAddress(CurrentUser.Id, Id);

                var Telecom = await _frontOrganizationProvider.DashboardTelecom(CurrentUser.Id, Id);

                Organization.SubOrganizations = subOrganization;
                Organization.Contents         = Content;
                Organization.Processes        = Process;
                Organization.PersonRoles      = PersonRoles;
                Organization.PersonPositions  = PersonPositions;
                Organization.Addresses        = Address;
                Organization.Telecoms         = Telecom;
                //      var x= await _frontOrganizationProvider.IndexGetSubOrganizationTree(CurrentUser.Id, Id);
                //    Organization.SubOrganizationTree = JObject.Parse(x);

                return(Ok(Organization));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #24
0
        public async Task <IActionResult> Global(string Contains)
        {
            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 CheckString = await _personProvider.CreatePostCheck(Person);
                //if (CheckString.Length == 0)
                //{
                var ResultPost = new SearchGlobalPost();
                ResultPost.ClassificationValues = await _classificationValueProvider.Search(Contains, CurrentUser.Id);

                ResultPost.Contents = await _contentProvider.Search(Contains, CurrentUser.Id);

                ResultPost.Organizations = await _organizationProvider.Search(Contains, CurrentUser.Id);

                ResultPost.Persons = await _personProvider.Search(Contains, CurrentUser.Id);

                ResultPost.Processes = await _processProvider.Search(Contains, CurrentUser.Id);

                ResultPost.Projects = await _projectProvider.Search(Contains, CurrentUser.Id);

                ResultPost.Page = await _searchProvider.GlobalPostPage(CurrentUser.Id);

                ResultPost.Page.PageSections = await _searchProvider.GlobalPostPageSection(CurrentUser.Id, ResultPost.Page.PageId);

                var RowPosition    = 0;
                var AddRowPosition = 0;
                foreach (var x in ResultPost.Page.PageSections)
                {
                    x.DashboardRow = AddRowPosition;
                    if (x.PageSectionDataTypeId == 1)
                    {
                        if (ResultPost.Contents.Count > 5)
                        {
                            x.SizeY        = 3;
                            AddRowPosition = +3;
                        }
                        else
                        {
                            x.SizeY        = 2;
                            AddRowPosition = +2;
                        }
                    }
                    if (x.PageSectionDataTypeId == 2)
                    {
                        if (ResultPost.Processes.Count > 5)
                        {
                            x.SizeY        = 3;
                            AddRowPosition = +3;
                        }
                        else
                        {
                            x.SizeY        = 2;
                            AddRowPosition = +2;
                        }
                    }
                    if (x.PageSectionDataTypeId == 3)
                    {
                        if (ResultPost.Organizations.Count > 5)
                        {
                            x.SizeY        = 3;
                            AddRowPosition = +3;
                        }
                        else
                        {
                            x.SizeY        = 2;
                            AddRowPosition = +2;
                        }
                    }
                    if (x.PageSectionDataTypeId == 4)
                    {
                        if (ResultPost.Persons.Count > 5)
                        {
                            x.SizeY        = 3;
                            AddRowPosition = +3;
                        }
                        else
                        {
                            x.SizeY        = 2;
                            AddRowPosition = +2;
                        }
                    }
                    if (x.PageSectionDataTypeId == 5)
                    {
                        if (ResultPost.Projects.Count > 5)
                        {
                            x.SizeY        = 3;
                            AddRowPosition = +3;
                        }
                        else
                        {
                            x.SizeY        = 2;
                            AddRowPosition = +2;
                        }
                    }
                    if (x.PageSectionDataTypeId == 7)
                    {
                        if (ResultPost.ClassificationValues.Count > 5)
                        {
                            x.SizeY        = 3;
                            AddRowPosition = +3;
                        }
                        else
                        {
                            x.SizeY        = 2;
                            AddRowPosition = +2;
                        }
                    }
                }
                return(Ok(ResultPost));

                //}
                return(BadRequest(new
                {
                    IsSuccess = false,
                    //Message = CheckString,
                }));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #25
0
        public async Task <IActionResult> Index(int Id)
        {
            SIPUserManager SIPUser     = new SIPUserManager(_hostingEnvironment, _userManager);
            var            CurrentUser = await SIPUser.GetUser(User);

//            var CurrentUser = await _userManager.GetUserAsync(User);
            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                if (Id == 0)
                {
                    var PageOfUser = await _frontUserPreferenceProvider.GetOnePreference(CurrentUser.Id, 2); //2 is to get the preference of the homepage

                    Id = PageOfUser.IntPreference;
                }
                var dashboard = await _frontProvider.FrontIndexGetDashboard(CurrentUser.Id, Id);

                var panels = await _frontProvider.FrontIndexPanels(CurrentUser.Id, Id);

                var FrontPanels = new FrontPanels(_classificationValueProvider, _contentProvider, _processProvider, _organizationProvider, _personProvider, _projectProvider);
                foreach (var panel in panels)
                {
                    switch (panel.PageSectionTypeId)
                    {
                    case 1:     //List (TYPE)
                        switch (panel.PageSectionDataTypeId)
                        {
                        case 1:        //Content (DATA TYPE)
                                       //                                    string ContentConditionSQLFrom =


                            //                                    " DECLARE @LanguageId int; " +
                            //                                    " SELECT @LanguageId = IntPreference " +
                            //                                    " FROM UserPreferences " +
                            //                                    " WHERE USerId = '" + CurrentUser.Id + "' " +
                            //                                    " AND UserPreferences.PreferenceTypeId = 1; " +
                            //                                    " SELECT Contents.ContentID " +
                            //    ", Contents.Title " +
                            //    ", Contents.Description " +
                            //    ", ISNULL(UserLanguage.Name, ISNULL(DefaultLanguage.Name, 'No name for this ContentType')) ContentTypeName " +
                            //    ", Creator.FirstName + ' ' + Creator.LastName CreatorName " +
                            //    ", Creator.PersonID CreatorID " +
                            //    ", Contents.CreatedDate " +
                            //    ", Modifier.FirstName + ' ' + Modifier.LastName ModifierName " +
                            //    ", Modifier.PersonId ModifierID " +
                            //    ", Contents.ModifiedDate " +
                            //    ", CONCAT('controlID', Contents.ContentId) ControlId " +
                            // " FROM Contents " +
                            // " JOIN ContentTypes " +
                            // " ON Contents.ContentTypeID = ContentTypes.ContentTypeID " +
                            //" LEFT JOIN(SELECT ContentTypeId, Name, Description, MenuName, MouseOver, ContentTypeLanguageID FROM ContentTypeLanguages WHERE LanguageId = @LanguageID) UserLanguage " +
                            //   " ON UserLanguage.ContentTypeID = ContentTypes.ContentTypeID " +
                            //" LEFT JOIN(SELECT ContentTypeId, Name, Description, MenuName, MouseOver, ContentTypeLanguageID FROM ContentTypeLanguages JOIN Settings ON ContentTypeLanguages.LanguageId = Settings.IntValue WHERE Settings.SettingId = 1) DefaultLanguage " +
                            //  " ON DefaultLanguage.ContentTypeId = ContentTypes.ContentTypeID " +
                            //" JOIN Persons Creator " +
                            //    " ON Creator.UserId = Contents.CreatorID " +
                            //" JOIN Persons Modifier " +
                            //    " ON Modifier.UserId = Contents.ModifierID "
                            //                                        ;
                            //                                    string ContentConditionSQLWhere = " WHERE 1=1 ";
                            //                                    string ContentConditionSQLContains = "";
                            //                                    var ContentConditions = await _contentProvider.ContentForPanelCondition(panel.PageSectionId);
                            //                                    foreach(var ContentCondition in ContentConditions)
                            //                                    {
                            //                                        switch(ContentCondition.PageSectionContentConditionTypeId)
                            //                                        {
                            //                                            case 1: // User
                            //                                                ContentConditionSQLWhere += "";
                            //                                                break;
                            //                                            case 2: // Contains
                            //                                                ContentConditionSQLContains += "";
                            //                                                break;

                            //                                            case 3: // Organization
                            //                                                ContentConditionSQLWhere += " AND Contents.OrganizationId = " + ContentCondition.PageSectionContentConditionInt + " ";
                            //                                                break;
                            //                                            case 4: // Project
                            //                                                ContentConditionSQLWhere += " AND Contents.ProjectId = " + ContentCondition.PageSectionContentConditionInt + " ";
                            //                                                break;
                            //                                            case 5: // Content type
                            //                                                ContentConditionSQLWhere += " AND Contents.ContentTypeId = " + ContentCondition.PageSectionContentConditionInt + " ";
                            //                                                break;
                            //                                            case 6: // Content status
                            //                                                ContentConditionSQLWhere += " AND Contents.ContentStatusId = " + ContentCondition.PageSectionContentConditionInt + " ";
                            //                                                break;
                            //                                            case 7: // Language
                            //                                                ContentConditionSQLWhere += " AND Contents.LanguageId = " + ContentCondition.PageSectionContentConditionInt + " ";
                            //                                                break;
                            //                                            case 8: // Security level
                            //                                                ContentConditionSQLWhere += " AND Contents.SecurityLevelId = " + ContentCondition.PageSectionContentConditionInt + " ";
                            //                                                break;
                            //                                            case 9: // Creator
                            //                                                ContentConditionSQLWhere += " AND Contents.CreatorId = '" + ContentCondition.PageSectionContentConditionString + "' ";
                            //                                                break;
                            //                                            case 10: // Modifier
                            //                                                ContentConditionSQLWhere += " AND Contents.ModifierId = '" + ContentCondition.PageSectionContentConditionString + "' ";
                            //                                                break;
                            //                                            case 11: // ClassificationValue
                            //                                                ContentConditionSQLWhere += " AND Contents.ContentId IN (SELECT CotentId FROM ContentClassificationValues WHERE ClassificationValueId = " + ContentCondition.PageSectionContentConditionInt+ ") ";
                            //                                                break;
                            //                                            case 12: // Created from date
                            //                                                ContentConditionSQLWhere += " AND Contents.CreatedDate > '" + ContentCondition.PageSectionContentConditionDate + "' ";
                            //                                                break;
                            //                                            case 13: // Created to date
                            //                                                ContentConditionSQLWhere += " AND Contents.CreatedDate < '" + ContentCondition.PageSectionContentConditionDate + "' ";
                            //                                                break;
                            //                                            case 14: // Created from date
                            //                                                ContentConditionSQLWhere += " AND Contents.ModifiedDate > '" + ContentCondition.PageSectionContentConditionDate + "' ";
                            //                                                break;
                            //                                            case 15: // Created to date
                            //                                                ContentConditionSQLWhere += " AND Contents.ModifiedDate < '" + ContentCondition.PageSectionContentConditionDate + "' ";
                            //                                                break;

                            //                                        }
                            //                                    }
                            //                                    var ContentList = await _contentProvider.ContentForPanel( ContentConditionSQLFrom, ContentConditionSQLWhere, ContentConditionSQLContains);
                            //                                    panel.Contents = ContentList;
                            panel.Contents = await FrontPanels.ContentList(CurrentUser, panel.PageSectionId);

                            break;

                        case 2:         //Pocess (DATA TYPE) List (Type)

                            //string ProcessConditionSQLFrom = " SELECT Processes.ProcessId, ISNULL(ProcessFieldSubject.StringValue,'') As Subject, ProcessTypeLanguages.Name ProcessTypeName FROM Processes JOIN ProcessFields ProcessFieldSubject ON ProcessFieldSubject.ProcessId = Processes.ProcessId " +
                            //    " JOIN ProcessTypefields ProcessTypeFieldSubject ON  ProcessTypeFieldSubject.ProcessTypefieldId = ProcessFieldSubject.ProcessTypefieldId  " +
                            //    " JOIN ProcessTypes ON Processes.ProcessTypeId =  ProcessTypes.ProcessTypeId JOIN ProcessTypeStages ON Processes.ProcessTypeStageId = ProcessTypeStages.ProcessTypeStageID ";
                            //string ProcessConditionSQLWhere = " WHERE ProcessTypeFieldSubject.ProcessTypeFieldTypeId = 1 AND ProcessTypeStages.InToDo = 1 ";
                            //string ProcessConditionSQLContains = "";
                            //var ProcessConditions = await _processProvider.ProcessForPanelCondition(panel.PageSectionId);
                            //foreach (var ProcessCondition in ProcessConditions)
                            //{
                            //    switch (ProcessCondition.PageSectionProcessConditionTypeId)
                            //    {
                            //        case 1: // Template
                            //            ProcessConditionSQLWhere += " AND TemplateId = " + ProcessCondition.PageSectionProcessConditionInt;
                            //            break;
                            //        case 2: // Template group
                            //            ProcessConditionSQLFrom += " JOIN ProcessTypeGroups ON ProcessTypes.ProcessTypeGroupId = ProcessTypeGroups.ProcessTypeGroupId ";
                            //            ProcessConditionSQLWhere += " AND ProcessTypeGroups.TemplateGroupId = " + ProcessCondition.PageSectionProcessConditionInt;
                            //            break;

                            //        case 3: // My calendar
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldMyCalendar ON Processes.ProcessId = ProcessFieldMyCalendar.ProcessId JOIN ProcessTypeFields ProcessTypeFieldMyCalendar ON ProcessTypeFieldMyCalendar.ProcessTypeFieldId = ProcessFieldMyCalendar.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessTypes.ShowInPersonalCalendar = 1 AND ProcessFieldMyCalendar.StringValue = '" + CurrentUser.Id  + "' AND ProcessTypeFieldMyCalendar.ProcessTypefieldTypeId = 12 ";
                            //            break;
                            //        case 4: // Personal calendar
                            //            ProcessConditionSQLWhere += " AND ProcessTypes.ShowInPersonalCalendar = 1 ";
                            //            break;
                            //        case 5: // Organization calendar
                            //            ProcessConditionSQLWhere += " AND ProcessTypes.ShowInOrganizationCalendar = 1 ";
                            //            break;
                            //        case 6: // Project calendar
                            //            ProcessConditionSQLWhere += " AND ProcessTypes.ShowInProjectCalendar = 1 ";
                            //            break;
                            //        case 7: // Event calendar
                            //            ProcessConditionSQLWhere += " AND ProcessTypes.ShowInEventCalendar = 1 ";
                            //            break;
                            //        case 8: // Is personal
                            //            ProcessConditionSQLWhere += " AND ProcessTypes.IsPersonal = 1 " ;
                            //            break;
                            //        case 9: // Show new
                            //            ProcessConditionSQLWhere += " AND ProcessTypes.ShowInNew = 1 ";
                            //            break;
                            //        case 10: // Show search
                            //            ProcessConditionSQLWhere += " AND ProcessTypes.ShowInSearch = 1 ";
                            //            break;
                            //        case 11: // show report
                            //            ProcessConditionSQLWhere += " AND ProcessTypes.ShowInReport = 1 ";
                            //            break;
                            //        case 12: // Organization
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldOrganization ON Processes.ProcessId = ProcessFieldOrganization.ProcessId  JOIN ProcessTypeFields ProcessTypeFieldOrganization ON ProcessTypeFieldOrganization.ProcessTypeFieldId = ProcessFieldOrganization.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldOrganization.IntValue = " + ProcessCondition.PageSectionProcessConditionInt + " AND (ProcessTypeFieldOrganization.ProcessTypefieldTypeId = 14 OR ProcessTypeFieldOrganization.ProcessTypefieldTypeId = 15 ) ";
                            //            break;
                            //        case 13: // Project
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldProject ON Processes.ProcessId = ProcessFieldProject.ProcessId JOIN ProcessTypeFields ProcessTypeFieldProject ON ProcessTypeFieldProject.ProcessTypeFieldId = ProcessFieldProject.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldProject.IntValue = " + ProcessCondition.PageSectionProcessConditionInt + "' AND (ProcessTypeFieldProject.ProcessTypefieldTypeId = 16 OR ProcessTypeFieldProject.ProcessTypefieldTypeId = 17) ";
                            //            break;
                            //        case 14: // creator is user
                            //            ProcessConditionSQLWhere += " AND Processes.CreatorId = '" + CurrentUser.Id + "' ";
                            //            break;
                            //        case 15: // role
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldRole ON Processes.ProcessId = ProcessFieldRole.ProcessId JOIN ProcessTypeFields ProcessTypeFieldRole ON ProcessTypeFieldRole.ProcessTypeFieldId = ProcessFieldRole.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldRole.stringValue = '" + ProcessCondition.PageSectionProcessConditionString + "' AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 30 ";
                            //            break;
                            //        case 16: // securitylevel
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldSecurityLevel ON Processes.ProcessId = ProcessFieldSecurityLevel.ProcessId JOIN ProcessTypeFields ProcessTypeFieldSecurityLevel ON ProcessTypeFieldSecurityLevel.ProcessTypeFieldId = ProcessFieldSecurityLevel.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldSecurityLevel.IntValue <= '" + ProcessCondition.PageSectionProcessConditionInt + "' AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 28 ";
                            //            break;
                            //        case 18: // Default Organization
                            //            ProcessConditionSQLWhere += " AND ProcessFieldOrganization.IntValue = @DefaultOrganization AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 14 ";
                            //            break;
                            //        case 19: // UserOrganization
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldUserOrganization ON Processes.ProcessId = ProcessFieldUserOrganization.ProcessId JOIN ProcessTypeFields ProcessTypeFieldUserOrganization ON ProcessTypeFieldUserOrganization.ProcessTypeFieldId = ProcessFieldUserOrganization.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldUserOrganization.IntValue IN (SELECT OrganizationId FROM AspNetRoles JOIN AspNetUserRoles ON AspNetRoles.Id = AspNetUserRoles.RoleId WHERE UserId = '" + CurrentUser.Id + "') AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 14 ";
                            //            break;

                            //        case 20: // Specific Organization
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldOrganizationRole ON Processes.ProcessId = ProcessFieldOrganizationRole.ProcessId JOIN ProcessTypeFields ProcessTypeFieldOrganizationRole ON ProcessTypeFieldOrganizationRole.ProcessTypeFieldId = ProcessFieldOrganizationRole.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldOrganizationRole.StringValue = '" + ProcessCondition.PageSectionProcessConditionString + "' AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 30 ";
                            //            break;
                            //        case 21: // UserProject
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldUserProject ON Processes.ProcessId = ProcessFieldUserProject.ProcessId JOIN ProcessTypeFields ProcessTypeFieldUserProject ON ProcessTypeFieldUserProject.ProcessTypeFieldId = ProcessFieldUserProject.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldUserProject.IntValue IN (SELECT ProjectId FROM AspNetRoles JOIN AspNetUserRoles ON AspNetRoles.Id = AspNetUserRoles.RoleId WHERE UserId = '" + CurrentUser.Id + "') AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 16 ";
                            //            break;

                            //        case 22: // Specific project
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldProjectRole ON Processes.ProcessId = ProcessFieldProjectRole.ProcessId JOIN ProcessTypeFields ProcessTypeFieldProjectRole ON ProcessFieldProjectRole.ProcessTypeFieldId = ProcessTypeFieldProjectRole.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldProjectRole.StringValue = '" + ProcessCondition.PageSectionProcessConditionString + "' AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 30 ";
                            //            break;

                            //        case 25: // Content
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldContent ON Processes.ProcessId = ProcessFieldContent.ProcessId JOIN ProcessTypeFields ProcessTypeFieldContent ON ProcessFieldContent.ProcessTypeFieldId = ProcessTypeFieldContent.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldContent.IntValue = " + ProcessCondition.PageSectionProcessConditionInt + " AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 24  ";
                            //            break;

                            //        case 26: // Content type
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldContentType ON Processes.ProcessId = ProcessFieldContentType.ProcessId JOIN ProcessTypeFields ProcessTypeFieldContentType ON ProcessFieldContentType.ProcessTypeFieldId = ProcessTypeFieldContentType.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldContentType.IntValue IN (SELECT ContentId FROM Contents WHERE ContentTypeID = " + ProcessCondition.PageSectionProcessConditionInt + ") AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 24  ";
                            //            break;
                            //        case 27: // User is user
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldUserIsUser ON Processes.ProcessId = ProcessFieldUserIsUser.ProcessId JOIN ProcessTypeFields ProcessTypeFieldUserIsUser ON ProcessFieldUserIsUser.ProcessTypeFieldId = ProcessTypeFieldUserIsUser.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldUserIsUser.StringValue = '" + ProcessCondition.PageSectionProcessConditionString + "' AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 12  ";
                            //            break;
                            //        case 32: // From date
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldFromDate ON Processes.ProcessId = ProcessFieldFromDate.ProcessId JOIN ProcessTypeFields ProcessTypeFieldFromDate ON ProcessFieldFromDate.ProcessTypeFieldId = ProcessTypeFieldFromDate.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldFromDate.DateTimeValue >= '" + ProcessCondition.PageSectionProcessConditionDate + "' AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 4  ";
                            //            //PETER TO DO the date time and date time range and date range
                            //            break;
                            //        case 33: // To date
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldToDate ON Processes.ProcessId = ProcessFieldToDate.ProcessId JOIN ProcessTypeFields ProcessTypeFieldToDate ON ProcessFieldToDate.ProcessTypeFieldId = ProcessTypeFieldToDate.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldToDate.DateTimeValue <= '" + ProcessCondition.PageSectionProcessConditionDate + "' AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 4  ";
                            //            break;
                            //        case 37: // Person
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldPerson ON Processes.ProcessId = ProcessFieldPerson.ProcessId JOIN ProcessTypeFields ProcessTypeFieldPerson ON ProcessFieldPerson.ProcessTypeFieldId = ProcessTypeFieldPerson.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldPerson.IntValue = " + ProcessCondition.PageSectionProcessConditionInt + " AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 36 ";
                            //            break;
                            //        case 38: // Content type group
                            //            ProcessConditionSQLFrom += " JOIN ProcessFields ProcessFieldContentTypeGroup ON Processes.ProcessId = ProcessFieldContentTypeGroup.ProcessId JOIN ProcessTypeFields ProcessTypeFieldContentTypeGroup ON ProcessFieldContentTypeGroup.ProcessTypeFieldId = ProcessTypeFieldContentTypeGroup.ProcessTypeFieldId ";
                            //            ProcessConditionSQLWhere += " AND ProcessFieldContentTypeGroup.IntValue IN (SELECT ContentId FROM Contents JOIN ContentTypes ON Contents.ContentTypeId = ContentTypes.ContentTypeId WHERE ContentTypeGroupID = " + ProcessCondition.PageSectionProcessConditionInt + ") AND ProcessTypeFieldUser.ProcessTypefieldTypeId = 24 ";
                            //            break;

                            //    }
                            //}
                            //var ProcessList = await _processProvider.ProcessForPanel(CurrentUser.Id, ProcessConditionSQLFrom, ProcessConditionSQLWhere, ProcessConditionSQLContains);
                            //panel.Processes = ProcessList;
                            panel.Processes = await FrontPanels.ProcessList(CurrentUser, panel.PageSectionId);

                            break;

                        case 3:         //Organizatio (DATA TYPE) List (Type)
                            panel.Organizations = await FrontPanels.OrganizationList(CurrentUser, panel.PageSectionId);

                            break;

                        case 4:         //Person (DATA TYPE) List (Type)
                            panel.Persons = await FrontPanels.PersonList(CurrentUser, panel.PageSectionId);

                            break;

                        case 5:         //Project (DATA TYPE) List (Type)
                            panel.Projects = await FrontPanels.ProjectList(CurrentUser, panel.PageSectionId);

                            break;

                        case 6:         //Favorites (DATA TYPE) List (Type)
                            //PETER TODO Add this functionality
                            break;

                        case 7:         //Classification (DATA TYPE) List (Type)
                            panel.ClassificationValues = await FrontPanels.ClassificationValueList(CurrentUser, panel.PageSectionId);

                            break;
                        }
                        break;

                    case 2:     //Index only classification (TYPE)
                        break;

                    case 3:     //Chat not yet (TYPE)
                        break;

                    case 4:     //Personal canendar (TYPE)
                        var PersonalCalendar = await _frontProvider.FrontIndexPersonalCalendar(CurrentUser.Id);

                        panel.PersonalCalendars = PersonalCalendar;
                        break;

                    case 5:     //Organization calendar (TYPE)
                        var OrganizationCalendar = await _frontProvider.FrontIndexOrganizationCalendar(CurrentUser.Id);

                        panel.OrganizationCalendars = OrganizationCalendar;
                        break;

                    case 6:     //Project calendar (TYPE)
                        var ProjectCalendar = await _frontProvider.FrontIndexProjectCalendar(CurrentUser.Id);

                        panel.ProjectCalendars = ProjectCalendar;
                        break;

                    case 7:     //Platform calendar (TYPE)
                        var EventCalendar = await _frontProvider.FrontIndexEventCalendar();

                        panel.EventCalendars = EventCalendar;
                        break;

                    case 8:     //General calendar (TYPE)
                        break;

                    case 9:     //to do

                        var todo = new FrontProcessToDoLogic(_projectProvider, _organizationProvider, _userRoleProvider, _roleProvider, _userProvider, _processProvider, _frontProcessProvider);

                        panel.ToDos = await todo.ReturnProcessList(CurrentUser);

                        break;
                    }
                }
                dashboard.Panels = panels;
                return(Ok(dashboard));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #26
0
        public async Task <IActionResult> ContentType()
        {
            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 ContentTypeGroups = await _frontContentProvider.ContentTypeContentTypeGroup(CurrentUser.Id);

                foreach (var ContentTypeGroup in ContentTypeGroups)
                {
                    ContentTypeGroup.ContentTypes = await _frontContentProvider.ContentType(CurrentUser.Id, ContentTypeGroup.ContentTypeGroupId);
                }
                return(Ok(ContentTypeGroups));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
コード例 #27
0
        public async Task <IActionResult> Index(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 project = new FrontProjectIndexGet();
                project = await _frontProjectProvider.IndexGet(CurrentUser.Id, Id);

                var subproject = await _frontProjectProvider.IndexGetSubProject(CurrentUser.Id, Id);

                var Content = await _frontProjectProvider.IndexGetContent(CurrentUser.Id, Id);

                var Process = await _frontProjectProvider.IndexGetProcess(CurrentUser.Id, Id);

                var Member = await _frontProjectProvider.IndexGetMember(CurrentUser.Id, Id);

                project.SubProjects = subproject;
                project.Contents    = Content;
                project.Processes   = Process;
                project.Members     = Member;
                //      var x= await _frontProjectProvider.IndexGetSubProjectTree(CurrentUser.Id, Id);
                //         project.SubProjectTree = JObject.Parse(x);

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