Ejemplo n.º 1
0
        /// <summary>
        /// 取得客戶綁定代繳契約狀態
        /// </summary>
        /// <param name="model">取得客戶綁定代繳契約狀態 Input</param>
        /// <returns>取得客戶綁定代繳契約狀態 Output</returns>
        public async Task <CustProxyPayStatus> GetCustProxyPayStatus(GetCustInfoInput model)
        {
            // 透過 Api 把資料送出去
            string apiUrl = "APP_ACCT_BIND/CUST_PROXY_PAY_STATUS";

            BaseResult <CustProxyPayStatus> baseListResult = await ApiService.Instance.ApiGetCustProxyPayStatus(model, apiUrl);

            CustProxyPayStatus result = new CustProxyPayStatus();

            if (baseListResult.Result.ReturnCode == 0 && baseListResult.Data != null)
            {
                result = baseListResult.Data;
            }

            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 繳款
        /// </summary>
        /// <param name="MbrId">會員編號(持久登入驗證)</param>
        /// <param name="DevId">裝置編號(持久登入驗證)</param>
        /// <param name="Token">持久登入用Token(持久登入驗證)</param>
        /// <returns></returns>
        public async Task <ActionResult> Index(string MbrId, string DevId, string Token)
        {
            if (string.IsNullOrEmpty(MbrId) && string.IsNullOrEmpty(this.TokenVerify?.MbrId))
            {
                return(this.Json(new { isError = true, message = "查無資料!!!" }, JsonRequestBehavior.AllowGet));
            }

            GetCustInfoInput model = new GetCustInfoInput
            {
                MBR_ID = string.IsNullOrEmpty(MbrId) ? this.TokenVerify.MbrId : MbrId,
                MbrId  = string.IsNullOrEmpty(MbrId) ? this.TokenVerify.MbrId : MbrId,
                DevId  = string.IsNullOrEmpty(DevId) ? this.TokenVerify.DevId : DevId,
                Token  = string.IsNullOrEmpty(Token) ? this.TokenVerify.Token : Token
            };


            // 取得會員資料
            HomeService       homeService = new HomeService();
            GetCustInfoOutput result      = await homeService.GetCustInfo(model);

            // 是否已綁定個人資料或代繳契約
            CustProxyPayStatus proxyPayStatus = await homeService.GetCustProxyPayStatus(model);

            if (string.IsNullOrEmpty(result.ID) ||
                proxyPayStatus.REG_COUNT < 3)
            {
                this.ViewBag.ShowAddButton = true;
            }
            else
            {
                this.ViewBag.ShowAddButton = false;
            }

            if (!string.IsNullOrEmpty(MbrId) && (string.IsNullOrEmpty(this.TokenVerify?.MbrId) || this.TokenVerify.MbrId != MbrId))
            {
                //// 取得會員資料
                //HomeService homeService = new HomeService();
                //GetCustInfoOutput result = await homeService.GetCustInfo(model);

                //// 是否已綁定個人資料或代繳契約
                //CustProxyPayStatus proxyPayStatus = await homeService.GetCustProxyPayStatus(model);
                //if (string.IsNullOrEmpty(result.ID) ||
                //    proxyPayStatus.REG_COUNT < 3)
                //{
                //    this.ViewBag.ShowAddButton = true;
                //}
                //else
                //{
                //    this.ViewBag.ShowAddButton = false;
                //}

                // 取得全資料
                InitOutput initOutput = await homeService.INIT(result.ID);

                // 加入Cookie
                System.Web.HttpCookie AridCookie = this.AirdCookie(result.ID ?? string.Empty, MbrId, DevId, Token, initOutput?.CUST_ID ?? string.Empty, initOutput?.CNTRT_NO ?? string.Empty);
                this.Response.Cookies.Add(AridCookie);
            }

            this.ViewBag.Title = "我的帳單";

            return(this.View());
        }