コード例 #1
0
        public async Task <IActionResult> Edit(ObjectTypePropertyUpdateGet ProjectTypeProperty)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var ProjectTypePropertyUpdateGetWithErrorMessage = await _client.PostProtectedAsync <ObjectTypePropertyUpdateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/ProjectTypeProperty/Update", ProjectTypeProperty, token);

            if (ProjectTypePropertyUpdateGetWithErrorMessage.ErrorMessages.Count > 0)
            {
                var AllStuff = await _loadViewBagModel.ViewBagLoad(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), token, _hostingEnv.EnvironmentName, _configuration, false, 0, "");

                AllStuff.ErrorMessages = ProjectTypePropertyUpdateGetWithErrorMessage.ErrorMessages;
                ViewBag.AllStuff       = AllStuff;
                //ViewBag.Favorites = await _client.GetProtectedAsync<List<MVCFavoriteMenu>>($"{_configuration["APIUrl"]}api/MVCFavorite/Menu", token);
                //ViewBag.FavoriteGroupList = await _client.GetProtectedAsync<List<MVCFavoriteGroupList>>($"{_configuration["APIUrl"]}api/MVCFavorite/GroupList", token);
                //ViewBag.UITerms = await _client.GetProtectedAsync<List<UITermLanguageCustomizationList>>($"{_configuration["APIUrl"]}api/MVC/ProjectTypeProperty/Edit", token);
                //ViewBag.Env = _hostingEnv.EnvironmentName;

                //ViewBag.ErrorMessages = ProjectTypePropertyUpdateGetWithErrorMessage.ErrorMessages;
                return(View(ProjectTypePropertyUpdateGetWithErrorMessage.ObjectTypeProperty));
            }

            return(RedirectToAction("Index", new { id = ProjectTypeProperty.ObjectTypeId }));
        }
コード例 #2
0
        public async Task <IActionResult> Update(ObjectTypePropertyUpdateGet ContentTypeProperty)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var ErrorMessages = new List <ErrorMessage>();

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                ErrorMessages = await _contentTypePropertyProvider.UpdatePostCheck(ContentTypeProperty);

                if (ErrorMessages.Count > 0)
                {
                    ContentTypeProperty = await UpdateAddDropDownBoxes(ContentTypeProperty, CurrentUser.Id);
                }
                else
                {
                    _contentTypePropertyProvider.UpdatePost(ContentTypeProperty);
                }
                ObjectTypePropertyUpdateGetWithErrorMessages ContentTypePropertyWithErrorMessage = new ObjectTypePropertyUpdateGetWithErrorMessages {
                    ObjectTypeProperty = ContentTypeProperty, ErrorMessages = ErrorMessages
                };
                return(Ok(ContentTypePropertyWithErrorMessage));
            }
            ErrorMessages = await _checkProvider.NoRightsMessage(CurrentUser.Id);

            ObjectTypePropertyUpdateGetWithErrorMessages ContentTypePropertyWithNoRights = new ObjectTypePropertyUpdateGetWithErrorMessages {
                ObjectTypeProperty = ContentTypeProperty, ErrorMessages = ErrorMessages
            };

            return(Ok(ContentTypePropertyWithNoRights));
        }
コード例 #3
0
        public bool UpdatePost(ObjectTypePropertyUpdateGet PersonTypeProperty)
        {
            string usp = "usp_PersonTypePropertyUpdatePost @PersonTypePropertyId ,  @PropertyId, @PersonTypePropertyStatusId, @UserId ";

            _sqlDataAccess.SaveData <ObjectTypePropertyUpdateGet>(usp, PersonTypeProperty);
            return(true);
        }
コード例 #4
0
        public async Task <List <ErrorMessage> > UpdatePostCheck(ObjectTypePropertyUpdateGet PersonTypeProperty)
        {
            string usp           = "usp_PersonTypePropertyUpdatePostCheck @PersonTypePropertyId , @PropertyId, @PersonTypePropertyStatusId, @UserId ";
            var    ErrorMessages = await _sqlDataAccess.LoadData <ErrorMessage, dynamic>(usp, PersonTypeProperty);

            return(ErrorMessages);
        }
コード例 #5
0
        private async Task <ObjectTypePropertyUpdateGet> UpdateAddDropDownBoxes(ObjectTypePropertyUpdateGet ContentTypeProperty, string UserId)
        {
            ContentTypeProperty.Statuses = await _objectTypePropertyStatus.List(UserId);

            ContentTypeProperty.Properties = await _propertyProvider.List(UserId);

            ContentTypeProperty.ObjectTypeName = await _contentTypeProvider.ReturnName(UserId, ContentTypeProperty.ObjectTypeId);

            return(ContentTypeProperty);
        }
コード例 #6
0
        private async Task <ObjectTypePropertyUpdateGet> UpdateAddDropDownBoxes(ObjectTypePropertyUpdateGet OrganizationTypeProperty, string UserId)
        {
            OrganizationTypeProperty.Statuses = await _objectTypePropertyStatus.List(UserId);

            OrganizationTypeProperty.Properties = await _propertyProvider.List(UserId);

            OrganizationTypeProperty.ObjectTypeName = await _organizationTypeProvider.ReturnName(UserId, OrganizationTypeProperty.ObjectTypeId);

            return(OrganizationTypeProperty);
        }