Пример #1
0
        public IActionResult DeleteTaxIntegration(string code)
        {
            if (string.IsNullOrWhiteSpace(code))
            {
                return(Ok(new APIResponse()
                {
                    status = APIStatus.PASS.ToString(), response = $"{nameof(code)} cannot be null"
                }));
            }

            try
            {
                TaxIntegration result = GLHelper.DeleteTaxIntegration(code);
                if (result != null)
                {
                    return(Ok(new APIResponse()
                    {
                        status = APIStatus.PASS.ToString(), response = result
                    }));
                }

                return(Ok(new APIResponse()
                {
                    status = APIStatus.FAIL.ToString(), response = "Deletion failed."
                }));
            }
            catch (Exception ex)
            {
                return(Ok(new APIResponse()
                {
                    status = APIStatus.FAIL.ToString(), response = ex.Message
                }));
            }
        }