Ejemplo n.º 1
0
        private void DataPortal_Delete(CriteriaCs criterio)
        {
            try
            {
                //Iniciamos la conexion y la transaccion
                SessionCode = OpenSession();
                BeginTransaction();

                CriteriaEx criteria = GetCriteria();
                criteria.AddOidSearch(criterio.Oid);

                // Obtenemos el objeto
                ExamenRecord obj = (ExamenRecord)(criteria.UniqueResult());
                Session().Delete(Session().Get <ExamenRecord>(obj.Oid));

                Transaction().Commit();
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
            finally
            {
                CloseSession();
            }
        }
Ejemplo n.º 2
0
 protected override void DataPortal_Update()
 {
     if (IsDirty)
     {
         try
         {
             ExamenRecord obj = Session().Get <ExamenRecord>(Oid);
             obj.CopyValues(this.Base.Record);
             Session().Update(obj);
         }
         catch (Exception ex)
         {
             iQExceptionHandler.TreatException(ex);
         }
     }
 }
Ejemplo n.º 3
0
        public virtual void CopyValues(ExamenRecord source)
        {
            if (source == null)
            {
                return;
            }

            Oid             = source.Oid;
            _oid_promocion  = source.OidPromocion;
            _oid_profesor   = source.OidProfesor;
            _oid_modulo     = source.OidModulo;
            _fecha_examen   = source.FechaExamen;
            _fecha_creacion = source.FechaCreacion;
            _fecha_emision  = source.FechaEmision;
            _tipo           = source.Tipo;
            _desarrollo     = source.Desarrollo;
            _titulo         = source.Titulo;
            _duracion       = source.Duracion;
            _memo_preguntas = source.MemoPreguntas;
            _numero         = source.Numero;
        }
Ejemplo n.º 4
0
        internal void Update(Instructor parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            //Debe obtener la sesion del padre pq el objeto es padre a su vez
            SessionCode = parent.SessionCode;

            OidProfesor = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                ExamenRecord obj = parent.Session().Get <ExamenRecord>(Oid);
                obj.CopyValues(this.Base.Record);
                parent.Session().Update(obj);

                _preguntas.Update(this);
                _preguntaexamens.Update(this);
                _alumnos.Update(this);
                _promociones.Update(this);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }