Exemple #1
0
        /// <summary>
        /// 获取刚发布的公文
        /// </summary>
        /// <returns></returns>
        public List <V_SystemNotice> RefreshSendDocData(string employeeid, int pageIndex
                                                        , int pageSize, ref int pageCount, ref int DataCount, List <string> postIDs
                                                        , List <string> companyIDs, List <string> departmentIDs
                                                        , ref bool NeedGetNewData, bool NeedAllData
                                                        , string filterString, List <object> paras, string Doctitle)
        {
            if (NeedAllData)//强制获取所有数据
            {
                NeedGetNewData = true;
            }
            else
            {
                //否则通过读取缓存判断是否需要获取更新数据,否的话直接返回null;
                try
                {
                    var obj = MemCacheClient.Get(employeeid + "SendDocMent");
                    if (obj == null)
                    {
                        NeedGetNewData = false;
                        return(null);
                    }
                    else
                    {
                        //Tracer.Debug("从MemCached获取到新的公司发文数据,Key" + employeeid + "SendDocMent");
                        NeedGetNewData = true;
                        MemCacheClient.Remove(employeeid + "SendDocMent");
                    }
                }
                catch (Exception ex)
                {
                    Tracer.Debug("公司发文获取缓存对象失败:" + ex.ToString());
                }
            }

            try
            {
                //Tracer.Debug("公司发文中查询的内容:" + Doctitle );
                IQueryable <V_SystemNotice> ent = GetHouseAndNoticeInfoToMobile(pageIndex, pageSize, ref pageCount, ref DataCount, employeeid
                                                                                , postIDs, companyIDs, departmentIDs, filterString, paras, Doctitle);
                return(ent != null?ent.ToList() : null);
            }
            catch (Exception ex)
            {
                Tracer.Debug("房源管理HouseInfoManagerBll-GetHouseAndNoticeInfo" + System.DateTime.Now.ToString() + " " + ex.ToString());
                return(null);
            }
        }
		public void TestNullKeyRemove()
		{
			ICache cache = new MemCacheClient();
			Assert.Throws<ArgumentNullException>(() => cache.Remove(null));
		}
        public void TestNullKeyRemove()
        {
            ICache cache = new MemCacheClient();

            Assert.Throws <ArgumentNullException>(() => cache.Remove(null));
        }