Example #1
0
        public string LogClear(FormCollection context)
        {
            UserBll.Instance.CheckUserOnlingState();

            var rpm = new RequestParamModel <LogModel>(context)
            {
                CurrentContext = context,
                Action         = Request["action"],
                FID            = PublicMethod.GetString(Request["FID"])
            };

            LogBll <object> log  = new LogBll <object>();
            int             days = PublicMethod.GetInt(Request["days"]);

            return(log.ClearLog(days));
        }
Example #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if (SysVisitor.Instance.IsGuest)
            {
                context.Response.Write(
                    new JsonMessage {
                    Success = false, Data = "-99", Message = "登录已过期,请重新登录"
                }.ToString()
                    );
                context.Response.End();
            }

            var rpm = new RequestParamModel <LogModel>(context)
            {
                CurrentContext = context, Action = context.Request["action"],
                KeyId          = PublicMethod.GetInt(context.Request["keyid"])
            };

            switch (rpm.Action)
            {
            case "logdetail":
                context.Response.Write(JSONhelper.ToJson(LogDetailDal.Instance.GetBy(rpm.KeyId).ToList()));
                break;

            case "clearlog":
                LogBll <object> log  = new LogBll <object>();
                int             days = PublicMethod.GetInt(context.Request["days"]);
                context.Response.Write(log.ClearLog(days));
                break;

            default:
                string s = LogDal.Instance.JsonDataForEasyUIdataGrid(rpm.Pageindex, rpm.Pagesize, rpm.Filter);
                context.Response.Write(s);
                break;
            }
        }