Exemple #1
0
        private void searchDeleghe(SearchDelegaInfo searchInfo)
        {
            this.SearchDelegheMemento = searchInfo;
            SearchPagingContext pagingContext = new SearchPagingContext();

            pagingContext.PageSize = this.gridViewResult.PageSize;
            pagingContext.Page     = this.SelectedPage;
            this.ListaDeleghe      = DelegheManager.SearchDeleghe(this, searchInfo, ref pagingContext);
            this.BindGridAndSelect(searchInfo.TipoDelega, searchInfo.StatoDelega);
            this.buildGridNavigator(pagingContext);
        }
Exemple #2
0
        public PagingQuery(string countQueryName, string queryName, SearchPagingContext pagingContext, Dictionary <string, string> paramList, string orderField, bool desc)
        {
            Query countQuery = DocsPaUtils.InitQuery.getInstance().getQuery(countQueryName);

            addParams(countQuery, paramList);
            string countCommandText = countQuery.getSQL();

            logger.Debug("COUNT QUERY: " + countCommandText);
            string field    = "";
            int    retValue = 0;

            if (databaseProvider.ExecuteScalar(out field, countCommandText))
            {
                Int32.TryParse(field, out retValue);
                pagingContext.RecordCount = retValue;
            }
            int pageSize = pagingContext.PageSize;

            _query = DocsPaUtils.InitQuery.getInstance().getQuery(queryName);
            addParams(_query, paramList);
            // per query sqlserver:
            // il numero totale di righe da estrarre equivale
            // al limite inferiore dell'ultima riga da estrarre
            int totalRowsSqlServer = (pagingContext.PageSize * pagingContext.Page);

            if ((retValue - totalRowsSqlServer) <= 0)
            {
                pageSize -= System.Math.Abs(retValue - totalRowsSqlServer);
            }
            _query.setParam("pageSize", "" + pageSize);
            _query.setParam("rowNum", "" + pagingContext.PageSize * pagingContext.Page);
            if (!string.IsNullOrEmpty(orderField))
            {
                if (desc)
                {
                    _query.setParam("order_desc", orderField);
                    _query.setParam("order", orderField + " DESC");
                }
                else
                {
                    _query.setParam("order", orderField);
                    _query.setParam("order_desc", orderField + " DESC");
                }
            }
            //parametri specifici per ORACLE
            _query.setParam("startRow", "" + pagingContext.StartRow);
            _query.setParam("endRow", "" + pagingContext.EndRow);
        }
Exemple #3
0
 //MODELLI DI DELEGA
 public static DocsPAWA.DocsPaWR.ModelloDelega[] GetModelliDelega(Page page, SearchModelloDelegaInfo searchInfo, ref SearchPagingContext pagingContext)
 {
     DocsPAWA.DocsPaWR.ModelloDelega[] res = null;
     try
     {
         DocsPAWA.DocsPaWR.InfoUtente infoUtente = UserManager.getInfoUtente(page);
         infoUtente = UserManager.getInfoUtente(page);
         res        = docsPaWS.SearchModelliDelega(infoUtente, searchInfo, ref pagingContext);
     }
     catch (Exception es)
     {
         ErrorManager.redirect(page, es);
     }
     return(res);
 }
Exemple #4
0
        public static DocsPAWA.DocsPaWR.InfoDelega[] SearchDeleghe(Page page, SearchDelegaInfo searchInfo, ref SearchPagingContext pagingContext)
        {
            DocsPAWA.DocsPaWR.InfoDelega[] deleghe = null;
            try
            {
                DocsPAWA.DocsPaWR.InfoUtente infoUtente = null;
                if (searchInfo.TipoDelega != "tutte")
                {
                    infoUtente = UserManager.getInfoUtente(page);
                }

                deleghe = docsPaWS.DelegaSearch(infoUtente, searchInfo, ref pagingContext);
                if (deleghe == null)
                {
                    throw new Exception();
                }
                return(deleghe);
            }
            catch (Exception es)
            {
                ErrorManager.redirect(page, es);
            }
            return(deleghe);
        }
Exemple #5
0
 public static List <InfoDelega> searchDeleghe(DocsPaVO.utente.InfoUtente infoUtente, SearchDelegaInfo searchInfo, SearchPagingContext pagingContext)
 {
     DocsPaDB.Query_DocsPAWS.Deleghe d = new DocsPaDB.Query_DocsPAWS.Deleghe();
     if (string.IsNullOrEmpty(searchInfo.NomeDelegato) && string.IsNullOrEmpty(searchInfo.NomeDelegante))
     {
         return(d.searchDeleghe(infoUtente, searchInfo, pagingContext));
     }
     else
     {
         InfoDelegaMatcher matcher = new InfoDelegaMatcher(searchInfo);
         List <InfoDelega> temp    = d.searchDeleghe(infoUtente, searchInfo).FindAll(matcher.Match);
         pagingContext.RecordCount = temp.Count;
         List <InfoDelega> result = new List <InfoDelega>(temp.Skip(pagingContext.StartRow - 1).Take(pagingContext.PageSize));
         return(result);
     }
 }
Exemple #6
0
        public List <ModelloDelega> searchModelliDelegaPaging(DocsPaVO.utente.InfoUtente utente, List <Ruolo> ruoli, SearchModelloDelegaInfo searchInfo, SearchPagingContext pagingContext)
        {
            string idPeople   = utente.idPeople;
            string conditions = buildConditions(searchInfo);
            Dictionary <string, string> paramList = new Dictionary <string, string>();

            paramList.Add("idUtente", idPeople);
            paramList.Add("param1", conditions);
            PagingQuery pagingQuery = new PagingQuery("S_COUNT_MODELLI_DELEGA", "S_GET_MODELLI_DELEGA_PAGING", pagingContext, paramList);
            string      commandText = pagingQuery.Query.getSQL();

            logger.Debug("QUERY : " + commandText);
            DataSet ds = new DataSet();

            ExecuteQuery(ds, commandText);
            List <ModelloDelega> res = new List <ModelloDelega>();

            if (ds.Tables[0].Rows.Count != 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    ModelloDelega temp = buildModelloDelega(ds.Tables[0].Rows[i], ruoli);
                    res.Add(temp);
                }
            }
            return(res);
        }
Exemple #7
0
        public static DocsPaWR.InfoDelega[] SearchDeleghe(Page page, SearchDelegaInfo searchInfo, ref SearchPagingContext pagingContext)
        {
            DocsPaWR.InfoUtente infoUtente = null;
            if (searchInfo.TipoDelega != "tutte")
            {
                infoUtente = UserManager.GetInfoUser();
            }

            DocsPaWR.InfoDelega[] deleghe = docsPaWS.DelegaSearch(infoUtente, searchInfo, ref pagingContext);
            //if (deleghe == null)
            //{
            //    throw new Exception();
            //}
            return(deleghe);
        }
Exemple #8
0
 public PagingQuery(string countQueryName, string queryName, SearchPagingContext pagingContext, Dictionary <string, string> paramList)
     : this(countQueryName, queryName, pagingContext, paramList, null, false)
 {
 }
Exemple #9
0
        public static List <ModelloDelega> searchModelliDelega(DocsPaVO.utente.InfoUtente utente, SearchModelloDelegaInfo searchInfo, SearchPagingContext pagingContext)
        {
            List <Ruolo> ruoli      = UserManager.getRuoliUtente(utente.idPeople).Cast <Ruolo>().ToList();
            ModDeleghe   modDeleghe = new ModDeleghe();

            if (!searchInfo.StatoModelloDelegaSpec)
            {
                return(modDeleghe.searchModelliDelegaPaging(utente, ruoli, searchInfo, pagingContext));
            }
            else
            {
                StatoModelloDelegaMatcher matcher = new StatoModelloDelegaMatcher(searchInfo.StatoModelloDelega);
                List <ModelloDelega>      temp    = modDeleghe.searchModelliDelega(utente, ruoli, searchInfo).FindAll(matcher.Match);
                pagingContext.RecordCount = temp.Count;
                List <ModelloDelega> result = new List <ModelloDelega>(temp.Skip(pagingContext.StartRow - 1).Take(pagingContext.PageSize));
                return(result);
            }
        }