Exemple #1
0
 public bool Equals(TempSaleDTO other)
 {
     return(other != null
         ? CustomerName.Equals(other.CustomerName) &&
            ManagerName.Equals(other.ManagerName) &&
            ProductName.Equals(other.ProductName) &&
            SaleDate.Equals(other.SaleDate) &&
            SessionId.Equals(other.SessionId) &&
            Total.Equals(other.Total) &&
            Id.Equals(other.Id)
         : false);
 }
Exemple #2
0
        public bool Equals(Customer other)
        {
            //Check whether the compared object is null.
            if (Object.ReferenceEquals(other, null))
            {
                return(false);
            }

            //Check whether the compared object references the same data.
            if (Object.ReferenceEquals(this, other))
            {
                return(true);
            }

            //Check whether the products' properties are equal.
            return(CustomerName.Equals(other.CustomerName));
        }
Exemple #3
0
        /// <summary>
        /// Returns true if Customer instances are equal
        /// </summary>
        /// <param name="other">Instance of Customer to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Customer other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CustomerId == other.CustomerId ||
                     CustomerId != null &&
                     CustomerId.Equals(other.CustomerId)
                     ) &&
                 (
                     CustomerCode == other.CustomerCode ||
                     CustomerCode != null &&
                     CustomerCode.Equals(other.CustomerCode)
                 ) &&
                 (
                     CustomerName == other.CustomerName ||
                     CustomerName != null &&
                     CustomerName.Equals(other.CustomerName)
                 ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ) &&
                 (
                     CompanyName == other.CompanyName ||
                     CompanyName != null &&
                     CompanyName.Equals(other.CompanyName)
                 ) &&
                 (
                     CustomerGroupId == other.CustomerGroupId ||
                     CustomerGroupId != null &&
                     CustomerGroupId.Equals(other.CustomerGroupId)
                 ) &&
                 (
                     DebitMoney == other.DebitMoney ||

                     DebitMoney.Equals(other.DebitMoney)
                 ) &&
                 (
                     Address == other.Address ||
                     Address != null &&
                     Address.Equals(other.Address)
                 ) &&
                 (
                     PhoneNumber == other.PhoneNumber ||
                     PhoneNumber != null &&
                     PhoneNumber.Equals(other.PhoneNumber)
                 ) &&
                 (
                     DateOfBirth == other.DateOfBirth ||
                     DateOfBirth != null &&
                     DateOfBirth.Equals(other.DateOfBirth)
                 ));
        }