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

//                var u = await _classificationProvider.CreateGetSequence(CurrentUser.Id);
                var Statuses = await _masterListProvider.StatusList(CurrentUser.Id);

                var projectTypes = await _projectTypeProvider.List(CurrentUser.Id);

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

                Project.Statuses = Statuses;
                //      Project.ProjectTypes = projectTypes;

                Project.SecurityLevels = SecurityLevels;
                return(Ok(Project));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Esempio n. 2
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",
                    }));
                }
                //PETER TODO this is organization why is tehre classification here?
                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",
            }));
        }
Esempio n. 3
0
        private async Task <OrganizationCreateGet> CreateAddDropDownBoxes(OrganizationCreateGet Organization, string UserId, int?ParentId = null)
        {
            var Statuses = await _masterListProvider.StatusList(UserId);

            var OrganizationTypes = await _organizationTypeProvider.List(UserId);

            var UserLanguage = await _masterProvider.UserLanguageUpdateGet(UserId);

            Organization.LanguageId           = UserLanguage.LanguageId;
            Organization.LanguageName         = UserLanguage.Name;
            Organization.OrganizationTypes    = OrganizationTypes;
            Organization.Statuses             = Statuses;
            Organization.ParentOrganizationId = ParentId;
            return(Organization);
        }
        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> 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("ClassificationValues", "ClassificationValueID", Id) == 0)
                {
                    return(BadRequest(new
                    {
                        IsSuccess = false,
                        Message = "No record with this ID",
                    }));
                }
                var x = await _classificationValueProvider.UpdateGet(CurrentUser.Id, Id);

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

                return(Ok(x));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Esempio n. 6
0
        private async Task <ClassificationCreateGet> CreateAddDropDownBoxes(ClassificationCreateGet Classification, string UserId)
        {
            var ClassificationCreateGetSequences = await _classificationProvider.CreateGetSequence(UserId);

            var Statuses = await _masterListProvider.StatusList(UserId);

            var icons = await _masterListProvider.IconList(UserId);

            var UserLanguage = await _masterProvider.UserLanguageUpdateGet(UserId);

            Classification.LanguageId   = UserLanguage.LanguageId;
            Classification.LanguageName = UserLanguage.Name;
            Classification.Icons        = icons;
            Classification.Statuses     = Statuses;
            Classification.Sequences    = ClassificationCreateGetSequences;
            Classification.Sequences.Add(new SequenceList {
                Sequence = ClassificationCreateGetSequences.Count + 1, Name = "Add at the end"
            });
            return(Classification);
        }
Esempio n. 7
0
        private async Task <ProjectCreateGet> CreateAddDropDownBoxes(ProjectCreateGet Project, string UserId, int ParentId = 0)
        {
            var Statuses = await _masterListProvider.StatusList(UserId);

            var UserLanguage = await _masterProvider.UserLanguageUpdateGet(UserId);

            var SecurityLevels = await _securityLevelProvider.List(UserId);

            Project.LanguageId     = UserLanguage.LanguageId;
            Project.LanguageName   = UserLanguage.Name;
            Project.Statuses       = Statuses;
            Project.SecurityLevels = SecurityLevels;
            Project.CodeTypeId     = await _projectTypeProvider.ReturnCodeTypeId(Project.ProjectTypeId);

            Project.ProjectTypeName = await _projectTypeProvider.ReturnName(UserId, Project.ProjectTypeId);

            Project.ParentProjectName = await _projectProvider.ReturnName(UserId, ParentId);

            return(Project);
        }
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);
        }
Esempio n. 9
0
        public async Task <IActionResult> Update(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                var x = await _languageProvider.UpdateGet(CurrentUser.Id, Id);

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

                return(Ok(x));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
        private async Task <ContentTypeGroupCreateGet> CreateAddDropDownBoxes(ContentTypeGroupCreateGet ContentTypeGroup, string UserId)
        {
            var ContentTypeGroupCreateGetSequences = await _contentTypeGroupProvider.CreateGetSequence(UserId);

            var Statuses = await _masterListProvider.StatusList(UserId);

            var icons = await _masterListProvider.IconList(UserId);

            var UserLanguage = await _masterProvider.UserLanguageUpdateGet(UserId);

            ContentTypeGroup.LanguageId   = UserLanguage.LanguageId;
            ContentTypeGroup.LanguageName = UserLanguage.Name;
            ContentTypeGroup.Sequences    = ContentTypeGroupCreateGetSequences;
            ContentTypeGroup.Sequences.Add(new SequenceList {
                Sequence = ContentTypeGroupCreateGetSequences.Count + 1, Name = "Add at the end"
            });
            return(ContentTypeGroup);
        }