Esempio n. 1
0
        private void GetErrorResponseNumber(HttpContext context)
        {
            Hashtable map     = new Hashtable();
            DataTable dtTable = new DataTable();
            string    type    = HttpUtility.UrlDecode(context.Request["type"]);
            string    error   = HttpUtility.UrlDecode(context.Request["error"]);

            try
            {
                SqlserverHelper helper = new SqlserverHelper();
                dtTable = helper.GetErrorResponseNumber(type, error);
                map.Add("state", "成功");
                map.Add("msg", "");
            }
            catch (Exception ex)
            {
                Log4Helper.Debug(ex.Message, ex);
                map.Add("state", "失败");
                map.Add("msg", ex.Message);
            }
            map.Add("data", dtTable);
            string json = JsonConvert.SerializeObject(map);

            context.Response.Write(json);
        }
Esempio n. 2
0
        private void DeleteResponse(HttpContext context)
        {
            Hashtable map     = new Hashtable();
            int       request = 0;
            int       success = 0;
            int       fail    = 0;
            int       day     = int.Parse(context.Request["type"]);

            try
            {
                SqlserverHelper helper = new SqlserverHelper();
                request = helper.DeleteOnline(day);
                success = helper.DeleteSuccess(day);
                fail    = helper.DeleteFail(day);
                map.Add("state", "成功");
                map.Add("msg", "");
            }
            catch (Exception ex)
            {
                Log4Helper.Debug(ex.Message, ex);
                map.Add("state", "失败");
                map.Add("msg", ex.Message);
            }
            map.Add("request", request);
            map.Add("success", success);
            map.Add("fail", fail);
            string json = JsonConvert.SerializeObject(map);

            context.Response.Write(json);
        }
Esempio n. 3
0
        public Pager <Product> GetList([FromBody] ProductParameter parameter)
        {
            var res = ProductBiz.GetListByPage(parameter);
            // 测试获取用户身份信息
            var claims = _httpContextAccessor.HttpContext.User.Claims;

            // 测试写入日志信息
            Log4Helper.Debug("控制器中调用GetList方法,调用者:" + MyHttpContext.UserName);

            return(res);
        }