using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace bnhtrade.Core.Logic.Account { public class ValidateSalesInvoice : ValidateInvoice { public ValidateSalesInvoice() { int propertyCount = new Model.Account.SalesInvoice().GetType().GetProperties().Count(); if (propertyCount != 20) { throw new Exception("Model.Account.SalesInvoice property count has altered. Validate class requires an update."); } propertyCount = new Model.Account.SalesInvoice.InvoiceLine().GetType().GetProperties().Count(); if (propertyCount != 18) { throw new Exception("Model.Account.SalesInvoice property count has altered. Validate class requires an update."); } } public bool IsValidInvoice(Model.Account.SalesInvoice invoice) { return IsValidInvoice(new List { invoice }); } public bool IsValidInvoice(List invoiceList) { var interfaceList = invoiceList.Cast().ToList(); return IsValidInvoice(interfaceList); } } }