示例#1
0
        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());
        }
示例#2
0
        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());
        }