Exemple #1
0
        public JsonResult GetItemBook(int groupNo, string aplyNo)
        {
            MSGReturnModel <StockDetailViewModel> result = new MSGReturnModel <StockDetailViewModel>();

            result.RETURN_FLAG = false;
            result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription();
            if (groupNo == 0 && Cache.IsSet(CacheList.StockMainData))
            {
                var data = (StockDetailViewModel)Cache.Get(CacheList.StockMainData);
                result.RETURN_FLAG = true;
            }
            else if (groupNo == -1)
            {
                Cache.Invalidate(CacheList.StockMainData);
                Cache.Set(CacheList.StockMainData, new List <StockDetailViewModel>());
                result.RETURN_FLAG = false;
            }
            else
            {
                if (Cache.IsSet(CacheList.TreasuryAccessViewData))
                {
                    TreasuryAccessViewModel viewdata = (TreasuryAccessViewModel)Cache.Get(CacheList.TreasuryAccessViewData);
                    var _data = Stock.GetDataByGroupNo(groupNo, viewdata.vAplyUnit, aplyNo);
                    Cache.Invalidate(CacheList.StockMainData);
                    Cache.Invalidate(CacheList.StockTempData);
                    Cache.Set(CacheList.StockMainData, _data);
                    Cache.Set(CacheList.StockTempData, new List <StockDetailViewModel>());
                    result.RETURN_FLAG = true;
                }
            }
            return(Json(result));
        }