using System; using System.Runtime.Serialization; namespace Tanshu.Accounts.Contracts { public class PrintLocationBO { public int PrintLocationID { get; set; } public Guid ProductTypeID { get; set; } public string Location { get; set; } public string Printer { get; set; } public int Copies { get; set; } public string CutCode { get; set; } public override bool Equals(System.Object obj) { // If parameter is null return false. if (obj == null) { return false; } // If parameter cannot be cast to Point return false. PrintLocationBO p = obj as PrintLocationBO; if ((System.Object)p == null) { return false; } // Return true if the fields match: //return (PrintLocationID == p.PrintLocationID) // && (ProductTypeID == p.ProductTypeID) // && (Location == p.Location) // && (Printer == p.Printer) // && (Copies == p.Copies) // && (CutCode == p.CutCode); return (Location == p.Location) && (Printer == p.Printer) && (Copies == p.Copies) && (CutCode == p.CutCode); } public bool Equals(PrintLocationBO p) { // If parameter is null return false: if ((object)p == null) { return false; } // Return true if the fields match: //return (PrintLocationID == p.PrintLocationID) // && (ProductTypeID == p.ProductTypeID) // && (Location == p.Location) // && (Printer == p.Printer) // && (Copies == p.Copies) // && (CutCode == p.CutCode); return (Location == p.Location) && (Printer == p.Printer) && (Copies == p.Copies) && (CutCode == p.CutCode); } public override int GetHashCode() { //return PrintLocationID.GetHashCode() ^ ProductTypeID.GetHashCode() ^ Location.GetHashCode() ^ Printer.GetHashCode() ^ Copies.GetHashCode() ^ CutCode.GetHashCode(); return Location.GetHashCode() ^ Printer.GetHashCode() ^ Copies.GetHashCode() ^ CutCode.GetHashCode(); } } }