Ejemplo n.º 1
0
        /// <summary>
        /// Called by the framework when the component needs to be rendered as HTML.
        /// </summary>
        /// <param name="model">The model being rendered by the component.</param>
        /// <returns>The component rendered as HTML.</returns>
        public async Task <string> RenderAsync(string model)
        {
            bool includeSiteCurrency = PropData.GetAdditionalAttributeValue <bool>("SiteCurrency", true);

            List <CurrencyISO4217.Currency> currencies = await CurrencyISO4217.GetCurrenciesAsync(IncludeSiteCurrency : includeSiteCurrency);

            List <SelectionItem <string> > list = (from l in currencies select new SelectionItem <string>()
            {
                Text = l.Name,
                Value = l.Id,
            }).ToList();

            list.Insert(0, new SelectionItem <string> {
                Text  = __ResStr("default", "(select)"),
                Value = "",
            });
            return(await DropDownListComponent.RenderDropDownListAsync(this, model, list, "yt_currencyiso4217"));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called by the framework when the component needs to be rendered as HTML.
        /// </summary>
        /// <param name="model">The model being rendered by the component.</param>
        /// <returns>The component rendered as HTML.</returns>
        public async Task <string> RenderAsync(string model)
        {
            string currency = await CurrencyISO4217.IdToCurrencyAsync(model, AllowMismatch : true);

            return(HE(currency));
        }