Exemplo n.º 1
0
        private void loopThroughProc()
        {
            int    errorCode = 0;
            string errorMsg  = "";
            var    dao       = new DocumentProcDAO();
            //startIndex = 0;

            int noOfFetches = 0;
            int totRec      = 1000;

            while (true)
            {
                noOfFetches++;
                this.log.Debug("Doing fetch :" + noOfFetches + "  :  " + totRec);

                this.resultTable = dao.GetDocuments(this.startIndex, out this.totalDoc, out errorCode, out errorMsg);


                if (errorCode != 0 || this.totalDoc == 0)
                {
                    MessageBox.Show("No Documents found :" + errorMsg);
                    return;
                }
                this.resultBindingSource.DataSource = this.resultTable;
                totRec += this.resultBindingSource.Count;
                this.resultBindingSource.MoveLast();
                DataRowView view = (DataRowView)this.resultBindingSource.Current;
                this.startIndex = Utilities.GetIntegerValue(view.Row.ItemArray[0]);
            }
        }
Exemplo n.º 2
0
        private void Next_Click(object sender, EventArgs e)
        {
            int    errorCode = 0;
            string errorMsg  = "";
            var    dao       = new DocumentProcDAO();

            getLastIndex();
            //resultTable = dao.GetDocuments(startIndex, out totalDoc, out errorCode, out errorMsg);
            List <PawnDocRegVO> docList = null;
            int pendCount = 0;

            this.Enabled = false;
            if (Properties.Settings.Default.TempFetch)
            {
                DocumentDAO.getInstance().GetTempGetDocsIDs_ForAdd(ref docList, 20000, false, startIndex);
            }
            else
            {
                DocumentDAO.getInstance().GetDocumentSets(startIndex, out docList, out pendCount, out errorCode, out errorMsg);
            }

            this.Enabled = true;
            if (errorCode != 0 || totalDoc == 0)
            {
                MessageBox.Show("No Documents found :" + errorMsg);
                return;
            }
            resultTable = CouchConsoleApp.thread.ThreadForDocList.getDataTableFromVO(docList);
            this.resultBindingSource.DataSource = resultTable;

            //enable below for continues looping of proc
            //loopThroughProc();
        }