Esempio n. 1
0
        public void WritePaymentNotMatchedToCsv(PaymentNotMatched iPaymentNotMatched, bool iAddTitleToCsv)
        {
            if (iPaymentNotMatched == null)
            {
                throw new ArgumentNullException("PaymentNotMatched cannot be null");
            }

            this.WriteLine(this.PaymentNotMatchedFormatter.AsCsv(iPaymentNotMatched, iAddTitleToCsv));
        }
Esempio n. 2
0
        public String AsCsv(PaymentNotMatched iPaymentNotMatched, bool iAddTitleToCsv)
        {
            if (iPaymentNotMatched == null)
            {
                throw new ArgumentNullException("PaymentNotMatched is null");
            }
            StringBuilder aPaymentNotMatchedCsv = new StringBuilder();

            if (iAddTitleToCsv)
            {
                aPaymentNotMatchedCsv.AppendLine(AddTitleToCsv());
            }

            return(aPaymentNotMatchedCsv.Append(string.Format(
                                                    "{0},{1},{2},{3},{4},{5}",
                                                    iPaymentNotMatched.Customer,
                                                    iPaymentNotMatched.Month.ToString(),
                                                    iPaymentNotMatched.Year.ToString(),
                                                    iPaymentNotMatched.Amount,
                                                    iPaymentNotMatched.AmountDue,
                                                    iPaymentNotMatched.DifferenceBetweenDueAndPayed)).ToString());
        }
Esempio n. 3
0
        public String AsHtml(PaymentNotMatched iPaymentNotMatched)
        {
            if (iPaymentNotMatched == null)
            {
                throw new ArgumentNullException("PaymentNotMatched is null");
            }
            HtmlDocument aPaymentNotMatchedHtml = new HtmlDocument();
            // Html Structure
            HtmlNode aPaymentNotMatchedHtmlDom = HtmlNode.CreateNode("<html><head></head><body></body></html>");

            // Give to HtmlDocument a DOM structure
            aPaymentNotMatchedHtml.DocumentNode.AppendChild(aPaymentNotMatchedHtmlDom);
            // Select Html Body
            HtmlNode aPaymentNotMatchedHtmlBody = aPaymentNotMatchedHtml.DocumentNode.SelectSingleNode("//body");
            HtmlNode aPaymentNotMatchedTable    = aPaymentNotMatchedHtml.CreateElement("table");

            //Add Border to the table
            aPaymentNotMatchedTable.Attributes.Add("border", "1");
            AddTitleToHtml(aPaymentNotMatchedHtml, aPaymentNotMatchedHtmlDom);
            AddPaymentNotMatchedToHtml(aPaymentNotMatchedHtml, aPaymentNotMatchedHtmlDom, iPaymentNotMatched);
            return(aPaymentNotMatchedHtml.DocumentNode.OuterHtml);
        }
Esempio n. 4
0
        private void AddPaymentNotMatchedToHtml(HtmlDocument iPaymentNotMatchedHtml, HtmlNode iPaymentNotMatchedTable, PaymentNotMatched iPaymentNotMatched)
        {
            if (iPaymentNotMatched == null)
            {
                throw new ArgumentNullException("PaymentNotMatched is null");
            }
            HtmlNode aPaymentNotMatchedRow = iPaymentNotMatchedHtml.CreateElement("tr");

            iPaymentNotMatchedTable.ChildNodes.Append(aPaymentNotMatchedRow);
            HtmlNode aPaymentNotMatchedCustomerRow = iPaymentNotMatchedHtml.CreateElement("td");

            aPaymentNotMatchedCustomerRow.InnerHtml = iPaymentNotMatched.Customer;
            aPaymentNotMatchedRow.ChildNodes.Append(aPaymentNotMatchedCustomerRow);
            HtmlNode aPaymentNotMatchedYearRow = iPaymentNotMatchedHtml.CreateElement("td");

            aPaymentNotMatchedYearRow.InnerHtml = iPaymentNotMatched.Year.ToString();
            aPaymentNotMatchedRow.ChildNodes.Append(aPaymentNotMatchedYearRow);
            HtmlNode aPaymentNotMatchedMonthRow = iPaymentNotMatchedHtml.CreateElement("td");

            aPaymentNotMatchedMonthRow.InnerHtml = iPaymentNotMatched.Month.ToString();
            aPaymentNotMatchedRow.ChildNodes.Append(aPaymentNotMatchedMonthRow);
            HtmlNode aPaymentNotMatchedAmountRow = iPaymentNotMatchedHtml.CreateElement("td");

            aPaymentNotMatchedAmountRow.InnerHtml = iPaymentNotMatched.Amount.ToString();
            aPaymentNotMatchedRow.ChildNodes.Append(aPaymentNotMatchedAmountRow);
            HtmlNode aPaymentNotMatchedAmountDueRow = iPaymentNotMatchedHtml.CreateElement("td");

            aPaymentNotMatchedAmountDueRow.InnerHtml = iPaymentNotMatched.AmountDue.ToString();
            aPaymentNotMatchedRow.ChildNodes.Append(aPaymentNotMatchedAmountDueRow);
            HtmlNode aPaymentNotMatchedDifferenceBetweenDueAndPayedRow = iPaymentNotMatchedHtml.CreateElement("td");

            aPaymentNotMatchedDifferenceBetweenDueAndPayedRow.InnerHtml = iPaymentNotMatched.DifferenceBetweenDueAndPayed.ToString();
            aPaymentNotMatchedRow.ChildNodes.Append(aPaymentNotMatchedDifferenceBetweenDueAndPayedRow);
        }