Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
0
        public ActionResult View(string AplyNo, TreasuryAccessViewModel data, Ref.OpenPartialViewType type)
        {
            ViewBag.OPVT             = type;
            ViewBag.dBILL_Check_Type = new SelectList(Bill.GetCheckType(), "Value", "Text");
            var ibs = Bill.GetIssuing_Bank();

            ViewBag.dBILL_Issuing_Bank = new SelectList(ibs, "Value", "Text");
            var _dActType = GetActType(type, AplyNo);   //畫面是否可以CRUD

            if (AplyNo.IsNullOrWhiteSpace())
            {
                ViewBag.dAccess = null;
                Cache.Invalidate(CacheList.TreasuryAccessViewData);
                Cache.Set(CacheList.TreasuryAccessViewData, data);
                ResetBillViewModel(data.vAccessType);
            }
            else
            {
                var viewModel = TreasuryAccess.GetTreasuryAccessViewModel(AplyNo);
                ViewBag.dAccess = viewModel.vAccessType;
                if (viewModel.vAccessType == Ref.AccessProjectTradeType.G.ToString())
                {
                    _dActType = false; //空白票據 取出預設只能檢視
                }
                Cache.Invalidate(CacheList.TreasuryAccessViewData);
                Cache.Set(CacheList.TreasuryAccessViewData, viewModel);
                ResetBillViewModel(viewModel.vAccessType, AplyNo);
            }
            ViewBag.dActType = _dActType;
            return(PartialView());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 設定股票Cache資料
        /// </summary>
        /// <param name="GroupNo">申請單號</param>
        /// <param name="GroupNo">修改狀態</param>
        /// <returns></returns>
        private void resetStockViewModel(string AplyNo = null, bool EditFlag = false)
        {
            Cache.Invalidate(CacheList.StockData);
            Cache.Invalidate(CacheList.StockMainData);
            Cache.Invalidate(CacheList.StockTempData);
            if (AplyNo.IsNullOrWhiteSpace())
            {
                Cache.Set(CacheList.StockData, new StockViewModel());
                Cache.Set(CacheList.StockMainData, new List <StockDetailViewModel>());
                Cache.Set(CacheList.StockTempData, new List <StockDetailViewModel>());
            }
            else
            {
                var data = Stock.GetDataByAplyNo(AplyNo, EditFlag);
                Cache.Set(CacheList.StockData, data);

                var viewModel = TreasuryAccess.GetTreasuryAccessViewModel(AplyNo);
                if (viewModel.vAccessType == Ref.AccessProjectTradeType.P.ToString())
                {
                    Cache.Set(CacheList.StockTempData, data.vDetail);
                }
                else if (viewModel.vAccessType == Ref.AccessProjectTradeType.G.ToString())
                {
                    Cache.Set(CacheList.StockMainData, data.vDetail);
                    Cache.Set(CacheList.StockTempData, new List <StockDetailViewModel>());
                }
            }
        }
Ejemplo n.º 5
0
        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());
        }
Ejemplo n.º 6
0
        public ActionResult View(string AplyNo, TreasuryAccessViewModel data, Ref.OpenPartialViewType type)
        {
            ViewBag.OPVT           = type;
            ViewBag.ESTATE_From_No = new SelectList(Estate.GetEstateFromNo(), "Value", "Text");
            ViewBag.CustodianFlag  = AccountController.CustodianFlag;
            var _dActType = GetActType(type, AplyNo);

            if (AplyNo.IsNullOrWhiteSpace())
            {
                if (data.vAccessType == Ref.AccessProjectTradeType.P.ToString())
                {
                    ViewBag.ESTATE_Book_No       = new SelectList(Estate.GetBookNo(), "Value", "Text");
                    ViewBag.ESTATE_Building_Name = new SelectList(Estate.GetBuildName(), "Value", "Text");
                }
                else if (data.vAccessType == Ref.AccessProjectTradeType.G.ToString())
                {
                    ViewBag.ESTATE_Book_No       = new SelectList(Estate.GetBookNo(data.vAplyUnit), "Value", "Text");
                    ViewBag.ESTATE_Building_Name = new SelectList(Estate.GetBuildName(data.vAplyUnit), "Value", "Text");
                }
                Cache.Invalidate(CacheList.TreasuryAccessViewData);
                Cache.Set(CacheList.TreasuryAccessViewData, data);
                ResetEstateViewModel();
            }
            else
            {
                var viewModel = TreasuryAccess.GetTreasuryAccessViewModel(AplyNo);
                ViewBag.dAccess = viewModel.vAccessType;
                if (viewModel.vAccessType == Ref.AccessProjectTradeType.P.ToString())
                {
                    ViewBag.ESTATE_Book_No       = new SelectList(Estate.GetBookNo(), "Value", "Text");
                    ViewBag.ESTATE_Building_Name = new SelectList(Estate.GetBuildName(), "Value", "Text");
                }
                else if (viewModel.vAccessType == Ref.AccessProjectTradeType.G.ToString() && _dActType)
                {
                    ViewBag.ESTATE_Book_No       = new SelectList(Estate.GetBookNo(viewModel.vAplyUnit, AplyNo), "Value", "Text");
                    ViewBag.ESTATE_Building_Name = new SelectList(Estate.GetBuildName(viewModel.vAplyUnit, AplyNo), "Value", "Text");
                }
                else if (viewModel.vAccessType == Ref.AccessProjectTradeType.G.ToString() && !_dActType)
                {
                    ViewBag.ESTATE_Book_No       = new SelectList(Estate.GetBookNo(viewModel.vAplyUnit), "Value", "Text");
                    ViewBag.ESTATE_Building_Name = new SelectList(Estate.GetBuildName(viewModel.vAplyUnit), "Value", "Text");
                }
                Cache.Invalidate(CacheList.TreasuryAccessViewData);
                Cache.Set(CacheList.TreasuryAccessViewData, viewModel);
                ResetEstateViewModel(AplyNo, _dActType);
                var _data = (EstateViewModel)Cache.Get(CacheList.ESTATEAllData);
                ViewBag.group = _data.vGroupNo;
            }
            ViewBag.dActType = _dActType;
            return(PartialView());
        }
Ejemplo n.º 7
0
        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());
        }