예제 #1
0
        public async Task <IActionResult> Delete(OrganizationTelecomDeleteGet OrganizationTelecom)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                OrganizationTelecom.UserId = CurrentUser.Id;
                //var CheckString = await _OrganizationTelecomProvider.DeletePostCheck(OrganizationTelecom);
                //if (CheckString.Length == 0)
                //{
                _organizationTelecomProvider.DeletePost(CurrentUser.Id, OrganizationTelecom.OrganizationTelecomId);
                return(Ok(OrganizationTelecom));

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

            return(RedirectToAction("Dashboard", "FrontOrganization", new { id = OrganizationTelecom.OrganizationId }));
        }