Ejemplo n.º 1
0
        private static Boolean SetPurCheckInfo(string billNo)
        {
            Boolean      ret         = false;
            PurCheckData produceData = LibPurCheckCache.Default.GetPurCheckData(billNo);

            if (produceData != null)
            {
                ret = true;
            }
            return(ret);
        }
Ejemplo n.º 2
0
        public PurCheckData GetPurCheckData(string billNo)
        {
            PurCheckData purCheckData = null;

            byte[] mybyte = this.StringGetBytes(billNo);
            if (mybyte != null)
            {
                purCheckData = (PurCheckData)RetrieveObjectex(mybyte);
            }


            if (purCheckData == null)
            {
                object lockItem = lockObjDic.GetOrAdd(billNo, new object());
                lock (lockItem)
                {
                    mybyte = this.StringGetBytes(billNo);
                    if (mybyte != null)
                    {
                        purCheckData = (PurCheckData)RetrieveObjectex(mybyte);
                    }
                    //  purCheckData = this.Get< PurCheckData>(billNo)  ;
                    if (purCheckData == null)
                    {
                        //CacheItemPolicy policy = new CacheItemPolicy();
                        //policy.SlidingExpiration = new TimeSpan(0, 60, 0); //60分钟内不访问自动剔除
                        LibBcfData ppWorkOrderBcf = (LibBcfData)LibBcfSystem.Default.GetBcfInstance("qc.PurQualityCheck");
                        DataSet    ds             = ppWorkOrderBcf.BrowseTo(new object[] { billNo });
                        purCheckData = new PurCheckData(ds);
                        this.Set(billNo, purCheckData, new TimeSpan(0, 720, 0));


                        //   byte[] binaryDataResult = GetBinaryFormatData(purCheckData);
                        //   Default.StringSetBytes(billNo, binaryDataResult, new TimeSpan(0, 30, 0));
                    }
                }
            }
            return(purCheckData);
        }