internal void Update(Instructor_Promocion parent)
        {
            this.RaiseListChangedEvents = false;

            // update (thus deleting) any deleted child objects
            foreach (Submodulo_Instructor_Promocion obj in DeletedList)
            {
                obj.DeleteSelf(parent);
            }

            // now that they are deleted, remove them from memory too
            DeletedList.Clear();

            // AddItem/update any current child objects
            foreach (Submodulo_Instructor_Promocion obj in this)
            {
                if (obj.OidPromocion != 0)
                {
                    if (obj.IsNew)
                    {
                        obj.Insert(parent);
                    }
                    else
                    {
                        obj.Update(parent);
                    }
                }
            }

            this.RaiseListChangedEvents = true;
        }
コード例 #2
0
        internal void DeleteSelf(Instructor_Promocion parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            // if we're new then don't update the database
            if (this.IsNew)
            {
                return;
            }

            try
            {
                parent.Session().Delete(parent.Session().Get <Submodulo_Instructor_PromocionRecord>(Oid));
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkNew();
        }
コード例 #3
0
        internal void Update(Instructor_Promocion parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            OidInstructorPromocion = parent.Oid;
            OidInstructor          = parent.OidInstructor;

            try
            {
                ValidationRules.CheckRules();

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

                Submodulo_Instructor_PromocionRecord obj = parent.Session().Get <Submodulo_Instructor_PromocionRecord>(Oid);
                obj.CopyValues(this.Base.Record);
                parent.Session().Update(obj);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
コード例 #4
0
        public void CopyValues(Instructor_Promocion source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);
        }
コード例 #5
0
        //  private Instructor_PromocionList() { }


        //public override Instructor_PromocionInfo GetItem(long oid_promocion)
        //{
        //    Instructor_PromocionInfo item = null;
        //    try { return (Instructor_PromocionInfo)HashList[oid_promocion]; }
        //    catch { return null; }
        //    //if (KeyValueList.TryGetValue(oid_promocion, out item))
        //    //    return item;
        //    //else return null;
        //    //return KeyValueList[oid_promocion];
        //}

        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <returns>Instructor_PromocionList</returns>
        public static Instructor_PromocionList GetList(bool childs)
        {
            CriteriaEx criteria = Instructor_Promocion.GetCriteria(Instructor_PromocionList.OpenSession());

            criteria.Childs = childs;

            //No criteria. Retrieve all de List
            Instructor_PromocionList list = DataPortal.Fetch <Instructor_PromocionList>(criteria);

            CloseSession(criteria.SessionCode);

            return(list);
        }
コード例 #6
0
        public static Submodulo_Instructor_Promocion NewChild(Instructor_Promocion parent)
        {
            if (!CanAddObject())
            {
                throw new System.Security.SecurityException(
                          moleQule.Library.Resources.Messages.USER_NOT_ALLOWED);
            }

            Submodulo_Instructor_Promocion obj = new Submodulo_Instructor_Promocion();

            obj.OidInstructorPromocion = parent.Oid;
            return(obj);
        }
コード例 #7
0
 public void CopyFrom(Instructor_Promocion source)
 {
     _base.CopyValues(source);
 }
 public Submodulo_Instructor_Promocion NewItem(Instructor_Promocion parent)
 {
     this.AddItem(Submodulo_Instructor_Promocion.NewChild(parent));
     return(this[Count - 1]);
 }