Ejemplo n.º 1
0
        /// <summary>
        /// 通过不同分组获取人员数据
        /// </summary>
        /// <param name="group"></param>
        /// <returns></returns>
        private string GetJsonList(string group)
        {
            System.Web.HttpRequest request = System.Web.HttpContext.Current.Request;

            string lgSign = request.Params["lgsign"];       //显示禁用

            string sqlFilter = request.Params["searchtxt"]; //输入的查询串
            string oCode     = request.Params["ocode"];     //当前节点
            string leaf      = request.Params["leaf"];      //是否叶子节点

            string limit = request.Params["limit"];         //每页显示数
            string page  = request.Params["page"];          //当前索引

            string defaultFilter = "";

            switch (group)
            {
            case "ugroup":
            case "actor":
            {
                if (string.IsNullOrEmpty(lgSign) || lgSign == "0")         //默认不显示禁用用户
                {
                    defaultFilter = "secuser.lg_sign='1'";
                }
            }
            break;

            default:
                break;
            }

            int totalRecord = 0, pageSize = 20, pageIndex = 0;

            int.TryParse(limit, out pageSize);
            int.TryParse(page, out pageIndex);
            DataTable tmpDT = proxy.GetDataTable(defaultFilter, sqlFilter, pageSize, pageIndex, ref totalRecord, oCode, leaf == "true", group);
            string    str   = DataConverterHelper.ToJson(tmpDT, totalRecord);

            return(str);
        }