Exemple #1
0
        public void Text()
        {
            var rows = new ReportRows(RowsXML(), null);

            Assert.AreEqual(1, rows.Text.Count());
            Assert.AreEqual("TextRow", rows.Text.First().Type);
        }
Exemple #2
0
        public void Subtotal()
        {
            var rows = new ReportRows(RowsXML(), null);

            Assert.AreEqual(1, rows.Subtotal.Count());
            Assert.AreEqual("SubtotalRow", rows.Subtotal.First().Type);
        }
Exemple #3
0
        public void Data()
        {
            var rows = new ReportRows(RowsXML(), null);

            Assert.AreEqual(1, rows.Data.Count());
            Assert.AreEqual("DataRow", rows.Data.First().Type);
        }
Exemple #4
0
        public void AddDataRows(IList <string> reportText)
        {
            if (reportText == null)
            {
                return;
            }

            var dataRows = reportText.Select(x => LeasePakReportRowFactory.Create <CashReceiptsReportRow>(x, GetColumnSplitIndices())).ToList();

            dataRows.ForEach(x => ReportRows.Add(x));
        }
        public void AddDataRows(IList <string> parsedText)
        {
            var dataRows = parsedText.Select(x => LeasePakReportRowFactory.Create <PreAuthorizedPaymentReportRow>(x, GetColumnSplitIndices())).ToList();

            foreach (var row in dataRows)
            {
                var corporateCostCenter = LeaseRepository.GetCorporateCostCenterByLeaseNumber(row.GetLeaseNumber());
                row.SetCorporateCostCenter(corporateCostCenter);

                var lesseeName = LesseeRepository.GetLesseeNameFromLesseeNumber(row.GetLesseeNumber());
                row.SetLesseeName(lesseeName);
            }

            dataRows.ForEach(x => ReportRows.Add(x));
        }
        public async Task <ReportRows> Translate(string content)
        {
            var a = new XmlDocument();

            a.LoadXml(content);

            var resp = new ReportRows();

            foreach (XmlNode node in a.DocumentElement.ChildNodes)
            {
                var row  = new Row();
                var dict = new Dictionary <string, object>();
                for (int i = 0; i < node.ChildNodes.Count; i++)
                {
                    var col = node.ChildNodes[i];
                    dict.Add($"Column{i}", col.InnerText);
                }

                row.Columns = dict;
                resp.Rows.Add(row);
            }
            resp.Rows = resp.Rows.Take(10).ToList();
            return(resp);
        }