コード例 #1
0
        void CargarDatos()
        {
            var x = new ObservableCollection <VISITA_DIA>(new cVisitaDia().ObtenerTodos().OrderBy(o => o.ID_DIA == 7 ? 2 : 1).ToList());

            ListVisitaDiaFiltro = new RangeEnabledObservableCollection <VISITA_DIA>();
            ListVisitaDia       = x;
            ListTipoVisita      = new ObservableCollection <TIPO_VISITA>(new cTipoVisita().ObtenerTodos());
            ListAreas           = new ObservableCollection <AREA>(new cArea().ObtenerTodos());
            ListLetras          = new ObservableCollection <string>(new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" });
            Application.Current.Dispatcher.Invoke((Action)(delegate
            {
                ListAreas.Add(new AREA {
                    ID_AREA = -1, DESCR = "SELECCIONE"
                });
                SelectArea = -1;
                ListVisitaDia.Add(new VISITA_DIA {
                    ID_DIA = -1, DESCR = "SELECCIONE"
                });
                ListVisitaDiaFiltro.Add(new VISITA_DIA {
                    ID_DIA = -1, DESCR = "TODOS"
                });
                ListVisitaDiaFiltro.InsertRange(x);
                ListTipoVisita.Insert(0, new TIPO_VISITA {
                    ID_TIPO_VISITA = -1, DESCR = "SELECCIONE"
                });
                //ListLetras.Insert(0, string.Empty);
                SelectLetraInicial = SelectLetraFinal = string.Empty;
                SelectTipoVisita = SelectFechaFiltro = -1;
                SelectDiaVisita = 1;
            }));
        }