public void AgregarMiembro() { try { int alabanzaMiembroId = registroMiembro.ObtenerId(); int instrumentoId = registroInstrumento.ObtenerId(); if (alabanzaMiembroId > 0 && instrumentoId > 0) { permitirAgregarEnsayos(false); AlabanzaMiembro alabanzaMiembro = (from o in SesionActual.Instance.getContexto <IglesiaEntities>().AlabanzaMiembro where o.Id == alabanzaMiembroId select o).SingleOrDefault(); AlabanzaTipoInstrumento instrumento = (from o in SesionActual.Instance.getContexto <IglesiaEntities>().AlabanzaTipoInstrumento where o.Id == instrumentoId select o).SingleOrDefault(); StoreMiembros.AddRecord(new { MiembroId = alabanzaMiembro.MiembroId, AlabanzaMiembroId = alabanzaMiembroId, Nombre = alabanzaMiembro.Miembro.NombreCompleto, InstrumentoId = instrumentoId, Instrumento = instrumento.Descripcion }); LimpiarVentanaDeMiembros(); X.Msg.Notify(Generales.nickNameDeLaApp, "Miembro agregadado correctamente").Show(); } else { throw new ExcepcionReglaNegocio("Favor de seleccionar algun miembro e instrumento validos."); } } catch (ExcepcionReglaNegocio ex) { X.Msg.Alert(Generales.nickNameDeLaApp, ex.Message).Show(); } }
void ICatalogo.CargarControles() { permitirAgregarEnsayos(false); // Ocultamos las columnas de asistencia/retraso registroMiembros.ColumnModel.SetHidden(3, true); registroMiembros.ColumnModel.SetHidden(4, true); StoreMiembros.Limpiar(); StoreCanciones.Limpiar(); StoreEnsayos.Limpiar(); StoreEnsayoMiembros.Limpiar(); StoreHorasDelDia.Cargar(HoraDia.Obtener()); StoreInstrumentos.Cargar(AlabanzaTipoInstrumento.Obtener()); }