public async Task <List <ErrorMessage> > UpdatePostCheck(PageSectionContentConditionUpdateGet PageSectionContentCondition)
        {
            string usp           = "usp_PageSectionUpdateConditionPostCheck @PageId, @Sequence, @PageSectionTypeId, @PageSectionDataTypeId, @@OneTwoColumns, @ContentTypeId, @SortById, @LanguageId, @Name, @CreatorId ";
            var    ErrorMessages = await _sqlDataAccess.LoadData <ErrorMessage, dynamic>(usp, PageSectionContentCondition);

            return(ErrorMessages);
        }
        public bool UpdatePost(PageSectionContentConditionUpdateGet PageSectionContentCondition)
        {
            string usp = "usp_PageSectionContentConditionUpdatePost @PageSectionContentConditionId, @PageSectionContentConditionTypeId, @PageSectionContentConditionInt, @PageSectionContentConditionDate, @PageSectionContentConditionString, @Name, @Description, @MenuName , @MouseOver, @UserId ";

            _sqlDataAccess.SaveData <PageSectionContentConditionUpdateGet>(usp, PageSectionContentCondition);
            return(true);
        }
示例#3
0
        public async Task <IActionResult> Edit(PageSectionContentConditionUpdateGet PageSectionContentCondition)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var ContentTypeUpdateGetWithErrorMessage = await _client.PostProtectedAsync <ContentTypeUpdateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/ContentType/Update", PageSectionContentCondition, token);

            if (ContentTypeUpdateGetWithErrorMessage.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 = ContentTypeUpdateGetWithErrorMessage.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/ContentType/Edit", token);
                //ViewBag.Env = _hostingEnv.EnvironmentName;

                //ViewBag.ErrorMessages = ContentTypeUpdateGetWithErrorMessage.ErrorMessages;
                return(View(ContentTypeUpdateGetWithErrorMessage.ContentType));
            }

            return(RedirectToAction("Index", new { id = PageSectionContentCondition.PageSectionId }));
        }
 private async Task <PageSectionContentConditionUpdateGet> UpdateAddDropDownBoxes(PageSectionContentConditionUpdateGet PageSectionContentCondition, string UserId)
 {
     return(PageSectionContentCondition);
 }
        public async Task <IActionResult> Update(PageSectionContentConditionUpdateGet PageSectionContentCondition)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                PageSectionContentCondition.UserId = CurrentUser.Id;
                //var CheckString = await _PageSectionProvider.UpdatePostCheck(PageSection);
                //if (CheckString.Length == 0)
                //{
                PageSectionContentCondition.PageSectionContentConditionTypeId = int.Parse(PageSectionContentCondition.PageSectionContentConditionTypeIdExtended.Substring(1));


                PageSectionContentCondition.PageSectionContentConditionDate = DateTime.Now;
                if (PageSectionContentCondition.PageSectionContentConditionTypeIdExtended.Substring(0, 1) == "V")
                {
                    PageSectionContentCondition.PageSectionContentConditionInt    = PageSectionContentCondition.Classifications.Find(x => x.ClassificationId == int.Parse(PageSectionContentCondition.PageSectionContentConditionTypeIdExtended.Substring(1))).ClassificationValueId;
                    PageSectionContentCondition.PageSectionContentConditionTypeId = 11;
                }
                else
                {
                    PageSectionContentCondition.PageSectionContentConditionTypeId = int.Parse(PageSectionContentCondition.PageSectionContentConditionTypeIdExtended.Substring(1));
                    switch (PageSectionContentCondition.PageSectionContentConditionTypeIdExtended)
                    {
                    case "T1":
                        PageSectionContentCondition.PageSectionContentConditionString = PageSectionContentCondition.UserId;
                        break;

                    case "T3":
                        PageSectionContentCondition.PageSectionContentConditionInt = PageSectionContentCondition.OrganizationId;
                        break;

                    case "T4":
                        PageSectionContentCondition.PageSectionContentConditionInt = PageSectionContentCondition.ProjectId;
                        break;

                    case "T5":
                        PageSectionContentCondition.PageSectionContentConditionInt = PageSectionContentCondition.ContentTypeId;
                        break;

                    case "T6":
                        PageSectionContentCondition.PageSectionContentConditionInt = PageSectionContentCondition.ContentStatusId;
                        break;

                    case "T7":
                        PageSectionContentCondition.PageSectionContentConditionInt = PageSectionContentCondition.LanguageId;
                        break;

                    case "T8":
                        PageSectionContentCondition.PageSectionContentConditionInt = PageSectionContentCondition.SecurityLevelId;
                        break;

                    case "T9":
                        PageSectionContentCondition.PageSectionContentConditionString = PageSectionContentCondition.SelectedCreatorId;
                        break;

                    case "T10":
                        PageSectionContentCondition.PageSectionContentConditionString = PageSectionContentCondition.SelectedModifierId;
                        break;

                    case "T12":
                        PageSectionContentCondition.PageSectionContentConditionDate = PageSectionContentCondition.CreatedFromDate;
                        break;

                    case "T13":
                        PageSectionContentCondition.PageSectionContentConditionDate = PageSectionContentCondition.CreatedToDate;
                        break;

                    case "T14":
                        PageSectionContentCondition.PageSectionContentConditionDate = PageSectionContentCondition.ModifiedFromDate;
                        break;

                    case "T15":
                        PageSectionContentCondition.PageSectionContentConditionDate = PageSectionContentCondition.ModifiedToDate;
                        break;
                    }
                }



                _pageSectionContentConditionProvider.UpdatePost(PageSectionContentCondition);
                return(Ok(PageSectionContentCondition));

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