Пример #1
0
        public ActionResult UserLogGrid()
        {
            string where = "";
            string strCurPage;
            string strRowNum;
            string CID = "";

            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            if (Request["Cid"] != null)
            {
                CID = Request["Cid"].ToString();
            }
            if (CID != "")
            {
                where += " and a.UserId = '" + CID + "'";
            }
            UIDataTable udtTask = new UIDataTable();

            if (where != "")
            {
                udtTask = ContractMan.getNewUserlogGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where);
            }
            string strjson = GFun.Dt2Json("", udtTask.DtData);

            strjson = strjson.Substring(1);
            strjson = strjson.Substring(0, strjson.Length - 1);
            string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";

            jsonData += strjson + "}";
            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }