Beispiel #1
0
        public JsonResult ApplyTempData()
        {
            MSGReturnModel <IEnumerable <ITreaItem> > result = new MSGReturnModel <IEnumerable <ITreaItem> >();

            result.RETURN_FLAG = false;
            var _detail = (List <CAViewModel>)Cache.Get(CacheList.CAData);

            if (!_detail.Any())
            {
                result.DESCRIPTION = "無申請任何資料";
            }
            else if (Cache.IsSet(CacheList.TreasuryAccessViewData))
            {
                TreasuryAccessViewModel data = (TreasuryAccessViewModel)Cache.Get(CacheList.TreasuryAccessViewData);
                var _data = (List <CAViewModel>)Cache.Get(CacheList.CAData);
                if (data.vAccessType == Ref.AccessProjectTradeType.G.ToString() && !_data.Any(x => x.vtakeoutFlag))
                {
                    result.DESCRIPTION = "無申請任何資料";
                }
                else
                {
                    result = CA.ApplyAudit(_data, data);
                    if (result.RETURN_FLAG && !data.vAplyNo.IsNullOrWhiteSpace())
                    {
                        new TreasuryAccessController().ResetSearchData();
                    }
                }
            }
            else
            {
                result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription();
            }
            return(Json(result));
        }