private ArrayList constructItems()
        {
            CTaxFormPageRv3_53            page  = null;
            CTaxFormGroupBySupplierRv3_53 group = null;
            ArrayList pages = new ArrayList();

            while (true)
            {
                MVTaxFormPRV3_53 m = fetchData();
                if (m == null)
                {
                    break;
                }

                if ((page == null) || (page.GroupCount >= 6))
                {
                    page = new CTaxFormPageRv3_53();
                    pages.Add(page);
                }

                if ((group == null) || !group.Name.Equals(m.SupplierName) || (group.ItemCount >= 3))
                {
                    group = new CTaxFormGroupBySupplierRv3_53(m);
                    page.AddGroup(group);
                }

                group.AddWhItem(m);
                suppliers[m.SupplierName] = m.SupplierName;
            }

            if (pages.Count > 0)
            {
                int lastIdx = pages.Count - 1;

                CTaxFormPageRv3_53 lastPage = (CTaxFormPageRv3_53)pages[lastIdx];
                if (lastPage.GroupCount == 0)
                {
                    //Blank page
                    pages.RemoveAt(lastIdx);
                }
            }

            return(pages);
        }
Exemplo n.º 2
0
 public void AddGroup(CTaxFormGroupBySupplierRv3_53 grp)
 {
     groups.Add(grp);
 }