Esempio 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));
        }
        public JsonResult GetByAplyNo(string AplyNo)
        {
            MSGReturnModel <Tuple <TreasuryAccessViewModel, bool, List <SelectOption>, List <SelectOption>, bool> > result =
                new MSGReturnModel <Tuple <TreasuryAccessViewModel, bool, List <SelectOption>, List <SelectOption>, bool> >();

            result.RETURN_FLAG = false;
            if (!AplyNo.IsNullOrWhiteSpace())
            {
                result.RETURN_FLAG = true;
                var _dActType = GetActType(Ref.OpenPartialViewType.CustodyAppr, AplyNo);
                var data      = TreasuryAccess.GetByAplyNo(AplyNo);
                Cache.Invalidate(CacheList.TreasuryAccessSearchUpdateViewData);
                Cache.Set(CacheList.TreasuryAccessSearchUpdateViewData, data);
                var depts = ((TreasuryAccessCustody)TreasuryAccessCustody).GetDepts();
                List <SelectOption> selectOptionsUnit = new List <SelectOption>()
                {
                    new SelectOption()
                    {
                        Value = data.vAplyUnit, Text = depts.FirstOrDefault(x => x.DPT_CD?.Trim() == data.vAplyUnit)?.DPT_NAME?.Trim()
                    }
                };
                List <SelectOption> selectOptionsUid = TreasuryAccess.ChangeUnit(data.vAplyUnit);
                result.Datas = new Tuple <TreasuryAccessViewModel, bool, List <SelectOption>, List <SelectOption>, bool>(data, AccountController.CustodianFlag, selectOptionsUnit, selectOptionsUid, _dActType);
            }
            return(Json(result));
        }
Esempio n. 3
0
        public JsonResult GetByAplyNo(string AplyNo)
        {
            MSGReturnModel <Tuple <TreasuryAccessViewModel, bool, List <SelectOption>, List <SelectOption>, bool> > result =
                new MSGReturnModel <Tuple <TreasuryAccessViewModel, bool, List <SelectOption>, List <SelectOption>, bool> >();

            result.RETURN_FLAG = false;
            if (!AplyNo.IsNullOrWhiteSpace())
            {
                result.RETURN_FLAG = true;
                var _dActType = GetActType(Ref.OpenPartialViewType.TAIndex, AplyNo);
                var data      = TreasuryAccess.GetByAplyNo(AplyNo);
                Cache.Invalidate(CacheList.TreasuryAccessSearchUpdateViewData);
                Cache.Set(CacheList.TreasuryAccessSearchUpdateViewData, data);
                var selectOptions = TreasuryAccess.TreasuryAccessDetail(data.vCreateUid_Id,
                                                                        data.vCreateUnit_Id == (Properties.Settings.Default["CustodianFlag"]?.ToString()),
                                                                        data.vAplyUnit);
                List <SelectOption> selectOptionsAppr = new List <SelectOption>();
                selectOptionsAppr = TreasuryAccess.ChangeUnit(data.vAplyUnit);
                //item1 = 申請單資料
                //item2 = 是否為保管科
                //item3 = 申請科別
                //item4 = 申請人
                //item5 = 是否有權限可以修改申請單
                result.Datas = new Tuple <TreasuryAccessViewModel, bool, List <SelectOption>, List <SelectOption>, bool>(data, AccountController.CustodianFlag, selectOptions.Item2, selectOptionsAppr, _dActType);
            }
            return(Json(result));
        }