Exemplo n.º 1
0
        public JsonResult UpdateAplyNo(TreasuryAccessViewModel data)
        {
            var cdata = (TreasuryAccessViewModel)Cache.Get(CacheList.TreasuryAccessSearchUpdateViewData);

            if (AccountController.CustodianFlag)
            {
                cdata.vAccessReason       = data.vAccessReason;
                cdata.vExpectedAccessDate = data.vExpectedAccessDate;
                cdata.vAplyUnit           = data.vAplyUnit;
                cdata.vAplyUid            = data.vAplyUid;
            }
            else
            {
                cdata.vAccessReason       = data.vAccessReason;
                cdata.vExpectedAccessDate = data.vExpectedAccessDate;
            }
            var searchData = (TreasuryAccessSearchViewModel)Cache.Get(CacheList.TreasuryAccessSearchData);
            var result     = TreasuryAccess.updateAplyNo(cdata, AccountController.CustodianFlag, searchData);

            if (result.RETURN_FLAG)
            {
                var data1 = TreasuryAccess.GetByAplyNo(cdata.vAplyNo);
                Cache.Invalidate(CacheList.TreasuryAccessSearchUpdateViewData);
                Cache.Set(CacheList.TreasuryAccessSearchUpdateViewData, data1);
                var data2 = TreasuryAccess.GetTreasuryAccessViewModel(cdata.vAplyNo);
                Cache.Invalidate(CacheList.TreasuryAccessViewData);
                Cache.Set(CacheList.TreasuryAccessViewData, data2);
                Cache.Invalidate(CacheList.TreasuryAccessSearchDetailViewData);
                Cache.Set(CacheList.TreasuryAccessSearchDetailViewData, result.Datas);
            }
            return(Json(result));
        }