Exemplo n.º 1
0
        /// <summary>
        /// Gets the translation data for.
        /// </summary>
        /// <param name="cityNodeId">The city node identifier.</param>
        /// <returns>The list of <see cref="TranslationViewModel"/>.</returns>
        public static List<TranslationViewModel> GetTranslationDatasFor(IRoadsService client, long cityNodeId)
        {
            var leng = GetLanguages(client);

                var lenguages = new SelectList(leng.Select(s =>
                new SelectListItem
                {
                    Value = s.LanguageId.ToString(CultureInfo.InvariantCulture),
                    Text = s.Name,
                    Selected = s.IsDefault
                }), "Value", "Text", leng.First(e => e.IsDefault).LanguageId);

                return client.GetMapObjectTranslationDataFor(cityNodeId).Select(s => new TranslationViewModel
                {
                    ObjectId = s.MapObjectId,
                    LanguageKey = s.LanguageKey,
                    Value = s.Value,
                    LanguageId = s.LanguageId,
                    Languages = lenguages

                }).ToList();
        }