예제 #1
0
        public HYProduceData GetProduceData(string billNo)
        {
            HYProduceData produceData = null;

            if (!string.IsNullOrEmpty(billNo))
            {
                produceData = this.Get <HYProduceData>(billNo);
            }
            if (produceData == null)
            {
                object lockItem = _lockObjDic.GetOrAdd(billNo, new object());
                lock (lockItem)
                {
                    produceData = this.Get <HYProduceData>(billNo);
                    if (produceData == null)
                    {
                        //CacheItemPolicy policy = new CacheItemPolicy();
                        //policy.SlidingExpiration = new TimeSpan(0, 720, 0); //720分钟内不访问自动剔除
                        LibBcfGrid        ppWorkOrderBcf = (LibBcfGrid)LibBcfSystem.Default.GetBcfInstance("pp.TenWorkRecord");
                        LibQueryCondition lb             = new LibQueryCondition();
                        lb.QueryFields.Add(new LibQueryField()
                        {
                            Name = "WORKORDERNO", QueryChar = LibQueryChar.Equal, Value = new List <object> {
                                billNo
                            }
                        });
                        DataSet ds = ppWorkOrderBcf.BrowseTo(lb);
                        //DataSet ds = ppWorkOrderBcf.BrowseTo(new object[] { billNo });
                        produceData = new HYProduceData(ds);
                        this.Set(billNo, produceData, new TimeSpan(0, 720, 0));
                    }
                }
            }
            return(produceData);
        }
예제 #2
0
 private static void SetWorkProcessInfo(string billNo)
 {
     HYProduceData produceData = LibHYProduceCache.Default.GetProduceData(billNo);
 }