/// <summary> /// 判斷 PartialView 是否可以CRUD /// </summary> /// <param name="type"></param> /// <param name="AplyNo"></param> /// <returns></returns> protected bool GetActType(Ref.OpenPartialViewType type, string AplyNo) { if (AplyNo.IsNullOrWhiteSpace()) //沒有申請單號表示可以CRUD { return(true); } switch (type) //哪個畫面呼叫PartialView { case Ref.OpenPartialViewType.TAAppr: //金庫物品存取覆核作業 //只有檢視功能 return(false); case Ref.OpenPartialViewType.CustodyAppr: //保管單位覆核作業 //只有檢視功能 return(false); case Ref.OpenPartialViewType.CustodyIndex: //保管單位承辦作業 return(TreasuryAccess.GetActType(AplyNo, AccountController.CurrentUserId, Custody_Aply_Appr_Type)); case Ref.OpenPartialViewType.TAIndex: //金庫物品存取申請作業 default: //查詢作業 有單號的申請,如果為填表人本人可以修改 return(TreasuryAccess.GetActType(AplyNo, AccountController.CurrentUserId, Aply_Appr_Type)); } }
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.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()); }
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; 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()); }
public ActionResult CDCView(string AplyNo, CDCSearchViewModel data, Ref.OpenPartialViewType type) { var _data = ((List <CDCSealViewModel>)Seal.GetCDCSearchData(data, AplyNo)); ViewBag.Sataus = new Service.Actual.Common().GetSysCode("INVENTORY_TYPE"); ViewBag.type = type; ViewBag.IO = data.vTreasuryIO; data.vCreate_Uid = AccountController.CurrentUserId; Cache.Invalidate(CacheList.CDCSearchViewModel); Cache.Set(CacheList.CDCSearchViewModel, data); Cache.Invalidate(CacheList.CDCSEALData); Cache.Set(CacheList.CDCSEALData, _data); return(PartialView()); }
public ActionResult CDCView(string AplyNo, CDCSearchViewModel data, Ref.OpenPartialViewType type) { var _data = ((List <CDCEstateViewModel>)Estate.GetCDCSearchData(data, AplyNo)); ViewBag.Sataus = new Service.Actual.Common().GetSysCode("INVENTORY_TYPE"); ViewBag.type = type; ViewBag.IO = data.vTreasuryIO; ViewBag.dEstate_Building_Name = new SelectList(Estate.GetBuildName(), "Value", "Text"); ViewBag.dEstate_From_No = new SelectList(Estate.GetEstateFromNo(), "Value", "Text"); data.vCreate_Uid = AccountController.CurrentUserId; Cache.Invalidate(CacheList.CDCSearchViewModel); Cache.Set(CacheList.CDCSearchViewModel, data); Cache.Invalidate(CacheList.CDCEstateData); Cache.Set(CacheList.CDCEstateData, _data); return(PartialView()); }
public ActionResult CDCView(string AplyNo, CDCSearchViewModel data, Ref.OpenPartialViewType type) { var _data = ((List <CDCMarginpViewModel>)Marginp.GetCDCSearchData(data, AplyNo)); ViewBag.Sataus = new Service.Actual.Common().GetSysCode("INVENTORY_TYPE"); ViewBag.type = type; ViewBag.IO = data.vTreasuryIO; ViewBag.dMargin_Take_Of_Type = new SelectList(Marginp.GetMarginp_Take_Of_Type(), "Value", "Text"); ViewBag.dMargin_Item = new SelectList(Marginp.GetMarginpItem(), "Value", "Text"); data.vCreate_Uid = AccountController.CurrentUserId; Cache.Invalidate(CacheList.CDCSearchViewModel); Cache.Set(CacheList.CDCSearchViewModel, data); Cache.Invalidate(CacheList.CDCMarginpData); Cache.Set(CacheList.CDCMarginpData, _data); return(PartialView()); }
public ActionResult CDCView(string AplyNo, CDCSearchViewModel data, Ref.OpenPartialViewType type) { var _data = ((List <CDCBillViewModel>)Bill.GetCDCSearchData(data, AplyNo)); ViewBag.Sataus = new Service.Actual.Common().GetSysCode("INVENTORY_TYPE"); ViewBag.type = type; ViewBag.IO = data.vTreasuryIO; ViewBag.dBILL_Check_Type = new SelectList(Bill.GetCheckType(), "Value", "Text"); ViewBag.dBILL_Issuing_Bank = new SelectList(Bill.GetIssuing_Bank(), "Value", "Text"); data.vCreate_Uid = AccountController.CurrentUserId; Cache.Invalidate(CacheList.CDCSearchViewModel); Cache.Set(CacheList.CDCSearchViewModel, data); Cache.Invalidate(CacheList.CDCBILLData); Cache.Set(CacheList.CDCBILLData, _data); Cache.Invalidate(CacheList.CDCBILLAllData); Cache.Set(CacheList.CDCBILLAllData, ((List <CDCBillViewModel>)Bill.GetCDCSearchData(new CDCSearchViewModel() { vTreasuryIO = "Y" }, null))); 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()); }