private void PrepararListas() { try { Application.Current.Dispatcher.Invoke((System.Action)(delegate { try { if (LstMotivo == null) { LstMotivo = new ObservableCollection <TRASLADO_MOTIVO>(new cTrasladoMotivo().ObtenerTodos()); LstMotivo.Insert(0, new TRASLADO_MOTIVO() { ID_MOTIVO = -1, DESCR = "SELECCIONE" }); } if (LstCentro == null) { LstCentro = new ObservableCollection <CENTRO>(new cCentro().ObtenerTodos()); LstCentro.Insert(0, new CENTRO() { ID_CENTRO = -1, DESCR = "SELECCIONE" }); } id_motivo_traslado = Convert.ToInt16(new cParametro().Seleccionar("MOTIVO_TRASLADO", 0).First().VALOR_NUM); if (id_motivo_traslado.HasValue) { MotivoSalida = new cTrasladoMotivoSalida().Obtener(id_motivo_traslado.Value).DESCR; } //id_autoridad_traslado = Autoridad_Traslado = new cParametro().Seleccionar("AUTORIDAD_TRASLADO", 0).First().VALOR; AutoridadesSalida.Add(new cCentro().Obtener(GlobalVar.gCentro).First().DIRECTOR); AutoridadesSalida.Add(new cParametro().Seleccionar("DIR_JURIDICO_CENTRO", GlobalVar.gCentro).First().VALOR); AutoridadesSalida.Add(new cParametro().Seleccionar("SUBDIR_JURIDICO_CENTRO", GlobalVar.gCentro).First().VALOR); AutoridadesSalida.Add("SELECCIONE"); FechaServer = Fechas.GetFechaDateServer; Tipos_Traslado = new List <Tipo_Traslado> { new Tipo_Traslado("LO", "LOCAL"), new Tipo_Traslado("LF", "FORANEO"), new Tipo_Traslado("T", "TODOS") }; } catch (Exception ex) { StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al consultar internos.", ex); } })); } catch (Exception ex) { StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al consultar internos.", ex); } }