コード例 #1
0
        public bool UpdatePost(ProcessTypeGroupUpdateGet ProcessTypeGroup)
        {
            string usp = "usp_ProcessTypeGroupUpdatePost @ProcessTypeGroupId, @Sequence, @Name, @Description, @MenuName, @MouseOver, @UserId";

            _sqlDataAccess.SaveData <ProcessTypeGroupUpdateGet>(usp, ProcessTypeGroup);
            return(true);
        }
コード例 #2
0
        public async Task <List <ErrorMessage> > UpdatePostCheck(ProcessTypeGroupUpdateGet ProcessTypeGroup)
        {
            string usp           = "usp_ProcessTypeGroupUpdatePostCheck @ProcessTypeGroupId, @Sequence, @Name, @Description, @MenuName, @MouseOver, @UserId";
            var    ErrorMessages = await _sqlDataAccess.LoadData <ErrorMessage, dynamic>(usp, ProcessTypeGroup);

            return(ErrorMessages);
        }
コード例 #3
0
        private async Task <ProcessTypeGroupUpdateGet> UpdateAddDropDownBoxes(ProcessTypeGroupUpdateGet ProcessTypeGroup, string UserId)
        {
            var Sequences = await _processTypeGroupProvider.UpdateGetSequence(UserId);

            ProcessTypeGroup.Sequences = Sequences;
            return(ProcessTypeGroup);
        }
コード例 #4
0
        public async Task <IActionResult> Update(ProcessTypeGroupUpdateGet ProcessTypeGroup)
        {
            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 _processTypeGroupProvider.UpdatePostCheck(ProcessTypeGroup);

                if (ErrorMessages.Count > 0)
                {
                    ProcessTypeGroup = await UpdateAddDropDownBoxes(ProcessTypeGroup, CurrentUser.Id);
                }
                else
                {
                    _processTypeGroupProvider.UpdatePost(ProcessTypeGroup);
                }
                ProcessTypeGroupUpdateGetWithErrorMessages ProcessTypeGroupWithErrorMessage = new ProcessTypeGroupUpdateGetWithErrorMessages {
                    ProcessTypeGroup = ProcessTypeGroup, ErrorMessages = ErrorMessages
                };
                return(Ok(ProcessTypeGroupWithErrorMessage));
            }
            ErrorMessages = await _checkProvider.NoRightsMessage(CurrentUser.Id);

            ProcessTypeGroupUpdateGetWithErrorMessages ProcessTypeGroupWithNoRights = new ProcessTypeGroupUpdateGetWithErrorMessages {
                ProcessTypeGroup = ProcessTypeGroup, ErrorMessages = ErrorMessages
            };

            return(Ok(ProcessTypeGroupWithNoRights));
        }
コード例 #5
0
        public async Task <IActionResult> Edit(ProcessTypeGroupUpdateGet ProcessTypeGroup)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var ProcessTypeGroupUpdateGetWithErrorMessage = await _client.PostProtectedAsync <ProcessTypeGroupUpdateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/ProcessTypeGroup/Update", ProcessTypeGroup, token);

            if (ProcessTypeGroupUpdateGetWithErrorMessage.ErrorMessages.Count > 0)
            {
                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/ProcessTypeGroup/Edit", token);

                ViewBag.Env = _hostingEnv.EnvironmentName;

                ViewBag.ErrorMessages = ProcessTypeGroupUpdateGetWithErrorMessage.ErrorMessages;
                return(View(ProcessTypeGroupUpdateGetWithErrorMessage.ProcessTypeGroup));
            }

            return(RedirectToAction("Index"));
        }