public ActionResult AddEventCategory() { var parentCategories = EventsService.GetAllParentEventCategories(); ViewData["ParentCategories_SL"] = new SelectList(parentCategories.AsEnumerable().Select((item, index) => new SelectListItem() { Text = item.EventCategoryName, Value = item.EventCategoryID.ToString() }).ToList <SelectListItem>(), "Value", "Text"); return(View()); }
public ActionResult AddEvent() { using (ArgaamAnalyticsDataContext aadc = new ArgaamAnalyticsDataContext()) { var eventCatSLI = EventsService.GetAllParentEventCategories().AsEnumerable().Select((item, index) => new SelectListItem() { Value = item.EventCategoryID.ToString(), Text = item.EventCategoryName }).ToList(); ViewData["parentEventCategories_SL"] = new SelectList(eventCatSLI, "Value", "Text"); ViewData["companies_SL"] = new SelectList(FintechService.GetStockEntities(1).AsEnumerable().Select((item, index) => new SelectListItem() { Value = item.StockEntityID.ToString(), Text = item.NameEn }), "Value", "Text"); } return(View()); }