public ActionResult Index() { List <VenueDto> models = _venueService.GetAllVenue().OrderBy(u => u.Lenght + u.Weidth).Reverse().ToList(); return(View(models)); }
private List <SelectListItem> GetVenueLayoutNames() { List <VenueDto> venues = _venueService.GetAllVenue(); List <TMLayoutDto> layouts = _tmlayoutService.GetAllTMLayout(); List <TMLayoutVenueViewModel> layoutsView = new List <TMLayoutVenueViewModel>(); foreach (var item in venues) { layouts.Where(l => l.VenueId == item.Id).ToList().ForEach(l => { layoutsView.Add(new TMLayoutVenueViewModel { TMLayout = l, VenueName = item.Description }); }); } CultureInfo cultures = CultureInfo.CreateSpecificCulture("en-US"); var items = new List <SelectListItem>(); layoutsView.ForEach(l => items.Add(new SelectListItem { Text = l.VenueName + "--" + l.TMLayout.Description, Value = l.TMLayout.Id.ToString("G", cultures), })); return(items); }