示例#1
0
        public bool UpdatePost(ProcessTypeFlowUpdateGet ProcessTypeFlow)
        {
            string usp = "usp_ProcessTypeFlowUpdatePost @ProcessTypeFlowId , @ProcessTypeFromStageId ,@ProcessTypeToStageId, @Name, @Description, @MenuName, @MouseOver, @ModifierId";

            _sqlDataAccess.SaveData <ProcessTypeFlowUpdateGet>(usp, ProcessTypeFlow);
            return(true);
        }
示例#2
0
        public async Task <List <ErrorMessage> > UpdatePostCheck(ProcessTypeFlowUpdateGet ProcessTypeFlow)
        {
            string usp           = "usp_ProcessTypeFlowUpdatePostCheck @ProcessTypeFlowId , @ProcessTypeFromStageId ,@ProcessTypeToStageId, @Name, @Description, @MenuName, @MouseOver, @ModifierId";
            var    ErrorMessages = await _sqlDataAccess.LoadData <ErrorMessage, dynamic>(usp, ProcessTypeFlow);

            return(ErrorMessages);
        }
        public async Task <IActionResult> Update(ProcessTypeFlowUpdateGet ProcessTypeFlow)
        {
            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 _processTypeFlowProvider.UpdatePostCheck(ProcessTypeFlow);

                if (ErrorMessages.Count > 0)
                {
                    ProcessTypeFlow = await UpdateAddDropDownBoxes(ProcessTypeFlow, CurrentUser.Id, ProcessTypeFlow.ProcessTypeFlowId);
                }
                else
                {
                    _processTypeFlowProvider.UpdatePost(ProcessTypeFlow);
                }
                ProcessTypeFlowUpdateGetWithErrorMessages ProcessTypeFlowWithErrorMessage = new ProcessTypeFlowUpdateGetWithErrorMessages {
                    ProcessTypeFlow = ProcessTypeFlow, ErrorMessages = ErrorMessages
                };
                return(Ok(ProcessTypeFlowWithErrorMessage));
            }
            ErrorMessages = await _checkProvider.NoRightsMessage(CurrentUser.Id);

            ProcessTypeFlowUpdateGetWithErrorMessages ProcessTypeFlowWithNoRights = new ProcessTypeFlowUpdateGetWithErrorMessages {
                ProcessTypeFlow = ProcessTypeFlow, ErrorMessages = ErrorMessages
            };

            return(Ok(ProcessTypeFlowWithNoRights));
        }
        private async Task <ProcessTypeFlowUpdateGet> UpdateAddDropDownBoxes(ProcessTypeFlowUpdateGet ProcessTypeFlow, string UserId, int ProcessTypeFlowId)
        {
            var Stages = await _processTypeFlowProvider.UpdateGetStageList(UserId, ProcessTypeFlowId);

            ProcessTypeFlow.ProcessTypeStages = Stages;
            return(ProcessTypeFlow);
        }
示例#5
0
        public async Task <IActionResult> Edit(ProcessTypeFlowUpdateGet ProcessTypeFlow)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var ProcessTypeFlowUpdateGetWithErrorMessage = await _client.PostProtectedAsync <ProcessTypeFlowUpdateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/ProcessTypeFlow/Update", ProcessTypeFlow, token);

            if (ProcessTypeFlowUpdateGetWithErrorMessage.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/ProcessTypeFlow/Edit", token);

                ViewBag.Env = _hostingEnv.EnvironmentName;

                ViewBag.ErrorMessages = ProcessTypeFlowUpdateGetWithErrorMessage.ErrorMessages;
                return(View(ProcessTypeFlowUpdateGetWithErrorMessage.ProcessTypeFlow));
            }

            return(RedirectToAction("Index", new { id = ProcessTypeFlow.ProcessTypeId }));
        }