Exemplo n.º 1
0
        public ActionResult BasMangeGrid()
        {
            string strCurPage;
            string strRowNum;

            string where = "";
            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            string type = Request["sel"].ToString();

            if (type != "")//在此处做判断
            {
                where += " and a.Type ='" + type + "' ";
            }
            UIDataTable udtTask = new UIDataTable();

            if (where != "")
            {
                udtTask = SystemManage.getNewBasMangeGrid(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));
        }