コード例 #1
0
        public ActionResult DepositMoney(DepositViewModel model)
        {
            var _userLogic = new UserLogic();
            if (ModelState.IsValid)
            {

                var deposit = new vault_depositits()
                                           {
                                               usr_det_id = _userLogic.GetUserIdByUserName(HttpContext.User.Identity.Name),
                                               vau_dep_timestamp = DateTime.Now,
                                               vau_dep_amount = model.Amount,
                                           };

                bool success = new DepositLogic().SaveDeposit(deposit);
                if (success)
                {
                    model.Message = "Success!";
                }
                else
                {
                    model.Message = "Error!";
                }
            }
            ModelState.Clear();
            model.Balance = _userLogic.GetBalanceByUserId(_userLogic.GetUserIdByUserName(HttpContext.User.Identity.Name)).ToString("N");
            return View(model);
        }
コード例 #2
0
 public ActionResult DepositMoney()
 {
     var model = new DepositViewModel();
     var _userLogic = new UserLogic();
     model.Balance = _userLogic.GetBalanceByUserId(_userLogic.GetUserIdByUserName(HttpContext.User.Identity.Name)).ToString("N");
     return View(model);
 }