//获取激活和未激活矿机数量 private string GetInfo(HttpContext context) { string userid = context.Request["userid"] ?? ""; long _userid = userid.ToInt(); InvestService svc = new InvestService(); var info = svc.GetInfo(_userid); return(ResultJson(ResultType.success, "ok", info)); }
private string ActiveMachine(HttpContext context) { string message; string userid = context.Request["userid"] ?? ""; string machineid = context.Request["machineid"] ?? ""; long _userid = userid.ToLong(); long _machineid = machineid.ToLong(); InvestService svc = new InvestService(); if (svc.Active(_userid, _machineid, out message)) { var info = svc.GetInfo(_userid); return(ResultJson(ResultType.success, message, info)); } else { return(ResultJson(ResultType.error, message, "")); } }
//激活列表 private string ActiveList(HttpContext context) { int pageSize = 10; //默认每页返回记录数 int _pageindex; string userid = context.Request["userid"] ?? ""; string pageindex = context.Request["pageindex"] ?? ""; //页索引 string findkey = context.Request["findkey"] ?? ""; //搜索关键字 string message = string.Empty; long _userid = 0; _pageindex = pageindex.ToInt(); if (_pageindex <= 0) { _pageindex = 1; } if (string.IsNullOrEmpty(userid)) { return(ResultJson(ResultType.error, "请输入用户ID", "")); } if (!string.IsNullOrEmpty(findkey)) { findkey = SafeHelper.GetSafeSql(findkey); } long.TryParse(userid, out _userid); InvestService svc = new InvestService(); var result = svc.ActiveList(_userid, _pageindex, pageSize, findkey); var info = svc.GetInfo(_userid); Dictionary <string, object> dict = new Dictionary <string, object>(); dict.Add("info", info); // dict.Add("list", result); // return(ResultJson(ResultType.success, message, dict)); }