コード例 #1
0
        internal void DeleteSelf(PlanExtra 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
            {
                SessionCode = parent.SessionCode;
                Session().Delete(Session().Get <ClaseExtraRecord>(Oid));
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkNew();
        }
コード例 #2
0
        internal void Update(PlanExtra parent)
        {
            this.RaiseListChangedEvents = false;

            // update (thus deleting) any deleted child objects
            foreach (ClaseExtra 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 (ClaseExtra obj in this)
            {
                if (obj.OidModulo != 0 && obj.OidSubmodulo != 0)
                {
                    if (obj.IsNew)
                    {
                        obj.Insert(parent);
                    }
                    else
                    {
                        obj.Update(parent);
                    }
                }
            }

            this.RaiseListChangedEvents = true;
        }
コード例 #3
0
        internal void Update(PlanExtra 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;

            OidPlan = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

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

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

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

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

            _record.CopyValues(source.Base.Record);
        }
コード例 #5
0
        public static ClaseExtra NewChild(PlanExtra parent)
        {
            if (!CanAddObject())
            {
                throw new System.Security.SecurityException(
                          moleQule.Library.Resources.Messages.USER_NOT_ALLOWED);
            }

            ClaseExtra obj = new ClaseExtra();

            obj.OidPlan = parent.Oid;
            return(obj);
        }
コード例 #6
0
        /// <summary>
        /// Retrieve the complete list from db
        /// </summary>
        /// <param name="get_childs">retrieving the childs</param>
        /// <returns></returns>
        public static PlanExtraList GetList(bool childs)
        {
            CriteriaEx criteria = PlanExtra.GetCriteria(PlanExtra.OpenSession());

            criteria.Childs = childs;
            criteria.Query  = PlanExtraList.SELECT();

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

            CloseSession(criteria.SessionCode);

            return(list);
        }
コード例 #7
0
 public void CopyFrom(PlanExtra source)
 {
     _base.CopyValues(source);
 }
コード例 #8
0
 public static string SELECT()
 {
     return(PlanExtra.SELECT(new QueryConditions(), false));
 }
コード例 #9
0
 public ClaseExtra NewItem(PlanExtra parent)
 {
     this.AddItem(ClaseExtra.NewChild(parent));
     return(this[Count - 1]);
 }