private static void BuildNominalLines(NominalLedgerServiceClient serviceClient, NominalTaxJournalUpdateRequest request, List <NominalTaxJournalDetail> taxJournalDetails, NominalTaxJournal journal, ref NominalTransactionUpdateResponse response, ref int successLines, ref int failureLines, int rowIndex) { journal.DetailLines = taxJournalDetails.ToArray(); journal.Reference = "VOUCHERREF"; journal.BatchReference = "FONTEVA"; journal.PostingDate = DateTime.Now; journal.HeaderDebitCreditFlag = modEnumsDebitCreditType.Credit; journal.Description = "Membership Import Journal"; journal.PostLive = false; request.Ticket = FetchTicket(); request.Transaction = journal; try { Console.WriteLine("trying to make a request"); response = serviceClient.NominalTaxJournalUpdate(request); if (response.ErrorID > 0) { Console.WriteLine("The request was sent however the following error came back form the web service:"); Console.WriteLine(response.ErrorMessage); Console.WriteLine("The request failed on line {0}", rowIndex + 1); failureLines++; } else { Console.WriteLine(response.Transaction.HeaderAuditNo.ToString()); successLines++; } } catch (Exception e) { Console.WriteLine("The following error has occured no request was sent:\n" + e); } }
private static void BuildNominalHeader(out NominalLedgerServiceClient serviceClient, out NominalTaxJournalUpdateRequest request, out List <NominalTaxJournalDetail> taxJournalDetails, out NominalTaxJournal journal, out NominalTransactionUpdateResponse response) { serviceClient = new NominalLedgerServiceClient(); request = new NominalTaxJournalUpdateRequest(); taxJournalDetails = new List <NominalTaxJournalDetail>(); journal = new NominalTaxJournal { Ledger = modEnumsNominalLedgerType.Cashbook, IsPayment = true }; //NominalTaxJournalDetail journalDetail = new NominalTaxJournalDetail(); response = new NominalTransactionUpdateResponse(); }