예제 #1
0
        public ActionResult ListLog(string id = "")
        {
            if (!IsLogged())
            {
                return(BackToLogin());
            }
            LogServices      service   = new LogServices();
            List <LogModels> lstResult = service.SelectRows(new M_Log()
            {
                loglevel = id
            });
            StringBuilder result = new StringBuilder();
            StringBuilder lstRow = new StringBuilder();

            if (lstResult.Count > 0)
            {
                int i = 1;
                foreach (var item in lstResult)
                {
                    lstRow.Append(PrepareDataJsonForListLog(item));
                    i++;
                }
                if (lstRow.Length > 0)
                {
                    lstRow.Remove(lstRow.Length - 1, 1);
                }
            }
            result.Append("{");
            result.Append("\"isHeader\":\"" + "111" + "\",");
            result.Append("\"Pages\":\"" + "212" + "\",");
            result.Append("\"data\":[" + lstRow.ToString() + "]");
            result.Append("}");
            return(Json(result.ToString(), JsonRequestBehavior.AllowGet));
        }