1. C# / Говнокод #5985

    +126

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    public class BasisTariffing : IFormattable
    {
    	public override bool Equals(object obj) {
    		BasisTariffing subject = obj as BasisTariffing;
    		if (subject == null) {
    			return false;
    		}
    		return ((Profession == null && subject.Profession == null) || (Profession != null && subject.Profession != null && Profession.Equals(subject.Profession))) &&
    			((BasisRateOf == null && subject.BasisRateOf == null) || (BasisRateOf != null && subject.BasisRateOf != null && BasisRateOf.Equals(subject.BasisRateOf))) &&
    			((BasisRating1Main == null && subject.BasisRating1Main == null) || (BasisRating1Main != null && subject.BasisRating1Main != null && BasisRating1Main.Equals(subject.BasisRating1Main))) &&
    			((BasisRating1Add == null && subject.BasisRating1Add == null) || (BasisRating1Add != null && subject.BasisRating1Add != null && BasisRating1Add.Equals(subject.BasisRating1Add))) &&
    			((BasisRating2Main == null && subject.BasisRating2Main == null) || (BasisRating2Main != null && subject.BasisRating2Main != null && BasisRating2Main.Equals(subject.BasisRating2Main))) &&
    			((BasisRating2Add == null && subject.BasisRating2Add == null) || (BasisRating2Add != null && subject.BasisRating2Add != null && BasisRating2Add.Equals(subject.BasisRating2Add))) &&
    			((BasisRating3Main == null && subject.BasisRating3Main == null) || (BasisRating3Main != null && subject.BasisRating3Main != null && BasisRating3Main.Equals(subject.BasisRating3Main))) &&
    			((BasisRating3Add == null && subject.BasisRating3Add == null) || (BasisRating3Add != null && subject.BasisRating3Add != null && BasisRating3Add.Equals(subject.BasisRating3Add))) &&
    			((BasisRating4Main == null && subject.BasisRating4Main == null) || (BasisRating4Main != null && subject.BasisRating4Main != null && BasisRating4Main.Equals(subject.BasisRating4Main))) &&
    			((BasisRating4Add == null && subject.BasisRating4Add == null) || (BasisRating4Add != null && subject.BasisRating4Add != null && BasisRating4Add.Equals(subject.BasisRating4Add))) &&
    			((BasisRating5Main == null && subject.BasisRating5Main == null) || (BasisRating5Main != null && subject.BasisRating5Main != null && BasisRating5Main.Equals(subject.BasisRating5Main))) &&
    			((BasisRating5Add == null && subject.BasisRating5Add == null) || (BasisRating5Add != null && subject.BasisRating5Add != null && BasisRating5Add.Equals(subject.BasisRating5Add))) &&
    			((BasisRating6Main == null && subject.BasisRating6Main == null) || (BasisRating6Main != null && subject.BasisRating6Main != null && BasisRating6Main.Equals(subject.BasisRating6Main))) &&
    			((BasisRating6Add == null && subject.BasisRating6Add == null) || (BasisRating6Add != null && subject.BasisRating6Add != null && BasisRating6Add.Equals(subject.BasisRating6Add))) &&
    			((BasisRating7Main == null && subject.BasisRating7Main == null) || (BasisRating7Main != null && subject.BasisRating7Main != null && BasisRating7Main.Equals(subject.BasisRating7Main))) &&
    			((BasisRating7Add == null && subject.BasisRating7Add == null) || (BasisRating7Add != null && subject.BasisRating7Add != null && BasisRating7Add.Equals(subject.BasisRating7Add))) &&
    			((BasisRating8Main == null && subject.BasisRating8Main == null) || (BasisRating8Main != null && subject.BasisRating8Main != null && BasisRating8Main.Equals(subject.BasisRating8Main))) &&
    			((BasisRating8Add == null && subject.BasisRating8Add == null) || (BasisRating8Add != null && subject.BasisRating8Add != null && BasisRating8Add.Equals(subject.BasisRating8Add)));
    	}
    
    	public override int GetHashCode() {
    		return ((Profession != null) ? Profession.GetHashCode() : 0) ^
    			((BasisRateOf != null) ? BasisRateOf.GetHashCode() : 0) ^
    			((BasisRating1Main != null) ? BasisRating1Main.GetHashCode() : 0) ^
    			((BasisRating1Add != null) ? BasisRating1Add.GetHashCode() : 0) ^
    			((BasisRating2Main != null) ? BasisRating2Main.GetHashCode() : 0) ^
    			....................................
    	}
    }

    Как вам перегрузочка? И это только часть кода *сущности*, больше просто не вместилось =)

    Запостил: Guid, 15 Марта 2011

    Комментарии (9) RSS

    Добавить комментарий