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
                Instructor_PromocionRecord obj = (Instructor_PromocionRecord)(criteria.UniqueResult());
                Session().Delete(Session().Get <Instructor_PromocionRecord>(obj.Oid));

                Transaction().Commit();
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
            finally
            {
                CloseSession();
            }
        }
        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;

            OidInstructor = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

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

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

                _submodulos.Update(this);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
        public virtual void CopyValues(Instructor_PromocionRecord source)
        {
            if (source == null)
            {
                return;
            }

            Oid             = source.Oid;
            _oid_instructor = source.OidInstructor;
            _oid_promocion  = source.OidPromocion;
        }
 protected override void DataPortal_Update()
 {
     if (IsDirty)
     {
         try
         {
             Instructor_PromocionRecord obj = Session().Get <Instructor_PromocionRecord>(Oid);
             obj.CopyValues(this.Base.Record);
             Session().Update(obj);
         }
         catch (Exception ex)
         {
             iQExceptionHandler.TreatException(ex);
         }
     }
 }