public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int allRecordCount = 0; string sortname = context.Request.Params["sortname"]; string sortorder = context.Request.Params["sortorder"]; int page = Convert.ToInt32(context.Request.Params["page"]) - 1; // 系统的索引从0开始,所以此处需要减1 int pagesize = Convert.ToInt32(context.Request.Params["pagesize"]); string fromWhere = context.Request.QueryString["fromwhere"]; string qylx = context.Request.QueryString["qylx"]; string qyId = context.Request.QueryString["qyid"]; string rowid = context.Request.QueryString["rowid"]; string befrom = context.Request.QueryString["befrom"]; string dwlx = context.Request.QueryString["dwlx"]; object sessionAppUser = context.Session[ConfigManager.GetSignInAppUserSessionName()]; AppUser workUser = (AppUser)sessionAppUser; BLL = new SzqyBLL(workUser); //排序 string orderby = @" " + sortname + " " + sortorder + " "; //通过检索翻译 生成查询条件 FilterTranslator ft = ContextExtension.GetGridData(context); //分页 DataTable dt = new DataTable(); switch (fromWhere) { case "Qyxx": dt = BLL.RetrieveQyxxList(qylx, ft, pagesize, page, orderby, out allRecordCount).Result; break; case "JsdwSsgc": string jsdwID = context.Request.QueryString["jsdwid"]; dt = BLL.RetrieveJsdwSsgc(jsdwID).Result; break; case "Qyclgc": dt = BLL.RetrieveQyclgc(qyId, befrom, dwlx).Result; break; case "Qyzs": dt = BLL.RetrieveQyzs(qyId, befrom).Result; break; case "Zyry": dt = BLL.RetrieveZyry(qyId, ft, pagesize, page, orderby, out allRecordCount).Result; break; case "QyxxView": dt = BLL.RetrieveQyxxViewList(qyId).Result; break; } ft.Parms.Clear(); string result = JSONHelper.DataTableToJson(dt); json = @"{""Rows"":[" + result + @"],""Total"":""" + allRecordCount + @"""}"; context.Response.Write(json); context.Response.End(); }
private string GetGroupList(string q) { //ParentGroupID = "Console"; List <string> lst = new List <string>(); string strSQL = ""; Database db = new Database(); DataTable dt = new DataTable(); int nRet = -1; string json = ""; nRet = db.DBConnect(); if (nRet == 0) { strSQL = "SELECT tblA.GroupID, GroupName " + "FROM SecurityGroup AS tblA " + "INNER JOIN dbo.fn_GetGroupTree(@fn_GetGroupTree) AS tblT ON tblA.GroupID = tblT.GroupID "; if (q != "") { strSQL += "WHERE UPPER(tblA.GroupID + ' ' + GroupName) LIKE '%'+@GroupName+'%'"; } System.Data.SqlClient.SqlCommand SqlCom = new System.Data.SqlClient.SqlCommand(MDS.Utility.NUtility.checkString(strSQL), db.getOcnn()); SqlCom.Parameters.Add(new System.Data.SqlClient.SqlParameter("@fn_GetGroupTree", Session["ParentGroupID"].ToString())); if (q != "") { SqlCom.Parameters.Add(new System.Data.SqlClient.SqlParameter("@GroupName", q.ToUpper())); } nRet = db.ExecQuerySQLCommand(SqlCom, ref dt); if (nRet == 0) { // Serialize json = JSONHelper.DataTableToJson(ref dt); //無論是否有資料, 都要回傳陣列字串 //strGroupList = "[" + string.Join(",", lst.ToArray()) + "]"; } else { return(db.outMsg); } db.DBDisconnect(); } else { return(db.outMsg); } //string filepath = @"c:\temp\posttestLog\"; //System.IO.File.WriteAllText(filepath + "mdstest.txt", json + ">" + strSQL + ">"+q); return(json); }
/// <summary> /// 获取近五年的代码表 /// </summary> /// <returns></returns> public string ReadJwn() { DataTable dt = ueppCodeDAL.ReadJwn(); string json = JSONHelper.DataTableToJson(dt); json = @"[" + json + "]"; return(json); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int allRecordCount = 0; string sortname = context.Request.Params["sortname"]; string sortorder = context.Request.Params["sortorder"]; int page = Convert.ToInt32(context.Request.Params["page"]) - 1; // 系统的索引从0开始,所以此处需要减1 int pagesize = Convert.ToInt32(context.Request.Params["pagesize"]); string fromWhere = context.Request.QueryString["fromwhere"]; string rowid = context.Request.QueryString["rowid"]; object sessionAppUser = context.Session[ConfigManager.GetSignInAppUserSessionName()]; AppUser workUser = (AppUser)sessionAppUser; xmxxBLL = new XmxxBLL(workUser); //排序 string orderby = @" " + sortname + " " + sortorder + " "; //通过检索翻译 生成查询条件 FilterTranslator ft = ContextExtension.GetGridData(context); //分页 DataTable dt = new DataTable(); string json = String.Empty; switch (fromWhere) { case "ajxxList": dt = xmxxBLL.RetrieveAjxxList(ft, pagesize, page, orderby, out allRecordCount); break; case "zjxxList": dt = xmxxBLL.RetrieveZjxxList(ft, pagesize, page, orderby, out allRecordCount); break; case "ajxx_ryxxList": string aqjdbm = context.Request.QueryString["aqjdbm"]; dt = xmxxBLL.RetrieveAjxx_RyxxList(aqjdbm, ft, pagesize, page, orderby, out allRecordCount); break; case "zjxx_ryxxList": string zljdbm = context.Request.QueryString["zljdbm"]; dt = xmxxBLL.RetrieveZjxx_RyxxList(zljdbm, ft, pagesize, page, orderby, out allRecordCount); break; case "lxxmList": dt = xmxxBLL.RetrieveLxxmList(ft, pagesize, page, orderby, out allRecordCount); break; } ft.Parms.Clear(); string result = JSONHelper.DataTableToJson(dt); //result = Regex.Replace(result, @"[/n/r]", ""); //去掉字符串里所有换行符 //result = result.TrimEnd((char[])"\n\r".ToCharArray()); //去掉换行符 json = @"{""Rows"":[" + result + @"],""Total"":""" + allRecordCount + @"""}"; context.Response.Write(json); context.Response.End(); }
/// <summary> /// 获取所有模块名称 /// </summary> /// <returns></returns> public string ReadMkmc() { DataTable dt = ueppCodeDAL.ReadMkmc(); string json = JSONHelper.DataTableToJson(dt); if (true) { string _str = "{ \"id\":\"-10000\",\"value\":\"-10000\",\"text\":\"--所有--\"},"; json = _str + json; } json = @"[" + json + "]"; return(json); }
/// <summary> /// 获取一组代码键值信息(最新写法) /// </summary> /// <param name="codeType">代码类型</param> /// <param name="parentCodeType">父代码类型</param> /// <param name="parentCodeInfo">父代码的名称(注意:不是父代码值)</param> /// <returns></returns> public string SelectKeyValue_New(CodeType codeType, CodeType parentCodeType, string parentCodeInfo, bool isAddSpaceItem) { DataTable dt = ueppCodeDAL.SelectKeyValue_New(codeType, parentCodeType, parentCodeInfo); string json = JSONHelper.DataTableToJson(dt); if (isAddSpaceItem) { string _str = "{ \"id\":\"-10000\",\"value\":\"-10000\",\"text\":\"--所有--\"},"; json = _str + json; } json = @"[" + json + "]"; return(json); }
/// <summary> /// 获取EasyUI所需的Json /// </summary> /// <returns></returns> public static string GetEasyUIJson(string sql, string orderStr, int pageIndex, int pageSize, params SqlParameter[] cmdParams) { string jsonResult; int rowsTotal; DataTable dt; using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectingString)) { rowsTotal = SqlHelper.GetRowsCount(conn, sql, cmdParams); dt = SqlHelper.GetPagedDataTable(conn, sql, orderStr, pageIndex, pageSize, cmdParams); } jsonResult = JSONHelper.DataTableToJson(dt); jsonResult = "{\"total\":" + "\"" + rowsTotal.ToString() + "\",\"rows\":" + jsonResult + "}"; return(jsonResult); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int allRecordCount = 0; string json = ""; string sortname = context.Request.Params["sortname"]; string sortorder = context.Request.Params["sortorder"]; int page = Convert.ToInt32(context.Request.Params["page"]) - 1; // 系统的索引从0开始,所以此处需要减1 int pagesize = Convert.ToInt32(context.Request.Params["pagesize"]); string fromWhere = context.Request.QueryString["fromwhere"]; string type = context.Request.QueryString["type"]; object sessionAppUser = context.Session[ConfigManager.GetSignInAppUserSessionName()]; AppUser workUser = (AppUser)sessionAppUser; xytxBLL = new XytxBLL(workUser); //排序 string orderby = @" " + sortname.ToString2() + " " + sortorder.ToString2() + " "; orderby = orderby.Trim(); //通过检索翻译 生成查询条件 FilterTranslator ft = ContextExtension.GetGridData(context); //分页 DataTable dt = new DataTable(); switch (fromWhere) { case "qyxykp": string qylx = context.Request.QueryString["qylx"]; dt = xytxBLL.RetrieveQyxykp(qylx, ft, pagesize, page, orderby, out allRecordCount); break; case "xzcf": //throw new Exception("aaa"); dt = xytxBLL.RetrieveXzcf(type, ft, pagesize, page, orderby, out allRecordCount); break; } ft.Parms.Clear(); string result = JSONHelper.DataTableToJson(dt); //result = Regex.Replace(result, @"[/n/r]", ""); //去掉字符串里所有换行符 //result = result.TrimEnd((char[])"\n\r".ToCharArray()); //去掉换行符 json = @"{""Rows"":[" + result + @"],""Total"":""" + allRecordCount + @"""}"; context.Response.Write(json); context.Response.End(); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int allRecordCount = 0; string sortname = context.Request.Params["sortname"]; string sortorder = context.Request.Params["sortorder"]; int page = Convert.ToInt32(context.Request.Params["page"]) - 1; // 系统的索引从0开始,所以此处需要减1 int pagesize = Convert.ToInt32(context.Request.Params["pagesize"]); string fromWhere = context.Request.QueryString["fromwhere"]; object sessionAppUser = context.Session[ConfigManager.GetSignInAppUserSessionName()]; BLL = new ZlctBLL((AppUser)sessionAppUser); //排序 string orderby = @" " + sortname + " " + sortorder + " "; //通过检索翻译 生成查询条件 FilterTranslator ft = ContextExtension.GetGridData(context); //分页 DataTable dt = new DataTable(); switch (fromWhere) { case "Gzzs_List": dt = BLL.RetrieveGzzs_List(ft, pagesize, page, orderby, out allRecordCount).Result; break; case "Zshf_all_List": dt = BLL.RetrieveZshf_all_List(ft, pagesize, page, orderby, out allRecordCount).Result; break; case "DxjbSendRecords_List": dt = BLL.RetrieveDxjbSendRecords_List(ft, pagesize, page, orderby, out allRecordCount).Result; break; case "YzDxjb_List": dt = BLL.RetrieveYzDxjb_List(ft, pagesize, page, orderby, out allRecordCount).Result; break; } ft.Parms.Clear(); string result = JSONHelper.DataTableToJson(dt); json = @"{""Rows"":[" + result + @"],""Total"":""" + allRecordCount + @"""}"; context.Response.Write(json); context.Response.End(); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int allRecordCount = 0; string sortname = context.Request.Params["sortname"]; string sortorder = context.Request.Params["sortorder"]; int page = Convert.ToInt32(context.Request.Params["page"]) - 1; // 系统的索引从0开始,所以此处需要减1 int pagesize = Convert.ToInt32(context.Request.Params["pagesize"]); string fromWhere = context.Request.QueryString["fromwhere"]; //string qylx = context.Request.QueryString["qylx"]; //string qyId = context.Request.QueryString["qyid"]; string rowid = context.Request.QueryString["rowid"]; object sessionAppUser = context.Session[ConfigManager.GetSignInAppUserSessionName()]; AppUser workUser = (AppUser)sessionAppUser; BLL = new GzyjBLL((AppUser)sessionAppUser); //排序 string orderby = @" " + sortname + " " + sortorder + " "; //通过检索翻译 生成查询条件 FilterTranslator ft = ContextExtension.GetGridData(context); //分页 DataTable dt = new DataTable(); //switch (fromWhere) //{ //case "qyzsgq": dt = BLL.Retrieve(fromWhere, workUser, ft, pagesize, page, orderby, out allRecordCount).Result; // break; // case "JsdwAjxm": // dt = BLL.RetrieveJsdwAjxm(rowid, pagesize, page, orderby, out allRecordCount).Result; // break; // case "QyxxView": // dt = BLL.RetrieveQyxxViewList(qyId, ft).Result; // break; //} ft.Parms.Clear(); string result = JSONHelper.DataTableToJson(dt); result = Regex.Replace(result, @"[\n\r]", ""); //去掉字符串里所有换行符 json = @"{""Rows"":[" + result + @"],""Total"":""" + allRecordCount + @"""}"; context.Response.Write(json); context.Response.End(); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int allRecordCount = 0; string sortname = context.Request.Params["sortname"]; string sortorder = context.Request.Params["sortorder"]; int page = Convert.ToInt32(context.Request.Params["page"]) - 1; // 系统的索引从0开始,所以此处需要减1 int pagesize = Convert.ToInt32(context.Request.Params["pagesize"]); string fromWhere = context.Request.QueryString["fromwhere"]; string xmlx = context.Request.QueryString["xmlx"]; string rowid = context.Request.QueryString["rowid"]; string zljdid = context.Request.QueryString["zljdid"]; string aqjdid = context.Request.QueryString["aqjdid"]; string sgxkid = context.Request.QueryString["sgxkid"]; string sgxmtybh = context.Request.QueryString["sgxmtybh"]; string qyId = context.Request.QueryString["qyid"]; string befrom = context.Request.QueryString["befrom"]; object sessionAppUser = context.Session[ConfigManager.GetSignInAppUserSessionName()]; AppUser workUser = (AppUser)sessionAppUser; BLL = new SzgcBLL(workUser); bll = new SzqyBLL(workUser); //排序 string orderby = @" " + sortname + " " + sortorder + " "; //通过检索翻译 生成查询条件 FilterTranslator ft = ContextExtension.GetGridData(context); //分页 DataTable dt = new DataTable(); switch (fromWhere) { case "Lxbd": dt = BLL.RetrieveLxbd(rowid, ft, pagesize, page, orderby, out allRecordCount).Result; break; case "Xmxx": dt = BLL.RetrieveSzgc(xmlx, workUser, ft, pagesize, page, orderby, out allRecordCount).Result; break; case "GcxmHtba": dt = BLL.RetrieveGcxmHtba(rowid, pagesize, page, orderby, out allRecordCount).Result; break; case "GcxmAqjd": dt = BLL.RetrieveGcxmAqjd(rowid, pagesize, page, orderby, out allRecordCount).Result; break; case "GcxmZljd": dt = BLL.RetrieveGcxmZljd(rowid, pagesize, page, orderby, out allRecordCount).Result; break; case "GcxmSgxk": dt = BLL.RetrieveGcxmSgxk(rowid, pagesize, page, orderby, out allRecordCount).Result; break; case "GcxmJgys": dt = BLL.RetrieveGcxmJgys(rowid, pagesize, page, orderby, out allRecordCount).Result; break; case "DwgcList": dt = BLL.RetrieveDwgcList(rowid, pagesize, page, orderby, out allRecordCount).Result; break; case "Aqbjxmzcy": dt = BLL.RetrieveAqbjxmzcy(rowid, befrom).Result; break; case "AqjdZljd": dt = BLL.RetrieveAqjdZljd(rowid).Result; break; case "AqjdSgxk": dt = BLL.RetrieveAqjdSgxk(rowid).Result; break; case "AqjdJgba": dt = BLL.RetrieveAqjdJgba(rowid).Result; break; case "zljdDtgc": dt = BLL.RetrieveZljdDtgc(rowid, befrom).Result; break; case "zljdSgxk": dt = BLL.RetrieveZljdSgxk(rowid).Result; break; case "zljdJgba": dt = BLL.RetrieveZljdJgba(rowid).Result; break; case "sgxk": dt = BLL.RetrieveSgxk(rowid).Result; break; case "sgxkJgba": dt = BLL.RetrieveSgxkJgba(rowid).Result; break; case "QyxxView": dt = bll.RetrieveQyxxViewList(qyId).Result; break; } ft.Parms.Clear(); string result = JSONHelper.DataTableToJson(dt); //result = Regex.Replace(result, @"[/n/r]", ""); //去掉字符串里所有换行符 //result = result.TrimEnd((char[])"\n\r".ToCharArray()); //去掉换行符 json = @"{""Rows"":[" + result + @"],""Total"":""" + allRecordCount + @"""}"; context.Response.Write(json); context.Response.End(); }