Beispiel #1
0
 public ApiMessage SearchDirectChargeTaocans()
 {
     this.IniRequest();
     ApiMessage message = new ApiMessage();
     BaseManagement baseMgt = new BaseManagement(0);
     if (request["scope"] == null || (request["scope"].ToLower() != "global" && request["scope"].ToLower() != "local"))
     {
         message.Status = "ERROR";
         message.Message = "scope must be global or local and in lower case.";
         return message;
     }
     if (request["sp"] == null || string.IsNullOrEmpty(request["sp"]))
     {
         message.Status = "ERROR";
         message.Message = "Unknow mobile phone sp name";
         return message;
     }
     if (request["province"] == null || string.IsNullOrEmpty(request["province"]))
     {
         message.Status = "ERROR";
         message.Message = "Unknow mobile phone province name";
         return message;
     }
     BitScope scope = BitScope.Global;
     if (request["scope"].Trim().ToLower() == "local")
     {
         scope = BitScope.Local;
     }
     List<BResourceTaocan> tcs = baseMgt.SearchResourceTaocans(request["sp"],request["province"], scope);
     message.Status = "OK";
     message.Item = tcs;
     return message;
 }
Beispiel #2
0
 public ActionResult Index()
 {
     BaseManagement baseMgr = new BaseManagement(User.Identity.GetUserId<int>());
     if(baseMgr.CurrentLoginUser.IsAdmin)
     {
         return Redirect("/Admin/Index");
     }else
     {
         return Redirect("/Agent/Index");
     }
 }
Beispiel #3
0
        public ActionResult Charge(ChargeModel model)
        {
            BaseManagement baseMgt = new BaseManagement(User.Identity.GetUserId<int>());
            if (!baseMgt.CurrentLoginUser.Permission.CHARGE_BYTE)
            {
                ViewBag.Message = "没有权限充值流量";
                return View("Error");
            }
           
            if (ModelState.IsValid)
            {
                ChargeBridge cb = new ChargeBridge();
                ChargeOrder order = new ChargeOrder() { ChargeType=2, Payed=true, OperateUserId=User.Identity.GetUserId<int>(), AgencyId = 0, Id = 0, Province=model.Province,City=model.City, MobileSP = model.SPName, MobileNumber = model.Mobile, OutOrderId = "", ResourceId = 0, ResourceTaocanId = model.ResourceTaocanId, RouteId = 0, CreatedTime = DateTimeUtil.ConvertDateTimeToInt(DateTime.Now) };
              
                OrderManagement orderMgt = new OrderManagement();
                try
                {
                    order = orderMgt.GenerateOrder(order);
                    ViewBag.Message = "成功提交到充值系统,等待充值,可以到流量充值查询里查看充值状态...";
                }
                catch(KMBitException kex)
                {
                    ViewBag.Message = kex.Message;
                }
                catch(Exception ex)
                {
                    ViewBag.Message = ex.Message;
                }
                           
                //ChargeResult result = cb.Charge(order);
                
            }

            return View();
        }
Beispiel #4
0
        public ActionResult Charge()
        {
            BaseManagement baseMgt = new BaseManagement(User.Identity.GetUserId<int>());
            if (!baseMgt.CurrentLoginUser.Permission.CHARGE_BYTE)
            {
                ViewBag.Message = "没有权限充值流量";
                return View("Error");
            }

            return View();
        }