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

                Project = await UpdateAddDropDownBoxes(Project, CurrentUser.Id);

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