Example #1
0
        public JsonResult GetActiveCurrency(string term)
        {
            List <AutoCompleteTextBox> autoCompleteTextBox = new List <AutoCompleteTextBox>();

            if (term == "%")
            {
                autoCompleteTextBox.Add(new AutoCompleteTextBox {
                    label = "%", value = "%"
                });
            }
            else
            {
                CurrencyGetReq objCurrencyGetReq = new CurrencyGetReq();
                if (term.Length >= 2 && term.Substring(0, 2) == "##")
                {
                    term = "";
                }
                objCurrencyGetReq.CurrencyUnit = term;
                SalesProviders objSalesProvider  = new SalesProviders(_configuration);
                CurrencyGetRes objCurrencyGetRes = objSalesProvider.GetActiveCurrencyList(objCurrencyGetReq, token).Result;
                autoCompleteTextBox = objCurrencyGetRes.Currency.Select(c => new AutoCompleteTextBox {
                    value = c.CurrencyCode, label = c.CurrencyCode
                }).ToList();
            }

            if (autoCompleteTextBox != null && autoCompleteTextBox.Count > 0)
            {
                return(Json(autoCompleteTextBox));
            }
            else
            {
                return(Json(""));
            }
        }
Example #2
0
        public async Task <CurrencyGetRes> GetActiveCurrencyList(CurrencyGetReq objCurrencyGetReq, string ticket)
        {
            CurrencyGetRes objCurrencyGetRes = new CurrencyGetRes();

            objCurrencyGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceDeparture:GetActiveCurrencyList"), objCurrencyGetReq, typeof(CurrencyGetRes), ticket);

            return(objCurrencyGetRes);
        }