Example #1
0
        public ActionResult CustomerRecharge(CustomerRechargeModel model)
        {
            CustomerManagement customerMgr = new CustomerManagement(User.Identity.GetUserId <int>());

            customerMgr.CustomerRecharge(model.CustomerId, User.Identity.GetUserId <int>(), model.ChargeAmount);
            return(Redirect("/Agent/CustomerRechargeHistories?customerId=" + model.CustomerId));
            //return View(model);
        }
Example #2
0
        public ActionResult CustomerRecharge(int customerId)
        {
            CustomerManagement customerMgr = new CustomerManagement(User.Identity.GetUserId <int>());
            List <BCustomer>   customers   = customerMgr.FindCustomers(User.Identity.GetUserId <int>(), customerId, out total);

            if (customers == null || customers.Count <= 0)
            {
                ViewBag.Message = string.Format("编号为{0}的客户不存在", customerId);
                return(View("Error"));
            }
            CustomerRechargeModel model = new CustomerRechargeModel()
            {
                CurrentAmount = customers[0].RemainingAmount, ChargeAmount = 0, CustomerId = customers[0].Id, CustomerName = customers[0].Name
            };

            return(View(model));
        }