private ArrayList constructItems()
        {
            CTaxFormPageRv1            page  = null;
            CTaxFormGroupByEmployeeRv1 group = null;
            ArrayList pages = new ArrayList();

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

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

                group = new CTaxFormGroupByEmployeeRv1(m);
                page.AddGroup(group);

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

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

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

            return(pages);
        }
示例#2
0
 public void AddGroup(CTaxFormGroupByEmployeeRv1 grp)
 {
     groups.Add(grp);
 }