Exemplo n.º 1
0
        public async Task <ActionResult> GetArRecLv1()
        {
            GetCustInfoInput  cusModel  = new GetCustInfoInput();
            GetCustInfoOutput cusResult = new GetCustInfoOutput();

            if (this.TokenVerify.Id == string.Empty)
            {
                cusModel = new GetCustInfoInput
                {
                    MBR_ID = this.TokenVerify.MbrId,
                    MbrId  = this.TokenVerify.MbrId,
                    DevId  = this.TokenVerify.DevId,
                    Token  = this.TokenVerify.Token
                };

                // 取得會員資料
                HomeService homeService = new HomeService();
                cusResult = await homeService.GetCustInfo(cusModel);

                if (cusResult.ID != string.Empty)
                {
                    // 取得全資料
                    InitOutput initOutput = await homeService.INIT(cusResult.ID);

                    System.Web.HttpCookie AridCookie = this.AirdCookie(cusResult.ID ?? string.Empty, this.TokenVerify.MbrId, this.TokenVerify.DevId, this.TokenVerify.Token, initOutput?.CUST_ID ?? string.Empty, initOutput?.CNTRT_NO ?? string.Empty);
                    this.Response.Cookies.Add(AridCookie);
                }
            }


            GetArRecLvInput model = new GetArRecLvInput
            {
                //ID = this.TokenVerify.Id,
                ID      = !string.IsNullOrEmpty(cusResult.ID) ? cusResult.ID : this.TokenVerify.Id,
                COMP_ID = this.TokenVerify.CustId,
                MbrId   = this.TokenVerify.MbrId,
                DevId   = this.TokenVerify.DevId,
                Token   = this.TokenVerify.Token,
                SYS_ID  = Common.GetSysId()
            };

            AppFormPayService appFormPayService      = new AppFormPayService();
            BaseListResult <GetArRecLvOutput> result = await appFormPayService.GetArRecLv1(model);

            return(this.Json(result));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 取得全資料(已繳/未繳/逾期)
        /// </summary>
        /// <param name="model">取得會員資訊 Input</param>
        /// <returns>取得會員資訊 Output</returns>
        public async Task <InitOutput> INIT(string id)
        {
            // 透過 Api 把資料送出去
            string apiUrl = "APP_FORM_PAY/INIT";

            InitInput model = new InitInput
            {
                ID = id
            };

            BaseListResult <InitOutput> baseListResult = await ApiService.Instance.ApiINIT(model, apiUrl);

            InitOutput result = new InitOutput();

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

            return(result);
        }
Exemplo n.º 3
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());
        }