private BusinessAccountRecord CreateBusinessRecord(string accountNumber, string fullName, string line1, string line23, string town, string county, string postcode, DateTime startDate, DateTime dateClose, int scheduledRepayments, decimal currentBalance, string transferredToCollectionFlag, string sortCode, string experianRefNum) { // TODO: investigate if we need all the assigments to 0 and empty strings var record = new BusinessAccountRecord { AccountNumber = accountNumber, ProprietorPartnerDirectorNumber = 0, LimitedNonlimitedAndOtherFlag = companyTypeCode, AddressType = string.Empty, NameChange = "N", // Tim Adkins complained about this field in a mail from 22-Sep-2014 (We assume that he is mistaken and didn't change anything) CompanyRegisteredNumberBusinessNumber = experianRefNum, SICCode = 0, VATNumber = string.Empty, YearBusinessStarted = 0, AdditionalTradingStyle = string.Empty, BusinessCompanyTelephoneNumber = string.Empty, BusinessCompanyWebsite = string.Empty, PointOfContactName = string.Empty, PointOfContactEmailAddress = string.Empty, PointOfContactTelephoneNumber = string.Empty, PointOfContactJobTitle = string.Empty, ParentCompanyRegisteredNumber = string.Empty, ParentCompanyTelephoneNumber = string.Empty, ParentCompanyVATNumber = string.Empty, ProprietorPartnerDirectororOtherFlag = string.Empty, SignatoryontheAccountFlag = string.Empty, ShareholdersFlag = string.Empty, CountryofRegistration = string.Empty, DateofBirth = DateTime.MinValue, ProprietorsDirectorsGuarantee = string.Empty, ProprietorsDirectorsGuaranteeCancelledDischarged = string.Empty, AccountType = 2, StartDateofAgreement = startDate, CloseDateofAgreement = startDate > dateClose ? DateTime.MinValue : dateClose, MonthlyPayment = Convert.ToInt32(monthlyPayment), RepaymentPeriod = Convert.ToInt32(scheduledRepayments), CurrentBalance = Convert.ToInt32(currentBalance), CreditBalanceIndicator = string.Empty, AccountStatus = accountStatus, SpecialInstructionIndicator = string.Empty, CreditLimit = 0, FlagSettings = null, Debenture = string.Empty, MortgageFlags = string.Empty, AirtimeStatusFlag = string.Empty, TransferredtoCollectionAccountFlag = transferredToCollectionFlag, BalanceType = string.Empty, CreditTurnover = 0, PrimaryAccountIndicator = string.Empty, DefaultSatisfactionDate = DateTime.MinValue, RejectionFlag = string.Empty, BankerDetailsSortCode = Convert.ToInt32(sortCode), OriginalDefaultBalance = Convert.ToInt32(originalDefaultBalance), PaymentFrequencyIndicator = "M", NumberofCreditCardsissued = 0, PaymentAmount = 0, PaymentCreditIndicator = string.Empty, PreviousStatementBalance = 0, PreviousStatementBalanceIndicator = string.Empty, NumberofCashAdvances = 0, ValueofCashAdvances = 0, PaymentCode = string.Empty, PromotionActivityFlag = string.Empty, PaymentType = "B", NewAccountNumber = string.Empty, NewProprietorPartnerDirectorNumber = string.Empty, NameAddressRegisteredOfficeTradingAddress = { Name = fullName, AddressLine1 = line1, AddressLine2 = line23, AddressLine3 = town, AddressLine4 = county, PostCode = postcode }, ParentCompanyNameAddress = { Name = string.Empty, AddressLine1 = string.Empty, AddressLine2 = string.Empty, AddressLine3 = string.Empty, AddressLine4 = string.Empty, PostCode = string.Empty }, PreviousNameandAddress = { Name = string.Empty, AddressLine1 = string.Empty, AddressLine2 = string.Empty, AddressLine3 = string.Empty, AddressLine4 = string.Empty, PostCode = string.Empty } }; return(record); }
public void TestBusinessSerialize() { var cais = new BusinessCaisFileData { Header = { CompanyPortfolioName = "Test Company", CreditCardBehaviouralSharingFlag = "", DateOfCreation = DateTime.Now } }; var record = new BusinessAccountRecord { AccountNumber = "12345B6789B", ProprietorPartnerDirectorNumber = 31, LimitedNonlimitedAndOtherFlag = "L", NameAddressRegisteredOfficeTradingAddress = { Name = "Patrick O'Neil Nurseries", AddressLine1 = "Rose Cottage", AddressLine2 = "5 Main Street", AddressLine3 = "Wollaton", AddressLine4 = "Nottingham Nottinghamshire", PostCode = "NG2 3SD" }, AddressType = "T", NameChange = "N", CompanyRegisteredNumberBusinessNumber = "SC000123", SICCode = 201, VATNumber = "111222333", YearBusinessStarted = 1980, AdditionalTradingStyle = "Fishing Accessories Sales", BusinessCompanyTelephoneNumber = "01999996789", BusinessCompanyWebsite = "www.abc.com", PointOfContactName = "John Smith", PointOfContactEmailAddress = "*****@*****.**", PointOfContactTelephoneNumber = "01999996789", PointOfContactJobTitle = "Managing Director", ParentCompanyNameAddress = { Name = "General Finance Co. Ltd.", AddressLine1 = "Rose Cottage", AddressLine2 = "5 Main Street", AddressLine3 = "Wollaton", AddressLine4 = "Nottingham Nottinghamshire", PostCode = "NG2 3SD" }, ParentCompanyRegisteredNumber = "", ParentCompanyTelephoneNumber = "", ParentCompanyVATNumber = "", PreviousNameandAddress = { Name = "", AddressLine1 = "", AddressLine2 = "", AddressLine3 = "", AddressLine4 = "", PostCode = "" }, ProprietorPartnerDirectororOtherFlag = "P", SignatoryontheAccountFlag = "Y", ShareholdersFlag = "", CountryofRegistration = "FR", DateofBirth = DateTime.MinValue, ProprietorsDirectorsGuarantee = "", ProprietorsDirectorsGuaranteeCancelledDischarged = "", AccountType = 2, StartDateofAgreement = new DateTime(1970, 6, 12), CloseDateofAgreement = DateTime.MinValue, MonthlyPayment = 200, RepaymentPeriod = 48, CurrentBalance = 3600, CreditBalanceIndicator = "", AccountStatus = "0", SpecialInstructionIndicator = "", CreditLimit = 5000, FlagSettings = "A", Debenture = "", MortgageFlags = "", AirtimeStatusFlag = "L", TransferredtoCollectionAccountFlag = "", BalanceType = "A", CreditTurnover = 2000, PrimaryAccountIndicator = "N", DefaultSatisfactionDate = new DateTime(2012, 1, 1), RejectionFlag = "", BankerDetailsSortCode = 19901, OriginalDefaultBalance = 5000, PaymentFrequencyIndicator = "W", NumberofCreditCardsissued = 0, PaymentAmount = 0, PaymentCreditIndicator = "", PreviousStatementBalance = 0, PreviousStatementBalanceIndicator = "", NumberofCashAdvances = 0, ValueofCashAdvances = 0, PaymentCode = "", PromotionActivityFlag = "", PaymentType = "C", NewAccountNumber = "", NewProprietorPartnerDirectorNumber = "" }; cais.Accounts.Add(record); var data = cais.WriteToString(); Console.WriteLine("Cais business data: {0}", data); Assert.That(!string.IsNullOrEmpty(data)); //cais.WriteToFile(@"f:\temp\PIF1160a.txt"); }