private void FillMovieTheaterList(string m, ref string f) { List<String> theaterNameList = new List<String>(); List<KeyValue> l = new List<KeyValue>(); int movieId = Convert.ToInt32(m); var movieListFiltered = (from it in movieList orderby it.nameFull where it.id == movieId select it ).ToList<MovieLookup>(); l.Add(new KeyValue() { key = "-1", value = "- SELECCIONE -" }); foreach (var mv in movieListFiltered) { // Locations foreach (var loc in mv.locations) { if (!theaterNameList.Contains(loc.nameFull)) { KeyValue kv = new KeyValue() { key = loc.id.ToString(), value = loc.nameFull }; l.Add(kv); } } } var movieTheaterSorted = (from it in l orderby it.value select it).ToList<KeyValue>(); movieTheater.DataSource = movieTheaterSorted; movieTheater.DataTextField = "value"; movieTheater.DataValueField = "key"; try { movieTheater.SelectedValue = f; movieTheater.DataBind(); } catch (Exception) { f = "-1"; } }
private void FillMovieFormatList(string m,ref string t) { List<String> formatNameList = new List<String>(); List<KeyValue> l = new List<KeyValue>(); int movieId = Convert.ToInt32(m); var movieListFiltered = (from it in movieList orderby it.nameFull where it.id == movieId select it ).ToList<MovieLookup>(); l.Add(new KeyValue() { key = "-1", value = "- SELECCIONE -" }); foreach (var mv in movieListFiltered) { if (!formatNameList.Contains(mv.format)) { KeyValue kv = new KeyValue() { key = mv.idFormat.ToString(), value = mv.format }; l.Add(kv); } } var movieFormatSorted = (from it in l orderby it.value select it).ToList<KeyValue>(); movieFormat.DataSource = movieFormatSorted; movieFormat.DataTextField = "value"; movieFormat.DataValueField = "key"; try { movieFormat.SelectedValue = t; movieFormat.DataBind(); } catch (Exception) { t = "-1"; } }