public ActionResult CreateDynamicTranslation() { var model = new CreateTranslationViewModel(); RoadHelper.FillCreateTranslationViewModel(client, model); return View(model); }
public ActionResult CreateDynamicTranslation(CreateTranslationViewModel model) { return View(model); }
/// <summary> /// Fills the create translation view model. /// </summary> /// <param name="model">The model.</param> public static void FillCreateTranslationViewModel(IRoadsService client, CreateTranslationViewModel model) { 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); foreach (var l in lenguages) { model.Translations.Add(new TranslationViewModel { Languages = lenguages }); } }