コード例 #1
0
        public ActionResult shopping_cart()
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Login", "Account"));
            }

            var model     = (ShopingCartViewModel)TempData["model"];
            var service   = new Shopping_Cart_Service();
            var user_name = HttpContext.User.Identity.Name;

            //Product_Price_list
            if (!model.ReserveItem.Contains(','))
            {
                ViewBag.Services = model.ReserveItem;
            }
            var get_service_price_model = service.GetService(model.ReserveItem);



            //coupon
            var Account   = new AccountDetailService();
            var viewmodel = Account.get_account_detail(user_name);
            var _Coupon   = service.GetCoupon(viewmodel.Cust_id);

            //Designer
            var get_designer_model = service.GetDesigners();

            ViewBag.Designers = get_designer_model;

            //Session
            var get_session = service.Get_Session_list();

            ViewBag.Session = get_session;


            ViewBag.Origin = service.Calculate_Original_Price(get_service_price_model.Shop_list);

            ViewBag.Store = model.Store;


            ViewBag.Services = model.ReserveItem.Split(',');
            ViewBag.Coupons  = _Coupon;
            return(View(get_service_price_model));
        }
コード例 #2
0
        public ActionResult Index([Bind(Include = ("Name,Email,Phone,Address,Birthday,Mobile,Gender"))] Account_List_ViewModel account_detail)
        {
            if (TempData["ID"] != null)
            {
                var user_name = HttpContext.User.Identity.Name;
                var viewmodel = Account.get_account_detail(user_name);
                var _order    = Account.Get_order(viewmodel.Cust_id);
                var _Coupon   = Account.Coupon(viewmodel.Cust_id);
                ViewBag.Order           = _order;
                account_detail.Discount = _Coupon.Discount;
                account_detail.Cust_id  = Convert.ToInt32(TempData["ID"]);
                var service = new AccountDetailService();
                service.Update(account_detail);
            }
            int ID = Convert.ToInt32(TempData["ID"]);



            return(View(account_detail));
        }
コード例 #3
0
        public void shopping_cartTest()
        {
            ShopingCartViewModel model = new ShopingCartViewModel();
            var service = new Shopping_Cart_Service();

            model.ReserveItem = "手部精緻保養,足部精緻保養";
            var get_service_price_model = service.GetService(model.ReserveItem);

            var user_name = "*****@*****.**";
            var Account   = new AccountDetailService();

            var viewmodel = Account.get_account_detail(user_name);
            var _Coupon   = service.GetCoupon(viewmodel.Cust_id);

            var get_designer_model = service.GetDesigners();

            var get_session = service.Get_Session_list();

            Assert.IsNotNull(get_service_price_model);
            Assert.IsNotNull(viewmodel);
            Assert.IsNotNull(_Coupon);
            Assert.IsNotNull(get_designer_model);
            Assert.IsNotNull(get_session);
        }
コード例 #4
0
 public AccountsController()
 {
     svc   = new AccountService();
     adSvc = new AccountDetailService();
 }
コード例 #5
0
        public ActionResult SpgatewayReturn()
        {
            Request.LogFormData("SpgatewayReturn(支付完成)");

            // Status 回傳狀態
            // MerchantID 回傳訊息
            // TradeInfo 交易資料AES 加密
            // TradeSha 交易資料SHA256 加密
            // Version 串接程式版本
            NameValueCollection collection = Request.Form;

            if (collection["MerchantID"] != null && string.Equals(collection["MerchantID"], _bankInfoModel.MerchantID) &&
                collection["TradeInfo"] != null && string.Equals(collection["TradeSha"], CryptoUtil.EncryptSHA256($"HashKey={_bankInfoModel.HashKey}&{collection["TradeInfo"]}&HashIV={_bankInfoModel.HashIV}")))
            {
                var decryptTradeInfo = CryptoUtil.DecryptAESHex(collection["TradeInfo"], _bankInfoModel.HashKey, _bankInfoModel.HashIV);

                // 取得回傳參數(ex:key1=value1&key2=value2),儲存為NameValueCollection
                NameValueCollection      decryptTradeCollection = HttpUtility.ParseQueryString(decryptTradeInfo);
                SpgatewayOutputDataModel convertModel           = LambdaUtil.DictionaryToObject <SpgatewayOutputDataModel>(decryptTradeCollection.AllKeys.ToDictionary(k => k, k => decryptTradeCollection[k]));

                LogUtil.WriteLog(JsonConvert.SerializeObject(convertModel));

                // TODO 將回傳訊息寫入資料庫
                intoDB DB        = new intoDB();
                var    Status    = convertModel.Status;
                var    OrderNo   = convertModel.MerchantOrderNo;
                var    PayWay    = convertModel.PaymentType;
                var    PayWay_id = 0;

                switch (PayWay)
                {
                case "CREDIT":
                    PayWay_id = 1;
                    break;

                case "SAMSUNGPAY":
                    PayWay_id = 2;
                    break;

                case "ANDROIDPAY":
                    PayWay_id = 3;
                    break;

                case "WEBATM":
                    PayWay_id = 4;
                    break;

                case "VACC":
                    PayWay_id = 5;
                    break;

                default:
                    PayWay_id = 6;
                    break;
                }

                if (Status == "SUCCESS")
                {
                    var data = Data;
                    AccountDetailService Account = new AccountDetailService();
                    var user_name = HttpContext.User.Identity.Name;
                    var viewmodel = Account.get_account_detail(user_name);
                    DB._intoDB(data, Status, OrderNo, PayWay_id, viewmodel.Cust_id);
                }
            }
            else
            {
                LogUtil.WriteLog("MerchantID/TradeSha驗證錯誤");
            }

            return(View());
        }
コード例 #6
0
 public BusinessFinanceDashboardController(AccountDetailService accountDetailService, CashFlowService cashFlowService)
 {
     _accountDetailService = accountDetailService;
     _cashFlowService      = cashFlowService;
 }