Example #1
0
        private void LoadData(bool updateGrid)
        {
            SearchResultInfo[]  idProfileList;
            DocsPaWR.InfoUtente infoUt = new DocsPAWA.DocsPaWR.InfoUtente();
            infoUt      = UserManager.getInfoUtente(this);
            ListaFiltri = DocumentManager.getFiltroRicDoc(this);
            if (!this.chk_ADL.Checked == true)
            {
                infoDoc = DocumentManager.getQueryInfoDocumentoPaging(infoUt.idGruppo, infoUt.idPeople, this, this.ListaFiltri, currentPage, out numTotPage, out nRec, true, false, true, false, out idProfileList);

                //Controllo inserito per non far visualizzare se stesso
                DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumentoLav = DocumentManager.getDocumentoInLavorazione();
                if (schedaDocumentoLav != null)
                {
                    List <DocsPaWR.InfoDocumento> tempDoc = new List <DocsPaWR.InfoDocumento>();
                    tempDoc = infoDoc.ToList <DocsPaWR.InfoDocumento>();
                    foreach (DocsPaWR.InfoDocumento infDocTemp in infoDoc)
                    {
                        if (infDocTemp.docNumber == schedaDocumentoLav.docNumber)
                        {
                            tempDoc.Remove(infDocTemp);
                            break;
                        }
                    }
                    infoDoc = tempDoc.ToArray();
                }
                //FINE CONTROLLO INSERIMENTO PER NON FAR VISUALIZZARE SE STESSO
            }
            else
            {
                DocsPaWR.AreaLavoro areaLavoro = DocumentManager.getListaAreaLavoro(this, "G", "1", currentPage, out numTotPage, out nRec, UserManager.getRegistroSelezionato(this).systemId);

                infoDoc = new DocsPAWA.DocsPaWR.InfoDocumento[areaLavoro.lista.Length];

                for (int i = 0; i < areaLavoro.lista.Length; i++)
                {
                    infoDoc[i] = (DocsPAWA.DocsPaWR.InfoDocumento)areaLavoro.lista[i];
                }
            }


            this.lbl_countRecord.Visible = true;
            this.lbl_countRecord.Text    = "Documenti tot:  " + nRec;

            this.DataGrid1.VirtualItemCount = nRec;
            this.DataGrid1.CurrentPageIndex = currentPage - 1;

            //appoggio il risultato in sessione
            //Session["RicercaProtocolliUscita.ListaInfoDoc"] =infoDoc;
            RicercaNonProtocollatiSessionMng.SetListaInfoDocumenti(this, infoDoc);

            if (infoDoc != null && infoDoc.Length > 0)
            {
                this.BindGrid(infoDoc);
            }
        }