コード例 #1
0
        internal void Update(PlanAnual parent)
        {
            this.RaiseListChangedEvents = false;

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

            this.RaiseListChangedEvents = true;
        }
コード例 #2
0
 public void Clone(PlanAnual plan)
 {
     foreach (Plan_Tipo item in this)
     {
         item.OidPlan = plan.Oid;
     }
 }
コード例 #3
0
        internal void DeleteSelf(PlanAnual 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 <Plan_TipoRecord>(Oid));
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

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

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

            Plan_Tipo obj = new Plan_Tipo();

            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 PlanAnualList GetList(bool childs)
        {
            CriteriaEx criteria = PlanAnual.GetCriteria(PlanAnual.OpenSession());

            criteria.Childs = childs;

            //No criteria. Retrieve all de List
            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = PlanAnualList.SELECT();
            }
            PlanAnualList list = DataPortal.Fetch <PlanAnualList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
コード例 #7
0
        internal void Insert(PlanAnual parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            try
            {
                OidPlan = parent.Oid;
                parent.Session().Save(this.Base.Record);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

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


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

            MarkOld();
        }
コード例 #9
0
 public void CopyFrom(PlanAnual source)
 {
     _base.CopyValues(source);
 }
コード例 #10
0
 public Plan_Tipo NewItem(PlanAnual parent)
 {
     this.AddItem(Plan_Tipo.NewChild(parent));
     return(this[Count - 1]);
 }
コード例 #11
0
 public static string SELECT()
 {
     return(PlanAnual.SELECT(new QueryConditions(), false));
 }