Exemple #1
0
 //---------------------------------------------------------------------
 public virtual void Push(DataRow row, TMetaColumnCollection metaColumns)
 {
     foreach (TMetaColumn mc in metaColumns)
     {
         this.Push(row, mc);
     }
 }
Exemple #2
0
        //----------------------------------------------------------
        public virtual void Assign(TMetaEntity me, CEntity rhs)
        {
            TMetaTable mt = me.MetaTable;

            TInheritMappingType   inheritType = mt.InheritMappingType;
            TMetaColumnCollection mcs         = null;

            if (inheritType == TInheritMappingType.TablePerConcreteClass)
            {
                mcs = mt.FullValueColumns;
            }
            else
            if (inheritType == TInheritMappingType.TablePerSubClass)
            {
                mcs = mt.ValueColumns;
            }

            CEntity that = rhs as CEntity;

            foreach (TMetaColumn mc in mcs)
            {
                //if (!cm.IsAssign)
                //    continue;
                if (mc.MemberName == "Captions.Cn (Assign)")
                {
                    System.Diagnostics.Debug.WriteLine(mc.MemberName);
                }

                object v2 = that.GetEpoPropertyValue(mc);
                this.SetEpoPorpertyValue(mc, v2);
            }
        }
Exemple #3
0
 //--------------------------------------------------------
 public void Fill(TMetaColumnCollection keyColumns)
 {
     foreach (TMetaColumn mc in keyColumns)
     {
         var dbValue = GetDbValue(mc);
         mc.DbValue   = dbValue;
         mc.DataValue = GetEpoPropertyValue(mc);
     }
 }
Exemple #4
0
        //--------------------------------------------------------------
        public bool Equals(Type t, object rhs)
        {
            if (rhs == null)
            {
                return(false);
            }

            if (object.ReferenceEquals(this, rhs))
            {
                return(true);
            }

            if (this.GetType() != rhs.GetType())
            {
                return(false);
            }

            CEntity that = rhs as CEntity;

            if (that == null)
            {
                return(false);
            }

            TMetaEntity           meta        = TMetaRegistry.Default.GetMeta(t);
            TMetaTable            mt          = meta.MetaTable;
            TInheritMappingType   inheritType = mt.InheritMappingType;
            TMetaColumnCollection mcs         = null;

            if (inheritType == TInheritMappingType.TablePerConcreteClass)
            {
                mcs = mt.FullValueColumns;
            }
            else if (inheritType == TInheritMappingType.TablePerSubClass)
            {
                mcs = mt.ValueColumns;
            }
            bool b = true;

            foreach (TMetaColumn mc in mcs)
            {
                //if (!cm.IsCompare)
                //    continue;
                if (mc.MemberName == "Captions.Cn (Equal)")
                {
                    System.Diagnostics.Debug.WriteLine(mc.MemberName);
                }
                object v1 = this.GetEpoPropertyValue(mc);
                object v2 = that.GetEpoPropertyValue(mc);
                b = b && (object.Equals(v1, v2));
            }
            b = b && (PersistState == that.PersistState);
            return(b);
        }