private MVTaxFormPRV1 fetchData()
        {
            if (currIdx >= arr.Count)
            {
                CTable t = new CTable("");

                t.SetFieldValue("TAX_DOC_ID", actualView.TaxDocID);
                t.SetFieldValue("EXT_CHUNK_NO", chunk.ToString());
                arr = OnixWebServiceAPI.GetListAPI("GetTaxDocRv3Rv53List", "TAX_DOC_REV_LIST", t);

                CTable lastObj = OnixWebServiceAPI.GetLastObjectReturned();
                chunkCount  = CUtil.StringToInt(lastObj.GetFieldValue("EXT_CHUNK_COUNT"));
                recordCount = CUtil.StringToInt(lastObj.GetFieldValue("EXT_RECORD_COUNT"));

                currIdx = 0;
                chunk++;
            }

            if (arr.Count > 0)
            {
                CTable o = (CTable)arr[currIdx];
                currIdx++;
                currRecord++;

                MVTaxFormPRV1 m = new MVTaxFormPRV1(o);
                return(m);
            }

            return(null);
        }
        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);
        }
Example #3
0
 public void AddWhItem(MVTaxFormPRV1 item)
 {
     whItems.Add(item);
 }
Example #4
0
 public CTaxFormGroupByEmployeeRv1(MVTaxFormPRV1 firstItem)
 {
     groupRep = firstItem;
 }