protected override void GetFormSourceData(long oid)
        {
            Examen examen = Examen.Get(oid, true);

            string[] preguntas = examen.MemoPreguntas.Split(';');

            //se genera la lista de preguntas del examen con la que se va a trabajar
            foreach (string item in preguntas)
            {
                try
                {
                    long            oid_pregunta = Convert.ToInt32(item);
                    Pregunta_Examen p_examen     = Pregunta_Examen.NewChild(examen);
                    p_examen.OidPregunta = oid_pregunta;
                    examen.Pregunta_Examens.AddItem(p_examen);
                }
                catch
                {
                    continue;
                }
            }

            _entity = examen.GetInfo(true);
            examen.CloseSession();
            _mf_type = ManagerFormType.MFView;
        }
Exemplo n.º 2
0
        protected override void GetFormSourceData(long oid)
        {
            _entity = Examen.Get(oid);

            string[] preguntas = _entity.MemoPreguntas.Split(';');

            //se genera la lista de preguntas del examen con la que se va a trabajar
            foreach (string item in preguntas)
            {
                try
                {
                    if (item != string.Empty)
                    {
                        long            oid_pregunta = Convert.ToInt32(item);
                        Pregunta_Examen p_examen     = Pregunta_Examen.NewChild(_entity);
                        p_examen.OidPregunta = oid_pregunta;
                        _entity.Pregunta_Examens.AddItem(p_examen);
                    }
                }
                catch
                {
                    continue;
                }
            }

            _entity.BeginEdit();
            _mf_type = ManagerFormType.MFEdit;
        }
Exemplo n.º 3
0
        /// <summary>Duplica un objeto y abre el formulario para editar item
        /// <returns>void</returns>
        /// </summary>
        public override void CopyObjectAction(long oid)
        {
            try
            {
                Examen new_item = Examen.Duplicate(oid);

                if (new_item != null)
                {
                    ExamenAddForm add_form = new ExamenAddForm(new_item);
                    AddForm(add_form);

                    if (add_form.ActionResult == DialogResult.OK)
                    {
                        PgMng.Reset(3, 1, Resources.Messages.LOADING_DATA, this);

                        new_item = Examen.Get(add_form.Entity.Oid);
                        bool no_disponibles = new_item.DuplicateList(oid);
                        PgMng.Grow();

                        new_item.Save();
                        new_item.CloseSession();
                        PgMng.Grow();

                        if (no_disponibles)
                        {
                            PgMng.ShowInfoException(Resources.Messages.EXAMEN_DUPLICADO_CON_PREGUNTAS_NO_DISPONIBLES);
                        }

                        PgMng.FillUp();

                        ExamenEditForm form = new ExamenEditForm(new_item.Oid);
                        AddForm(form);
                    }
                }
            }
            catch (iQException ex)
            {
                MessageBox.Show(ex.Message,
                                moleQule.Face.Resources.Labels.ERROR_TITLE,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
            }
            catch (Csla.DataPortalException ex)
            {
                MessageBox.Show(iQExceptionHandler.GetiQException(ex).Message,
                                moleQule.Face.Resources.Labels.ERROR_TITLE,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(),
                                moleQule.Face.Resources.Labels.ERROR_TITLE,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
            }

            RefreshList();
        }
Exemplo n.º 4
0
 protected override void GetFormSourceData(long oid)
 {
     _entity = Examen.Get(oid, true);
     _entity.BeginEdit();
     _mf_type = ManagerFormType.MFEdit;
 }