Esempio n. 1
0
        public ActionResult GetGearbox()
        {
            List <SelectListItem> items = new List <SelectListItem>();

            foreach (var model in Enum.GetValues(typeof(Gearbox)))
            {
                var name = Gearbox.GetName(typeof(Gearbox), model);
                items.Add(new SelectListItem()
                {
                    Text = name, Value = ((int)model).ToString()
                });
            }

            return(Json(items, JsonRequestBehavior.AllowGet));
        }