summaryrefslogtreecommitdiff
path: root/src/app/Cmpp298.Assignment3.Dto/SaveInvoiceDto.cs
blob: be496ba4f26bd0a506ba0248b5b005c5dd310185 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
namespace Cmpp298.Assignment3.Dto {
	public class SaveInvoiceDto {
		public SaveInvoiceDto( string vendorId, string invoiceNumber, string invoiceDate, string invoiceTotal,
		                       string paymentTotal, string creditTotal, string dueDate, string paymentDate, string termsId ) {
			_vendorId = vendorId;
			_invoiceNumber = invoiceNumber;
			_invoiceDate = invoiceDate;
			_invoiceTotal = invoiceTotal;
			_paymentTotal = paymentTotal;
			_creditTotal = creditTotal;
			_dueDate = dueDate;
			_paymentDate = paymentDate;
			_termsId = termsId;
		}

		public string VendorId {
			get { return _vendorId; }
		}

		public string InvoiceNumber {
			get { return _invoiceNumber; }
		}

		public string InvoiceDate {
			get { return _invoiceDate; }
		}

		public string InvoiceTotal {
			get { return _invoiceTotal; }
		}

		public string PaymentTotal {
			get { return _paymentTotal; }
		}

		public string CreditTotal {
			get { return _creditTotal; }
		}

		public string DueDate {
			get { return _dueDate; }
		}

		public string PaymentDate {
			get { return _paymentDate; }
		}

		public string TermsId {
			get { return _termsId; }
		}

		public override bool Equals( object obj ) {
			if ( this == obj ) {
				return true;
			}
			SaveInvoiceDto saveInvoiceDto = obj as SaveInvoiceDto;
			if ( saveInvoiceDto == null ) {
				return false;
			}
			if ( !Equals( _vendorId, saveInvoiceDto._vendorId ) ) {
				return false;
			}
			if ( !Equals( _invoiceNumber, saveInvoiceDto._invoiceNumber ) ) {
				return false;
			}
			if ( !Equals( _invoiceDate, saveInvoiceDto._invoiceDate ) ) {
				return false;
			}
			if ( !Equals( _invoiceTotal, saveInvoiceDto._invoiceTotal ) ) {
				return false;
			}
			if ( !Equals( _paymentTotal, saveInvoiceDto._paymentTotal ) ) {
				return false;
			}
			if ( !Equals( _creditTotal, saveInvoiceDto._creditTotal ) ) {
				return false;
			}
			if ( !Equals( _dueDate, saveInvoiceDto._dueDate ) ) {
				return false;
			}
			if ( !Equals( _paymentDate, saveInvoiceDto._paymentDate ) ) {
				return false;
			}
			if ( !Equals( _termsId, saveInvoiceDto._termsId ) ) {
				return false;
			}
			return true;
		}

		public override int GetHashCode( ) {
			int result = _vendorId != null ? _vendorId.GetHashCode( ) : 0;
			result = 29*result + ( _invoiceNumber != null ? _invoiceNumber.GetHashCode( ) : 0 );
			result = 29*result + ( _invoiceDate != null ? _invoiceDate.GetHashCode( ) : 0 );
			result = 29*result + ( _invoiceTotal != null ? _invoiceTotal.GetHashCode( ) : 0 );
			result = 29*result + ( _paymentTotal != null ? _paymentTotal.GetHashCode( ) : 0 );
			result = 29*result + ( _creditTotal != null ? _creditTotal.GetHashCode( ) : 0 );
			result = 29*result + ( _dueDate != null ? _dueDate.GetHashCode( ) : 0 );
			result = 29*result + ( _paymentDate != null ? _paymentDate.GetHashCode( ) : 0 );
			result = 29*result + ( _termsId != null ? _termsId.GetHashCode( ) : 0 );
			return result;
		}

		private readonly string _vendorId;
		private readonly string _invoiceNumber;
		private readonly string _invoiceDate;
		private readonly string _invoiceTotal;
		private readonly string _paymentTotal;
		private readonly string _creditTotal;
		private readonly string _dueDate;
		private readonly string _paymentDate;
		private readonly string _termsId;
	}
}