Exemplo n.º 1
0
        private List <IInsurer> GetInsurers()
        {
            List <IInsurer> returnItems;

            if (Cache.Contains("InsurersData"))
            {
                returnItems = (List <IInsurer>)Cache.Get("InsurersData");
            }
            else
            {
                var list      = new SharePointList(Settings.Default.SharePointContextUrl, Settings.Default.ApprovedInsurersListName, BusinessLogic.Helpers.Constants.SharePointQueries.AllItemsSortByTitle);
                var presenter = new SharePointListPresenter(list, this);
                returnItems = presenter.GetInsurers();
                Cache.Add("InsurersData", returnItems, new CacheItemPolicy());
            }

            return(returnItems);
        }
Exemplo n.º 2
0
        private List <IInsurer> GetInsurers()
        {
            List <IInsurer> returnItems;

            if (Cache.Contains("InsurersData"))
            {
                returnItems = (List <IInsurer>)Cache.Get("InsurersData");
            }
            else
            {
                var list = new SharePointList(Settings.Default.SharePointContextUrl,
                                              Settings.Default.ApprovedInsurersListName);
                var presenter = new SharePointListPresenter(list, this);
                returnItems = presenter.GetInsurers();
                Cache.Add("InsurersData", returnItems, new CacheItemPolicy());
            }

            return(returnItems);
        }
Exemplo n.º 3
0
        private List <IInsurer> GetInsurers(string type)
        {
            List <IInsurer> returnItems;

            if (Cache.Contains(type))
            {
                returnItems = (List <IInsurer>)Cache.Get(type);
            }
            else
            {
                var list      = new SharePointList(Settings.Default.SharePointContextUrl, Settings.Default.ApprovedInsurersListName, Constants.SharePointQueries.AllItemsSortByTitle);
                var presenter = new SharePointListPresenter(list, this);
                returnItems = presenter.GetInsurers();

                if (!type.Equals(Constants.CacheNames.NoCache))
                {
                    Cache.Add(type, returnItems, new CacheItemPolicy());
                }
            }

            return(returnItems);
        }