Beispiel #1
0
 public Attribute(ObjectClass objectClass) : base(objectClass)
 {
 }
Beispiel #2
0
 public Account(ObjectClass objectClass) : base(objectClass)
 {
 }
Beispiel #3
0
 protected virtual void BeforePost()
 {
     ThrowIfNotModified();
     ObjectClass.CheckObject(this);
     //if (_currentChanger == null) throw new NullReferenceException("У объекта " + this.GetType().FullName + " id = " + _id + " СurrentChanger не определен");
 }
 public StereotypedObject(ObjectClass objectClass, DersaSqlManager sm) : base(objectClass)
 {
     _SM = sm;
 }
Beispiel #5
0
 public Object(ObjectClass objectClass) : this()
 {
     _objectClass = objectClass;
 }
Beispiel #6
0
 public BaseClass(ObjectClass objectClass) : base(objectClass)
 {
 }
Beispiel #7
0
 public Relation(ObjectClass objectClass, DersaSqlManager sm) : base(objectClass, sm)
 {
 }
Beispiel #8
0
        public Entity(System.Data.DataTable t, Entity _Parent, DersaSqlManager M, AddChildrenMode AddChildren, bool AddRelations)
            : this(ObjectClass.GetObjectClass(t), M)
        {
            if (t != null && t.Rows.Count > 0)
            {
                // = new DersaSqlManager();
                System.Data.DataRow r = t.Rows[0];
                if (_Parent != null)
                {
                    this.Parent = _Parent;
                }
                else
                {
                    string ParentID = r["parent"].ToString();
                    if (ParentID != "")
                    {
                        if (CachedObjects.CachedEntities[r["parent"]] != null)
                        {
                            this.Parent = (Entity)CachedObjects.CachedEntities[r["parent"]];
                        }
                        else
                        {
                            this.Parent = new Entity(M.GetEntity(ParentID), null, M, AddChildrenMode.NotPackage, false);
                        }
                    }
                }
                string StereotypeID = r["stereotype"].ToString();
                if (StereotypeID != "")
                {
                    this.Stereotype = M.GetStereotype(StereotypeID);
                }
                this.Id = (int)r["entity"];

                if (AddChildren == AddChildrenMode.Always || (AddChildren == AddChildrenMode.NotPackage && this.Stereotype.Name != "Package"))
                {
                    if (this._children == null)
                    {
                        this._children = new EntityChildrenCollection();
                    }
                    if (this._children.Count < 1)
                    {
                        System.Data.DataTable ChildrenTable = M.GetEntityChildren(this.Id.ToString());
                        if (ChildrenTable.Rows.Count > 0)
                        {
                            foreach (System.Data.DataRow cr in ChildrenTable.Rows)
                            {
                                this._children.Add(new Entity(M.GetEntity(cr["entity"].ToString()), this, M, AddChildrenMode.NotPackage, false));
                            }
                        }
                    }
                }
                if (AddRelations)
                {
                    if (this._aRelations == null)
                    {
                        this._aRelations = new ChildrenCollection();
                    }
                    if (this._aRelations.Count < 1)
                    {
                        System.Data.DataTable ARelationsTable = M.GetEntityARelations(this.Id.ToString());
                        if (ARelationsTable.Rows.Count > 0)
                        {
                            foreach (System.Data.DataRow cr in ARelationsTable.Rows)
                            {
                                this._aRelations.Add(new Relation(cr, this, null, M));
                            }
                        }
                    }
                    if (this._bRelations == null)
                    {
                        this._bRelations = new ChildrenCollection();
                    }
                    if (this._bRelations.Count < 1)
                    {
                        System.Data.DataTable BRelationsTable = M.GetEntityBRelations(this.Id.ToString());
                        if (BRelationsTable.Rows.Count > 0)
                        {
                            foreach (System.Data.DataRow cr in BRelationsTable.Rows)
                            {
                                this._bRelations.Add(new Relation(cr, null, this, M));
                            }
                        }
                    }
                }
            }
            CachedObjects.CachedEntities[this.Id] = this;
        }
Beispiel #9
0
 public Entity(ObjectClass objectClass, DersaSqlManager sm) : base(objectClass, sm)
 {
 }