// GET: Client/WalletBalance
        public ActionResult balanceTransfer()
        {
            WalletBalanceModel          walletBalance = new WalletBalanceModel();
            Dictionary <string, string> PurposeList   = _walletUser.GetProposeList();

            walletBalance.PurposeList = ApplicationUtilities.SetDDLValue(PurposeList, "", "--Propose--");
            return(View(walletBalance));
        }
Ejemplo n.º 2
0
        public ActionResult Index(WalletBalanceModel walletBalance)
        {
            Dictionary <string, string> PurposeList = _walletUser.GetProposeList();

            walletBalance.PurposeList = ApplicationUtilities.SetDDLValue(PurposeList, "", "--Propose--");

            if ((Convert.ToDecimal(walletBalance.Amount) > 1000 || Convert.ToDecimal(walletBalance.Amount) < 10) && walletBalance.Type == "T")
            {
                ModelState.AddModelError("Amount", "Amount should be between 10-1000");
                return(View(walletBalance));
            }

            ModelState.Remove("Purpose");
            ModelState.Remove("ReceiverAgentId");
            string           usertype = Session["UserType"].ToString();
            string           agentid  = Session["AgentId"].ToString();
            CommonDbResponse response = _walletUser.CheckMobileNumber(agentid, walletBalance.MobileNumber, usertype, "lb");

            if (response.Code != 0)
            {
                ModelState.AddModelError("MobileNumber", "Invalid User Detail");
                return(View(walletBalance));
            }
            else
            {
                ModelState.Remove("MobileNumber");
            }
            if (ModelState.IsValid)
            {
                walletBalance.AgentId    = Session["AgentId"].ToString();
                walletBalance.ActionUser = Session["UserName"].ToString();
                walletBalance.IpAddress  = ApplicationUtilities.GetIP();
                WalletBalanceCommon walletBalanceCommon = walletBalance.MapObject <WalletBalanceCommon>();
                CommonDbResponse    dbResponse          = _walletUser.AgentToWallet(walletBalanceCommon);
                if (dbResponse.Code == 0)
                {
                    dbResponse.SetMessageInTempData(this, "balanceTransfer");
                    return(RedirectToAction("Index"));
                }
                else
                {
                    dbResponse.SetMessageInTempData(this, "balanceTransfer");
                }
            }
            else
            {
                return(View(walletBalance));
            }

            return(RedirectToAction("Index"));
        }