public async Task <IActionResult> Delete(ProcessTypeFlowDeleteGet ProcessTypeFlow)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                // ProcessTypeFlow.CreatorId = CurrentUser.Id;
                //var CheckString = await _ProcessTypeFlowProvider.DeletePostCheck(ProcessTypeFlow);
                //if (CheckString.Length == 0)
                //{
                _processTypeFlowProvider.DeletePost(CurrentUser.Id, ProcessTypeFlow.ProcessTypeFlowId);
                return(Ok(ProcessTypeFlow));

                //}
                return(BadRequest(new
                {
                    IsSuccess = false,
                    //Message = CheckString,
                }));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Exemple #2
0
        public async Task <IActionResult> Delete(ProcessTypeFlowDeleteGet ProcessTypeFlow)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            await _client.PostProtectedAsync <ProcessTypeFlowDeleteGet>($"{_configuration["APIUrl"]}api/ProcessTypeFlow/Delete", ProcessTypeFlow, token);

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