コード例 #1
0
ファイル: LOCLOGController.cs プロジェクト: dmhai/dxpay
        public ActionResult DbLogList()
        {
            #region 分页列表数据查询
            int pageCount;
            //var pageIndexs = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : int.Parse(Request["pageIndexs"]);//当前页
            //var pageSize = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : int.Parse(Request["PageSize"]);//每页显示数量
            //var types = Request["types"];
            //var searchKey = Request["searchKey"];
            //var sort = Request["sort"];

            var pageIndexs = Request.HttpGetParaByName("pageIndexs", 1);
            var pageSize   = Request.HttpGetParaByName("PageSize", x => Convert.ToInt32(x), 20);
            var types      = Request.HttpGetParaByName("types", "");
            var searchKey  = Request.HttpGetParaByName("searchKey", "");
            var sort       = Request.HttpGetParaByName("sort", "");


            var whereBuidler = WhereBuilder.CreateContainer();
            var order        = "order by l_id DESC";


            var logtype = 5;//数据库日志

            if (!string.IsNullOrEmpty(types))
            {
                if (!string.IsNullOrEmpty(searchKey))
                {
                    if (types == "1") //用户编号查询
                    {
                        whereBuidler.Append("u_id like '%" + searchKey + "%'");
                    }
                    else if (types == "2") //用户名称查询
                    {
                        whereBuidler.Append("u_loginname like '%" + searchKey + "%'");
                    }
                    else //IP地址查询
                    {
                        whereBuidler.Append("l_ip like '%" + searchKey + "%'");
                    }
                }
            }
            whereBuidler.Append("l_logtype_id = " + logtype);
            if (!string.IsNullOrEmpty(sort))
            {
                if (sort == "0")
                {
                    order = "order by l_id";
                }
            }
            var @where = whereBuidler.ToWhereString();
            var sql    = "SELECT L.*,U.u_loginname FROM jmp_locuserlog AS L LEFT JOIN jmp_locuser AS U ON l_user_id=u_id " + where;
            var list   = _bllLocuserlog.SelectList(sql, order, pageIndexs, pageSize, out pageCount);
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = pageSize;
            ViewBag.pageCount  = pageCount;
            ViewBag.list       = list;
            #endregion
            return(View());
        }
コード例 #2
0
        public ActionResult Index()
        {
            #region 分页列表数据查询
            int pageCount;

            //当前页
            var pageIndexs = Request.HttpGetParaByName("pageIndexs", 1);
            //每页显示数量
            var pageSize = Request.HttpGetParaByName("PageSize", x => Convert.ToInt32(x), 20);
            //搜索关键词
            var searchKey = Request.HttpGetParaByName("searchKey", "");
            //排序
            var sort = Request.HttpGetParaByName("sort", x => x.ToString(), "");
            //平台ID
            var typeId = Request.HttpGetParaByName("typeId", "100");

            var order = "order by Id DESC";

            var whereContainer = WhereBuilder.CreateContainer();

            if (!string.IsNullOrEmpty(searchKey))
            {
                whereContainer.Append("Message like '%" + searchKey + "%'");
            }

            if (!string.IsNullOrEmpty(typeId))
            {
                if (typeId != "100")
                {
                    whereContainer.Append("TypeId = " + typeId);
                }
            }
            if (!string.IsNullOrEmpty(sort))
            {
                if (sort == "0")
                {
                    order = "order by Id";
                }
            }

            var list = new JMP.BLL.LogCoSettlement().SelectList(whereContainer.ToWhereString(), order, pageIndexs, pageSize, out pageCount);
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = pageSize;
            ViewBag.pageCount  = pageCount;
            #endregion
            return(View(list));
        }
コード例 #3
0
ファイル: LogForApiController.cs プロジェクト: dmhai/dxpay
        public ActionResult Index()
        {
            #region 分页列表数据查询
            int pageCount;
            //var pageIndexs = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]);//当前页
            //var pageSize = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : Int32.Parse(Request["PageSize"]);//每页显示数量
            //var searchKey = Request["searchKey"];
            //var sort = Request["sort"];
            //var clientId = Request["clientId"];

            //当前页
            var pageIndexs = Request.HttpGetParaByName("pageIndexs", 1);
            //每页显示数量
            var pageSize = Request.HttpGetParaByName("PageSize", x => Convert.ToInt32(x), 20);
            //搜索关键词
            var searchKey = Request.HttpGetParaByName("searchKey", "");
            //排序
            var s_type = Request.HttpGetParaByName("s_type", "");
            var sort   = Request.HttpGetParaByName("sort", x => x.ToString(), "");
            //平台ID
            var clientId = Request.HttpGetParaByName("clientId", "-1");

            var order = "order by Id DESC";

            var whereContainer = WhereBuilder.CreateContainer();

            if (!string.IsNullOrEmpty(searchKey) && !string.IsNullOrEmpty(s_type))
            {
                switch (s_type)
                {
                case "0":
                    whereContainer.Append("id =" + searchKey + "");
                    break;

                case "1":
                    whereContainer.Append("ClientName like '%" + searchKey + "%'");
                    break;

                case "2":
                    whereContainer.Append("Summary like '%" + searchKey + "%'");
                    break;
                }
            }

            if (!string.IsNullOrEmpty(clientId))
            {
                if (clientId != "-1")
                {
                    whereContainer.Append("ClientId = " + clientId);
                }
            }
            if (!string.IsNullOrEmpty(sort))
            {
                if (sort == "1")
                {
                    order = "order by Id DESC";
                }
                else
                {
                    order = "order by Id";
                }
            }
            var list = new JMP.BLL.LogForApi().SelectList(whereContainer.ToWhereString(), order, pageIndexs, pageSize, out pageCount);
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = pageSize;
            ViewBag.pageCount  = pageCount;
            ViewBag.stype      = s_type;
            #endregion
            return(View(list));
        }