Пример #1
0
        public CheckTaxStateResponse CheckTax(string state)
        {
            CheckTaxStateResponse response = new CheckTaxStateResponse();
            List <Tax>            taxes    = _taxRepository.LoadFromTxt();

            foreach (Tax item in taxes)
            {
                if (state == item.StateAbbreviation)
                {
                    response.Message = "Success";
                    response.Success = true;
                    response.Tax     = item;
                    return(response);
                }
                else
                {
                    response.Message = "Invalid entry";
                    response.Success = false;
                }
            }
            return(response);
        }