예제 #1
0
        public virtual object Clone(Dictionary <object, object> clonedObjects, bool includePrimaryKey)
        {
            IndexLastDayTimeValue cloned = new IndexLastDayTimeValue();

            clonedObjects.Add(this, cloned);
            if (includePrimaryKey)
            {
                cloned._indexLastDayTimeValuePK = this._indexLastDayTimeValuePK;
            }
            cloned._insCode       = this._insCode;
            cloned._dt            = this._dt;
            cloned._value         = this._value;
            cloned._changeValue   = this._changeValue;
            cloned._changePercent = this._changePercent;
            if (Instrument != null)
            {
                if (!clonedObjects.ContainsKey(Instrument))
                {
                    cloned.Instrument = (Instrument)Instrument.Clone(clonedObjects, includePrimaryKey);
                }
                else
                {
                    cloned.Instrument = (Instrument)clonedObjects[Instrument];
                }
            }


            return(cloned);
        }
예제 #2
0
        public virtual bool Equals(object other, List <object> checked_objects)
        {
            if (checked_objects.Contains(this))
            {
                return(true);
            }

            checked_objects.Add(this);

            IndexLastDayTimeValue casted_other = other as IndexLastDayTimeValue;

            if (casted_other == null)
            {
                checked_objects.Remove(this);
                return(false);
            }

            if (!Typing.IsEquals(this.IndexLastDayTimeValuePK, casted_other.IndexLastDayTimeValuePK))
            {
                checked_objects.Remove(this);
                return(false);
            }
            if (!Typing.IsEquals(this.InsCode, casted_other.InsCode))
            {
                checked_objects.Remove(this);
                return(false);
            }
            if (!Typing.IsEquals(this.Dt, casted_other.Dt))
            {
                checked_objects.Remove(this);
                return(false);
            }
            if (!Typing.IsEquals(this.Value, casted_other.Value))
            {
                checked_objects.Remove(this);
                return(false);
            }
            if (!Typing.IsEquals(this.ChangeValue, casted_other.ChangeValue))
            {
                checked_objects.Remove(this);
                return(false);
            }
            if (!Typing.IsEquals(this.ChangePercent, casted_other.ChangePercent))
            {
                checked_objects.Remove(this);
                return(false);
            }
            if (this.Instrument != null)
            {
                if (!this.Instrument.Equals(casted_other.Instrument, checked_objects))
                {
                    checked_objects.Remove(this);
                    return(false);
                }
            }
            else
            if (casted_other.Instrument != null)
            {
                checked_objects.Remove(this);
                return(false);
            }
            checked_objects.Remove(this);

            return(true);
        }