public ActionResult View(string AplyNo, TreasuryAccessViewModel data, Ref.OpenPartialViewType type) { ViewBag.OPVT = type; var _dActType = GetActType(type, AplyNo); ViewBag.MarginpType = new SelectList(Marginp.GetMarginp_Take_Of_Type(), "Value", "Text"); ViewBag.MarginpItem = new SelectList(Marginp.GetMarginpItem(), "Value", "Text"); ViewBag.CustodianFlag = AccountController.CustodianFlag; if (AplyNo.IsNullOrWhiteSpace()) { Cache.Invalidate(CacheList.TreasuryAccessViewData); Cache.Set(CacheList.TreasuryAccessViewData, data); resetMarginpViewModel(data.vAccessType); } else { ViewBag.dAccess = TreasuryAccess.GetAccessType(AplyNo); var viewModel = TreasuryAccess.GetTreasuryAccessViewModel(AplyNo); Cache.Invalidate(CacheList.TreasuryAccessViewData); Cache.Set(CacheList.TreasuryAccessViewData, viewModel); resetMarginpViewModel(viewModel.vAccessType, AplyNo, _dActType); } ViewBag.dActType = _dActType; return(PartialView()); }
public ActionResult View(string AplyNo, TreasuryAccessViewModel data, Ref.OpenPartialViewType type) { ViewBag.OPVT = type; ViewBag.dStock_Area_Type = new SelectList(Stock.GetAreaType(), "Value", "Text"); ViewBag.dStock_Type = new SelectList(Stock.GetStockType(), "Value", "Text"); ViewBag.CustodianFlag = AccountController.CustodianFlag; var _dActType = GetActType(type, AplyNo); if (AplyNo.IsNullOrWhiteSpace()) { if (data.vAccessType == Ref.AccessProjectTradeType.P.ToString()) { ViewBag.dStock_Name = new SelectList(Stock.GetStockName(), "Value", "Text"); } else if (data.vAccessType == Ref.AccessProjectTradeType.G.ToString()) { ViewBag.dStock_Name = new SelectList(Stock.GetStockName(data.vAplyUnit), "Value", "Text"); } Cache.Invalidate(CacheList.TreasuryAccessViewData); Cache.Set(CacheList.TreasuryAccessViewData, data); resetStockViewModel(); } else { ViewBag.dAccess = TreasuryAccess.GetAccessType(AplyNo); var viewModel = TreasuryAccess.GetTreasuryAccessViewModel(AplyNo); if (viewModel.vAccessType == Ref.AccessProjectTradeType.P.ToString()) { ViewBag.dStock_Name = new SelectList(Stock.GetStockName(), "Value", "Text"); } else if (viewModel.vAccessType == Ref.AccessProjectTradeType.G.ToString() && _dActType) { ViewBag.dStock_Name = new SelectList(Stock.GetStockName(viewModel.vAplyUnit, AplyNo), "Value", "Text"); } else if (viewModel.vAccessType == Ref.AccessProjectTradeType.G.ToString() && !_dActType) { ViewBag.dStock_Name = new SelectList(Stock.GetStockName(viewModel.vAplyUnit), "Value", "Text"); } Cache.Invalidate(CacheList.TreasuryAccessViewData); Cache.Set(CacheList.TreasuryAccessViewData, viewModel); resetStockViewModel(AplyNo); var _data = (StockViewModel)Cache.Get(CacheList.StockData); ViewBag.group = _data.vStockDate.GroupNo; } ViewBag.dActType = _dActType; return(PartialView()); }
public ActionResult View(string AplyNo, TreasuryAccessViewModel data, Ref.OpenPartialViewType type) { ViewBag.OPVT = type; var _dActType = GetActType(type, AplyNo); if (AplyNo.IsNullOrWhiteSpace()) { Cache.Invalidate(CacheList.TreasuryAccessViewData); Cache.Set(CacheList.TreasuryAccessViewData, data); resetSealViewModel(data.vAccessType); } else { ViewBag.dAccess = TreasuryAccess.GetAccessType(AplyNo); var viewModel = TreasuryAccess.GetTreasuryAccessViewModel(AplyNo); Cache.Invalidate(CacheList.TreasuryAccessViewData); Cache.Set(CacheList.TreasuryAccessViewData, viewModel); resetSealViewModel(viewModel.vAccessType, AplyNo, _dActType); } ViewBag.dActType = _dActType; return(PartialView()); }
/// <summary> /// 重設空白票券 /// </summary> /// <param name="AccessType"></param> /// <param name="AplyNo"></param> private void ResetBillViewModel(string AccessType, string AplyNo = null) { Cache.Invalidate(CacheList.BILLTempData); Cache.Invalidate(CacheList.BILLDayData); if (AplyNo.IsNullOrWhiteSpace()) { var data = (TreasuryAccessViewModel)Cache.Get(CacheList.TreasuryAccessViewData); if (AccessType == Ref.AccessProjectTradeType.P.ToString()) { Cache.Set(CacheList.BILLTempData, new List <BillViewModel>()); Cache.Set(CacheList.BILLDayData, SetBillTakeOutViewModelGroup((List <BillViewModel>)Bill.GetDayData(data.vAplyUnit))); } if (AccessType == Ref.AccessProjectTradeType.G.ToString()) { var _data = (List <BillViewModel>)Bill.GetDayData(data.vAplyUnit, "1");//只抓庫存 var _data2 = (List <BillViewModel>)Bill.GetDayData(data.vAplyUnit); _data2 = GetOut(_data2); _data2.AddRange(_data.ModelConvert <BillViewModel, BillViewModel>()); Cache.Set(CacheList.BILLTempData, SetBillViewRowNum(_data)); Cache.Set(CacheList.BILLDayData, SetBillTakeOutViewModelGroup(_data2)); } } else { var _data = (List <BillViewModel>)Bill.GetTempData(AplyNo); var _data2 = (List <BillViewModel>)Bill.GetDayData(null, null, AplyNo); var _AccessType = TreasuryAccess.GetAccessType(AplyNo); if (_AccessType == Ref.AccessProjectTradeType.P.ToString()) { Cache.Set(CacheList.BILLTempData, SetBillViewRowNum(_data)); Cache.Set(CacheList.BILLDayData, SetBillTakeOutViewModelGroup(_data2)); } if (_AccessType == Ref.AccessProjectTradeType.G.ToString()) { Cache.Set(CacheList.BILLTempData, SetBillViewRowNum(_data)); Cache.Set(CacheList.BILLDayData, SetBillTakeOutViewModelGroup(_data2)); } } }