Пример #1
0
        public JsonResult RedeemCoupon(string coupon)
        {
            BtceApix btceApix = new BtceApix(key, secret);

            CouponResult couponResult = btceApix.RedeemCoupon(coupon);

            BetBitEntities betBitEntities = new BetBitEntities();
            AccountController accountController = new AccountController();
            betBitEntities.Coupon.Add(new Coupon()
                {
                    UserId = accountController.GetUser(Request).UserId,
                    CouponAmount = couponResult.CouponAmount,
                    CouponCode = coupon,
                    CreateDate = DateTime.Now
                });
            betBitEntities.SaveChanges();
            return Json(couponResult, JsonRequestBehavior.AllowGet);
        }