/// <summary> /// Copy Constructor /// </summary> /// <param name="doc">Source document</param> public DocM691_Invoice(DocM691_Invoice doc) : base(doc.headers, "Group Billing Acct ID", "Invoice Number") { this.mailingAddress = doc.mailingAddress; this.accountNumber = doc.accountNumber; this.memberID = doc.memberID; this.message = doc.message; this.statementDate = doc.statementDate; this.fullName = doc.statementDate; this.dueDate = doc.dueDate; this.premiumWithhold = doc.premiumWithhold; this.balanceDue = doc.balanceDue; this.currentBalance = doc.currentBalance; this.agingFullPastDue = doc.agingFullPastDue; this.details = doc.CopyOfDetails(); }
, KeyedDocs <DocM504A_BalFwdRecord> > PopulateDocs(string[] files) { // each will be a dictionary of documents indexed by their respective IDs. Dictionary <AcctID, DocM691_Invoice> MCSB691 = new Dictionary <AcctID, DocM691_Invoice>(); KeyedDocs <DocM691_Invoice> M691Records = null; KeyedDocs <DocM690_MemberRecord> M690Records = null; KeyedDocs <DocM504A_BalFwdRecord> M504Records = null; Dictionary <AcctID, DocM504A_BalFwdRecord> MCSB504A = new Dictionary <AcctID, DocM504A_BalFwdRecord>(); var MCSB691_Primitive = new List <string>(); var MSCB690_CSVData = new Dictionary <string, List <StringMap> >(); DocType docType; string filename , fileExtension; foreach (string filePath in files) { filename = Path.GetFileName(filePath); fileExtension = Path.GetExtension(filePath); docType = IdentifyDoc(filename); // put each document type into its headersource (struct of Stringmap and headers list) switch (docType) { case (DocType.M691): MCSB691_Primitive = ImportRows(filename); HeaderSource <List <StringMap>, List <string> > src691 = DocM691_Invoice.ParseM691(MCSB691_Primitive.ToArray()); M691Records = new KeyedDocs <DocM691_Invoice>(src691); break; case (DocType.M690): var M690sByAcctID = ImportCSVWithHeader( filePath , primaryKey: "Group Billing Acct ID" , delimiter: "|" , useQuotes: false); M690Records = new KeyedDocs <DocM690_MemberRecord>(M690sByAcctID); break; case (DocType.M504A): string[] headers = DocM504A_BalFwdRecord.headers; var M504AsByAcctID = ImportCSVWithHeader( filePath , primaryKey: "Account Id" , "," , useQuotes: true , headers); M504Records = new KeyedDocs <DocM504A_BalFwdRecord>(M504AsByAcctID); break; case (DocType.Error): throw new Exception($"Unexpected file found: {filePath}"); } } return(new ValueTuple < KeyedDocs <DocM691_Invoice> , KeyedDocs <DocM690_MemberRecord> , KeyedDocs <DocM504A_BalFwdRecord> >( M691Records, M690Records, M504Records)); }