public bool UpdatePost(ContentTypeGroupUpdateGet ContentTypeGroup) { string usp = "usp_ContentTypeGroupUpdatePost @ContentTypeGroupId, @Sequence , @Name, @Description, @MenuName, @MouseOver, @UserId"; _sqlDataAccess.SaveData <ContentTypeGroupUpdateGet>(usp, ContentTypeGroup); return(true); }
public async Task <List <ErrorMessage> > UpdatePostCheck(ContentTypeGroupUpdateGet ContentTypeGroup) { string usp = "usp_ContentTypeGroupUpdatePostCheck @ContentTypeGroupId, @Sequence , @Name, @Description, @MenuName, @MouseOver, @UserId"; var ErrorMessages = await _sqlDataAccess.LoadData <ErrorMessage, dynamic>(usp, ContentTypeGroup); return(ErrorMessages); }
public async Task <IActionResult> Edit(ContentTypeGroupUpdateGet ContentTypeGroup) { var token = HttpContext.Session.GetString("Token"); if (token == null) { return(RedirectToAction("Login", "FrontAuth")); } var ContentTypeGroupUpdateGetWithErrorMessage = await _client.PostProtectedAsync <ContentTypeGroupUpdateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/ContentTypeGroup/Update", ContentTypeGroup, token); if (ContentTypeGroupUpdateGetWithErrorMessage.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 = ContentTypeGroupUpdateGetWithErrorMessage.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/ContentTypeGroup/Edit", token); //ViewBag.Env = _hostingEnv.EnvironmentName; //ViewBag.ErrorMessages = ContentTypeGroupUpdateGetWithErrorMessage.ErrorMessages; return(View(ContentTypeGroupUpdateGetWithErrorMessage.ContentTypeGroup)); } return(RedirectToAction("Index")); }
public async Task <IActionResult> Update(ContentTypeGroupUpdateGet ContentTypeGroup) { 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 _contentTypeGroupProvider.UpdatePostCheck(ContentTypeGroup); if (ErrorMessages.Count > 0) { ContentTypeGroup = await UpdateAddDropDownBoxes(ContentTypeGroup, CurrentUser.Id); } else { _contentTypeGroupProvider.UpdatePost(ContentTypeGroup); } ContentTypeGroupUpdateGetWithErrorMessages ContentTypeGroupWithErrorMessage = new ContentTypeGroupUpdateGetWithErrorMessages { ContentTypeGroup = ContentTypeGroup, ErrorMessages = ErrorMessages }; return(Ok(ContentTypeGroupWithErrorMessage)); } ErrorMessages = await _checkProvider.NoRightsMessage(CurrentUser.Id); ContentTypeGroupUpdateGetWithErrorMessages ContentTypeGroupWithNoRights = new ContentTypeGroupUpdateGetWithErrorMessages { ContentTypeGroup = ContentTypeGroup, ErrorMessages = ErrorMessages }; return(Ok(ContentTypeGroupWithNoRights)); }
private async Task <ContentTypeGroupUpdateGet> UpdateAddDropDownBoxes(ContentTypeGroupUpdateGet ContentTypeGroup, string UserId) { ContentTypeGroup.Sequences = await _contentTypeGroupProvider.CreateGetSequence(UserId); return(ContentTypeGroup); }