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)); }
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)); }
public JsonResult ChangeUnit(string DPT_CD) { var data = TreasuryAccess.ChangeUnit(DPT_CD); if (DPT_CD == Properties.Settings.Default["CustodianFlag"]?.ToString()) { data = data.Where(x => x.Value == AccountController.CurrentUserId).ToList(); } else { data.Insert(0, new SelectOption() { Text = string.Empty, Value = string.Empty }); } return(Json(data)); }