Esempio n. 1
0
        public IEnumerable <SelectListItem> GetDropDownData(DropDownRequest request)
        {
            IEnumerable <SelectListItem> dropDownData = null;

            switch (request.Identifier)
            {
            case DropDownIdentifier.EXCHANGE:
            {
                dropDownData = MasterDataService.GetExchangeList(request);
                break;
            }

            case DropDownIdentifier.SYMBOL:
            {
                dropDownData = InMemoryObjects.ExchangeSymbolList.SingleOrDefault(x => x.Exchange == request.Exchange).Symbols.Select(x => new SelectListItem()
                    {
                        Text  = x.SymbolName.ToString(),
                        Value = ((int)x.Id).ToString()
                    }).ToList();

                break;
            }

            default:
            {
                dropDownData = null;
                break;
            }
            }

            return(dropDownData);
        }