private void Producto_BT_Click(object sender, EventArgs e) { PromocionSelectForm form = new PromocionSelectForm(this); if (form.ShowDialog() == DialogResult.OK) { _promocion = form.Selected as PromocionInfo; Promocion_TB.Text = _promocion.Nombre; } }
private void Promocion_BT_Click(object sender, EventArgs e) { if (promociones == null) { return; } if (this is ExamenViewForm) { return; } try { PromocionSelectForm form = new PromocionSelectForm(this, promociones); if (form.ShowDialog(this) == DialogResult.OK) { if (form.Selected is PromocionInfo) { PromocionInfo info = form.Selected as PromocionInfo; ExamenPromocion item = Entity.Promociones.GetItem(new FCriteria <long>("OidPromocion", info.Oid)); if (item == null) { ExamenPromocion nuevo = Entity.Promociones.NewItem(Entity); nuevo.OidPromocion = info.Oid; } } else if (form.Selected is SortedBindingList <PromocionInfo> ) { SortedBindingList <PromocionInfo> promos = form.Selected as SortedBindingList <PromocionInfo>; foreach (PromocionInfo info in promos) { ExamenPromocion item = Entity.Promociones.GetItem(new FCriteria <long>("OidPromocion", info.Oid)); if (item == null) { ExamenPromocion nuevo = Entity.Promociones.NewItem(Entity); nuevo.OidPromocion = info.Oid; } } } RellenaPromociones(); } } catch { throw new iQException("Promocion_BT_Click"); } }
private void Promocion_BT_Click(object sender, EventArgs e) { PromocionList lista_promociones = PromocionList.GetList(false); if (_promociones_todas.Count == 0) { foreach (PromocionInfo info in lista_promociones) { _promociones_todas.Add(info.Numero + " - " + info.Nombre, info); } } PromocionSelectForm form = new PromocionSelectForm(this, lista_promociones); if (form.ShowDialog(this) == DialogResult.OK) { if (form.Selected is PromocionInfo) { PromocionInfo info = form.Selected as PromocionInfo; if (!_promociones.ContainsKey(info.Numero + " - " + info.Nombre)) { _promociones.Add(info.Numero + " - " + info.Nombre, info); } } else if (form.Selected is SortedBindingList <PromocionInfo> ) { SortedBindingList <PromocionInfo> promociones = form.Selected as SortedBindingList <PromocionInfo>; foreach (PromocionInfo info in promociones) { if (!_promociones.ContainsKey(info.Numero + " - " + info.Nombre)) { _promociones.Add(info.Numero + " - " + info.Nombre, info); } } } Promociones_CLB.Items.Clear(); foreach (KeyValuePair <string, PromocionInfo> item in _promociones) { Promociones_CLB.Items.Add(item.Key, true); } } }
/// <summary> /// Abre un nuevo manager para la entidad. Si no está abierto, lo crea, y si /// lo está, lo muestra /// </summary> /// <param name="formID">Identificador del formulario que queremos abrir</param> /// <param name="param">Parámetro para el formulario</param> public void OpenForm(string formID, object[] parameters, Form parent) { try { switch (formID) { // FORMULARIOS GENERALES case AlumnoMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(AlumnoMngForm.Type)) { AlumnoMngForm em = new AlumnoMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case AlumnosAdmitidosExamenActionForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(AlumnosAdmitidosExamenActionForm.Type)) { AlumnosAdmitidosExamenActionForm em = new AlumnosAdmitidosExamenActionForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case CronogramaMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(CronogramaMngForm.Type)) { CronogramaMngForm em = new CronogramaMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case CursoMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(CursoMngForm.Type)) { CursoMngForm em = new CursoMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case DiasNoLectivosForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(DiasNoLectivosForm.Type)) { DiasNoLectivosForm em = new DiasNoLectivosForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case DisponibilidadAddForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(DisponibilidadAddForm.Type)) { EntityMngForm mng = new EntityMngForm(); mng.AddForm(new DisponibilidadAddForm()); } } break; case ExamenMngForm.ID: { if (FormMngBase.Instance.BuscarFormulario(PreguntaMngForm.Type)) { foreach (Form form in MainBaseForm.Instance.MdiChildren) { if (form is PreguntaMngForm) { form.Close(); } } } if (!FormMngBase.Instance.BuscarFormulario(ExamenMngForm.Type)) { ExamenMngForm em = new ExamenMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case FaltasAlumnosMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(FaltasAlumnosMngForm.Type)) { FaltasAlumnosMngForm em = new FaltasAlumnosMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case RegistroFaltasAlumnosMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(RegistroFaltasAlumnosMngForm.Type)) { RegistroFaltasAlumnosMngForm em = new RegistroFaltasAlumnosMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case NotasPracticasMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(NotasPracticasMngForm.Type)) { long oid_promocion = 0; PromocionSelectForm form = new PromocionSelectForm(); form.ShowDialog(); oid_promocion = (form.Selected as PromocionInfo).Oid; if (oid_promocion > 0) { NotasPracticasMngForm em = new NotasPracticasMngForm(oid_promocion, parent); FormMngBase.Instance.ShowFormulario(em); } } } break; case HorarioMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(HorarioMngForm.Type)) { HorarioMngForm em = new HorarioMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case InstructorMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(InstructorMngForm.Type)) { InstructorMngForm em = new InstructorMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case InstructoresPromocionViewForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(InstructoresPromocionViewForm.Type)) { InstructoresPromocionViewForm em = new InstructoresPromocionViewForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case MaterialMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(MaterialMngForm.Type)) { MaterialMngForm em = new MaterialMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case ModuloMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(ModuloMngForm.Type)) { ModuloMngForm em = new ModuloMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case ParteAsistenciaMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(ParteAsistenciaMngForm.Type)) { ParteAsistenciaMngForm em = new ParteAsistenciaMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case PlanEstudiosMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(PlanEstudiosMngForm.Type)) { PlanEstudiosMngForm em = new PlanEstudiosMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case PlanExtraMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(PlanExtraMngForm.Type)) { PlanExtraMngForm em = new PlanExtraMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case PreguntaMngForm.ID: { if (FormMngBase.Instance.BuscarFormulario(ExamenMngForm.Type)) { foreach (Form form in MainBaseForm.Instance.MdiChildren) { if (form is ExamenMngForm) { form.Close(); } } } if (!FormMngBase.Instance.BuscarFormulario(PreguntaMngForm.Type)) { PreguntaMngForm em = new PreguntaMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case PromocionMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(PromocionMngForm.Type)) { PromocionMngForm em = new PromocionMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case PlantillaMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(PlantillaMngForm.Type)) { PlantillaMngForm em = new PlantillaMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case DuplicarPreguntasTemaActionForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(DuplicarPreguntasTemaActionForm.Type)) { DuplicarPreguntasTemaActionForm em = new DuplicarPreguntasTemaActionForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case FormularioNotasPracticasMngForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(FormularioNotasPracticasMngForm.Type)) { FormularioNotasPracticasMngForm em = new FormularioNotasPracticasMngForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; case DisponibilidadSemanalForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(DisponibilidadSemanalForm.Type)) { DisponibilidadSemanalForm em = new DisponibilidadSemanalForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; // FORMULARIOS DE INFORMES case MatriculasActionForm.ID: { if (!FormMngBase.Instance.BuscarFormulario(MatriculasActionForm.Type)) { MatriculasActionForm em = new MatriculasActionForm(parent); FormMngBase.Instance.ShowFormulario(em); } } break; default: { throw new iQImplementationException(string.Format(moleQule.Face.Resources.Messages.FORM_NOT_FOUND, formID), string.Empty); } } } catch (iQImplementationException ex) { throw ex; } catch (Exception ex) { MessageBox.Show(iQExceptionHandler.GetAllMessages(ex), Application.ProductName); } }