Created
May 15, 2016 21:01
-
-
Save SimonDoy/3a45b052495a85e7127ed181f35b3e27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InvoiceForm | |
{ | |
public InvoiceForm() | |
{ | |
this.InvoiceLines = new List<InvoiceLine>(); | |
} | |
public long Id { get; set; } | |
public string Reference { get; set; } | |
public string CompanyName { get; set; } | |
public DateTime InvoiceDate { get; set; } | |
public string Contact { get; set; } | |
public string AddressLine1 { get; set; } | |
public string AddressLine2 { get; set; } | |
public string AddressLine3 { get; set; } | |
public string AddressLine4 { get; set; } | |
public string AddressCity { get; set; } | |
public string AddressCounty { get; set; } | |
public string AddressCountry { get; set; } | |
public string AgencyName { get; set; } | |
public string AgencyContact { get; set; } | |
public List<InvoiceLine> InvoiceLines { get; set; } | |
public double InvoiceTotal | |
{ | |
get | |
{ | |
double invoiceTotal = 0; | |
if (InvoiceLines.Count > 0) | |
{ | |
invoiceTotal = InvoiceLines.Sum(l => l.LineTotal); | |
} | |
return invoiceTotal; | |
} | |
} | |
public string CurrencyType { get; set; } | |
public double VatRate { get; set; } | |
public double VatAmount { get; set; } | |
public double InvoiceTotalWithVat | |
{ | |
get | |
{ | |
var totalAmount = VatAmount + InvoiceTotal; | |
return totalAmount; | |
} | |
} | |
public string Status { get; set; } | |
public string CreatedBy { get; set; } | |
public string ModifiedBy { get; set; } | |
public DateTime Created { get; set; } | |
public DateTime Modified { get; set; } | |
} | |
public class InvoiceNotFoundForm : InvoiceForm | |
{ | |
public InvoiceNotFoundForm() | |
{ | |
this.Id = -1; | |
this.AgencyName = "Not Found"; | |
this.CompanyName = "Not Found"; | |
this.Reference = "N/A"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment