Esempio n. 1
0
        public OutWareCheckData GetOutWareCheckData(string billNo)
        {
            OutWareCheckData outWareCheckData = null;

            if (!string.IsNullOrEmpty(billNo))
            {
                outWareCheckData = this.Get <OutWareCheckData>(billNo);
            }
            if (outWareCheckData == null)
            {
                object lockItem = lockObjDic.GetOrAdd(billNo, new object());
                lock (lockItem)
                {
                    outWareCheckData = this.Get <OutWareCheckData>(billNo);
                    if (outWareCheckData == null)
                    {
                        //CacheItemPolicy policy = new CacheItemPolicy();
                        //policy.SlidingExpiration = new TimeSpan(0, 60, 0); //60分钟内不访问自动剔除
                        LibBcfData ppWorkOrderBcf = (LibBcfData)LibBcfSystem.Default.GetBcfInstance("qc.OwQualityCheck");
                        DataSet    ds             = ppWorkOrderBcf.BrowseTo(new object[] { billNo });
                        outWareCheckData = new OutWareCheckData(ds);
                        this.Set(billNo, outWareCheckData, new TimeSpan(0, 60, 0));
                    }
                }
            }
            return(outWareCheckData);
        }
Esempio n. 2
0
        private static Boolean SetOutWareCheckInfo(string billNo)
        {
            Boolean          ret         = false;
            OutWareCheckData produceData = LibOutWareCheckCache.Default.GetOutWareCheckData(billNo);

            if (produceData != null)
            {
                ret = true;
            }
            return(ret);
        }