Ejemplo n.º 1
0
        public ActionResult GetResponse(string DR)
        {
            logger.Info("GetResponse Method Start" + " at " + DateTime.UtcNow);
            UserWalletLog userWalletLog = (UserWalletLog)TempData["UserWalletLog"];
            RequestParams parameters    = new RequestParams();

            db.Entry(userWalletLog).State = EntityState.Modified;
            parameters.GetResponse(DR, userWalletLog.UserProfileId, userWalletLog.Amount, ref userWalletLog);

            logger.Info("GetResponse Method userWallet log status " + userWalletLog.Status1 + " at " + DateTime.UtcNow);
            if (userWalletLog.Status1 == (int)OrderStatus.PaymentSuceess)
            {
                UserWallet wallet = db.UserWallets.Where(p => p.UserProfileId == userWalletLog.UserProfileId).FirstOrDefault();
                logger.Info("GetResponse Method wallet " + wallet.UserWalletId + " at " + DateTime.UtcNow);
                if (wallet == null)
                {
                    wallet = new UserWallet();
                    wallet.UserProfileId = userWalletLog.UserProfileId;
                    wallet.Balance      += userWalletLog.Amount;
                    logger.Info("GetResponse Method user " + wallet.UserProfileId + " at " + DateTime.UtcNow);
                    logger.Info("GetResponse Method wallet balance " + wallet.Balance + " at " + DateTime.UtcNow);
                    db.UserWallets.Add(wallet);
                }
                else
                {
                    wallet.Balance += userWalletLog.Amount;
                    logger.Info("GetResponse Method wallet balance " + wallet.Balance + " at " + DateTime.UtcNow);
                    db.Entry(wallet).State = EntityState.Modified;
                }
            }
            db.SaveChanges();
            TempData["WalletStatus"] = userWalletLog.Status1;
            logger.Info("GetResponse Method End" + " at " + DateTime.UtcNow);
            return(RedirectToAction("Wallet", "UserWallet"));;
        }
Ejemplo n.º 2
0
        public ActionResult GetResponse(string DR)
        {
            logger.Info("GetResponse Method Start" + " at " + DateTime.UtcNow);
            UserWalletViewModel userWalletViewModal = (UserWalletViewModel)TempData["UserWallet"];
            RequestParams       parameters          = new RequestParams();
            UserWalletLog       userWalletLog       = userWalletViewModal.UserWalletLog;

            db.Entry(userWalletLog).State = EntityState.Modified;
            parameters.GetResponse(DR, userWalletViewModal.UserProfileId, userWalletViewModal.UserWalletLog.Amount, ref userWalletLog);

            userWalletViewModal.UserWalletLog = userWalletLog;
            logger.Info("GetResponse Method userWalletLog Status" + userWalletLog.Status1 + " at " + DateTime.UtcNow);

            if (userWalletLog.Status1 == (int)OrderStatus.PaymentSuceess)
            {
                UserWallet wallet = db.UserWallets.Where(p => p.UserProfileId == userWalletViewModal.UserProfileId).FirstOrDefault();
                if (wallet == null)
                {
                    wallet = new UserWallet();
                    wallet.UserProfileId = userWalletViewModal.UserProfileId;
                    wallet.Balance      += userWalletLog.Amount;
                    logger.Info("GetResponse Method user " + wallet.UserProfileId + " at " + DateTime.UtcNow);
                    logger.Info("GetResponse Method userWallet Balance " + wallet.Balance + " at " + DateTime.UtcNow);
                    db.UserWallets.Add(wallet);
                    logger.Info("GetResponse Method User wallet details added at " + DateTime.UtcNow);
                }
                else
                {
                    wallet.Balance += userWalletLog.Amount;
                    logger.Info("GetResponse Method userWallet Balance " + wallet.Balance + " at " + DateTime.UtcNow);
                    db.Entry(wallet).State = EntityState.Modified;
                    logger.Info("GetResponse Method User wallet details updated at " + DateTime.UtcNow);
                }
                userWalletViewModal.UserWallet = wallet;
            }
            db.SaveChanges();
            ViewData.Model = userWalletViewModal;
            logger.Info("GetResponse Method End" + " at " + DateTime.UtcNow);
            return(View());
        }