public virtual bool Equals(ContractMaterialBase toObject)
 {
     if (toObject == null)
     {
         return(false);
     }
     return(Equals(this, toObject));
 }
Exemple #2
0
 public ContractMaterialKey(ContractMaterialBase entity)
 {
     this.Entity = entity;
     if (entity != null)
     {
         this.contractMaterialCode = entity.ContractMaterialCode;
     }
 }
        public static bool Equals(ContractMaterialBase Object1, ContractMaterialBase Object2)
        {
            if ((Object1 == null) && (Object2 == null))
            {
                return(true);
            }
            if ((Object1 == null) ^ (Object2 == null))
            {
                return(false);
            }
            bool flag = true;

            if (Object1.ContractMaterialCode != Object2.ContractMaterialCode)
            {
                flag = false;
            }
            if ((Object1.ContractCode != null) && (Object2.ContractCode != null))
            {
                if (Object1.ContractCode != Object2.ContractCode)
                {
                    flag = false;
                }
            }
            else if ((Object1.ContractCode == null) ^ (Object2.ContractCode == null))
            {
                flag = false;
            }
            if (Object1.MaterialCode.HasValue && Object2.MaterialCode.HasValue)
            {
                if (Object1.MaterialCode != Object2.MaterialCode)
                {
                    flag = false;
                }
            }
            else if (!Object1.MaterialCode.HasValue ^ !Object2.MaterialCode.HasValue)
            {
                flag = false;
            }
            if (Object1.Qty.HasValue && Object2.Qty.HasValue)
            {
                if (Object1.Qty != Object2.Qty)
                {
                    flag = false;
                }
            }
            else if (!Object1.Qty.HasValue ^ !Object2.Qty.HasValue)
            {
                flag = false;
            }
            if (Object1.Price.HasValue && Object2.Price.HasValue)
            {
                if (Object1.Price != Object2.Price)
                {
                    flag = false;
                }
            }
            else if (!Object1.Price.HasValue ^ !Object2.Price.HasValue)
            {
                flag = false;
            }
            if (Object1.Money.HasValue && Object2.Money.HasValue)
            {
                if (Object1.Money != Object2.Money)
                {
                    flag = false;
                }
                return(flag);
            }
            if (!Object1.Money.HasValue ^ !Object2.Money.HasValue)
            {
                flag = false;
            }
            return(flag);
        }