예제 #1
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));
        }
예제 #2
0
        /// <summary>
        /// 申請作業 畫面初始
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            var _CustodyFlag = Convert.ToBoolean(Session["CustodyFlag"]);

            ViewBag.CustodyFlag = _CustodyFlag;
            ViewBag.opScope     = GetopScope("~/TreasuryAccess/");
            var data = TreasuryAccess.TreasuryAccessDetail(
                AccountController.CurrentUserId, AccountController.CustodianFlag
                );
            var _aProjectAll = data.Item1.ModelConvert <SelectOption, SelectOption>();
            var _aUnitAll    = data.Item2.ModelConvert <SelectOption, SelectOption>();
            var empty        = new SelectOption()
            {
                Text = string.Empty, Value = string.Empty
            };

            data.Item1.Insert(0, empty);
            if (AccountController.CustodianFlag)
            {
                data.Item2.Insert(0, empty);
            }
            var All = new SelectOption()
            {
                Text = "All", Value = "All"
            };

            _aProjectAll.Insert(0, All);
            _aUnitAll.Insert(0, All);
            ViewBag.aProject    = new SelectList(data.Item1, "Value", "Text");
            ViewBag.aUnit       = new SelectList(data.Item2, "Value", "Text");
            ViewBag.applicant   = new SelectList(data.Item3, "Value", "Text");
            ViewBag.aProjectAll = new SelectList(_aProjectAll, "Value", "Text");
            ViewBag.aUnitAll    = new SelectList(_aUnitAll, "Value", "Text");
            var userInfo = data.Item4;

            ViewBag.hCREATE_User = userInfo.EMP_ID;
            ViewBag.lCREATE_User = userInfo.EMP_Name;
            ViewBag.hCREATE_Dep  = userInfo.DPT_ID;
            ViewBag.lCREATE_Dep  = userInfo.DPT_Name;
            return(View());
        }