Example #1
0
        //confluito in getbyparams
        //public IList<RubricaContatti> GetContattiOrgByName(string nomeEntita)
        //{
        //    throw new NotImplementedException();
        //}

        public ResultList <RubricaContatti> GetContattiByParams(List <EntitaType> tEnt, Dictionary <SendMail.Model.FastIndexedAttributes, List <string> > pars, int da, int per, bool withEntita, bool withIPA)
        {
            ResultList <RubricaContatti> res = null;

            using (ContattoSQLDb dao = new ContattoSQLDb())
            {
                res = dao.LoadContattiByParams(tEnt, pars, da, per, withEntita);
                if (withIPA)
                {
                    ResultList <RubricaContatti> resIPA = dao.LoadContattiIPAByParams(tEnt, pars, da, per, withEntita);
                    if (resIPA != null)
                    {
                        if (res == null)
                        {
                            res = new ResultList <RubricaContatti>();
                        }
                        res.Totale += resIPA.Totale;
                        res.Per     = (per > res.Totale) ? res.Totale : per;
                    }
                }
            }
            return(res);
        }