protected void Page_Load(object sender, EventArgs e) { //模拟长时间处理 //Thread.Sleep(5000); //获取参数 DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); //调用框架免代理通用接口删,公用一下删除接口 string return_str = ""; object[] re_dsi = IPC.Call("框架免代理通用接口删", new object[] { dt_request }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 return_str = re_dsi[1].ToString(); } else { return_str = "调用错误" + re_dsi[1].ToString(); } //返回下载地址和状态"" Response.Write(return_str); }
protected void Page_Load(object sender, EventArgs e) { masterpageleftmenu1.OnNeedLoadData += new masterpageleftmenu.OnNeedDataHandler(MyWebControl_OnNeedLoadData); this.Page.Title = ConfigurationManager.AppSettings["SYSname"] + " --- 系统管理"; titleshowname.InnerHtml = ConfigurationManager.AppSettings["SYSname"] + " --- 系统管理"; mysmlogo.Src = ConfigurationManager.AppSettings["mylogo_s"]; showusername.InnerHtml = UserSession.登录名; //获取用户头像 object[] re_dsi = IPC.Call("获取用户头像", new object[] { UserSession.唯一键 }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 mytouiang = re_dsi[1].ToString(); } DataSet ds_znx = GetInfo_znxtop(); if (ds_znx != null) { repeater_znx.DataSource = ds_znx.Tables["站内信提醒"]; repeater_znx.DataBind(); znxsl = ds_znx.Tables["站内信提醒"].Rows.Count.ToString(); } }
/// <summary> /// 将导入的数据保存到对应数据表中 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button2_Click(object sender, EventArgs e) { DataTable dtTemp = GetOneSheet(TextBox1.Text, TextBox2.Text).Tables[0]; //调用远程接口处理这个导入。 //验证是否含有规定的字段 string lie = liejiancha; string[] liearr = lie.Split(','); string queshao = ""; for (int i = 0; i < liearr.Length; i++) { if (!dtTemp.Columns.Contains(liearr[i])) { queshao = queshao + liearr[i] + ","; } } if (queshao != "") { //列名存在异常 tishimsg.Text = "无法导入,导入的电子表格缺少列: " + queshao; return; } //调用接口,开始导入 //调用执行方法获取数据 object[] re_dsi = IPC.Call("通过电子表格导入数据", new object[] { dtTemp, UserSession.唯一键, drbj }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataSet dsreturn = (DataSet)re_dsi[1]; if (dsreturn.Tables["返回值单条"].Rows[0]["执行结果"].ToString() == "ok") { //如果成功 tishimsg.Text = dsreturn.Tables["返回值单条"].Rows[0]["提示文本"].ToString(); return; } else { //如果失败 tishimsg.Text = dsreturn.Tables["返回值单条"].Rows[0]["提示文本"].ToString(); return; } } else { tishimsg.Text = re_dsi[1].ToString(); return; } }
private DataSet GetInfo_znxtop() { object[] re_dsi = IPC.Call("获取站内信右上角提醒", new object[] { "system" }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 return((DataSet)(re_dsi[1])); } return(null); }
/// <summary> /// 获取通用列表配置 /// </summary> /// <returns></returns> public static DataSet Get_FormsListDB(string formFID) { object[] re_dsi = IPC.Call("获取通用数据列表配置", new object[] { formFID }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 return((DataSet)(re_dsi[1])); } return(null); }
protected void Page_Load(object sender, EventArgs e) { //验证权限 AuthComm.chekcAuth_fromsession("1", UserSession.最终权值_后台菜单权限, true); if (!IsPostBack) { //绑定所有可选权限 //调用执行方法获取数据 DataSet ds = new DataSet(); object[] re_dsi = IPC.Call("获取所有已启用的权限枚举", new object[] { "" }); if (re_dsi[0].ToString() == "ok" && re_dsi[1] != null) { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 ds = (DataSet)re_dsi[1]; Unumber1.DataSource = ds.Tables[0]; Unumber1.DataTextField = "ANBaseName"; Unumber1.DataValueField = "ANBaseNumber"; Unumber1.DataBind(); Unumber2.DataSource = ds.Tables[1]; Unumber2.DataTextField = "ANBaseName"; Unumber2.DataValueField = "ANBaseNumber"; Unumber2.DataBind(); Unumber3.DataSource = ds.Tables[2]; Unumber3.DataTextField = "ANBaseName"; Unumber3.DataValueField = "ANBaseNumber"; Unumber3.DataBind(); Unumber4.DataSource = ds.Tables[3]; Unumber4.DataTextField = "ANBaseName"; Unumber4.DataValueField = "ANBaseNumber"; Unumber4.DataBind(); Unumber5.DataSource = ds.Tables[4]; Unumber5.DataTextField = "ANBaseName"; Unumber5.DataValueField = "ANBaseNumber"; Unumber5.DataBind(); } else { errmsg.Text = re_dsi[1].ToString();//向客户端输出错误字符串 } //加载菜单 ReLoadNode(); } }
protected void Page_Load(object sender, EventArgs e) { //if (Request["yz"] == null || Request["yz"].Trim() != "000") //{ // if (Request.UrlReferrer == null || Request.UrlReferrer.ToString().Trim() == "" || (Request.UrlReferrer.ToString().IndexOf(":28888") < 0 && Request.UrlReferrer.ToString().IndexOf(":8866") < 0 && Request.UrlReferrer.ToString().IndexOf(":3456") < 0)) // { // arr_tupian = new string[] { }; // Response.Write("无法识别的操作来源"); // return; // } //} DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); ///st.aspx|&xxx=1|idforedit|_blank object[] re_dsi = IPC.Call("获取单据图片列表", new object[] { dt_request }); if (re_dsi[0].ToString() == "ok" && re_dsi[1] != null) { ds_DD = (DataSet)(re_dsi[1]); try { arr_tupian = ds_DD.Tables["数据记录"].Rows[0]["tupian"].ToString().Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); /* * //如果只有一个文件,直接转到下载链接 * if (arr_tupian.Length == 1) * { * //单如果是特定格式,就打开而不是下载 * if (Checktu(arr_tupian[0])) * { * Response.Redirect("st_d.aspx?fn=" + arr_tupian[0]); * } * else * { * Response.Redirect(arr_tupian[0]); * } * * return; * } */ } catch (Exception ex) { Response.Write("暂无图片"); arr_tupian = new string[] { }; } } else { Response.Write("错误err,接口调用失败"); } }
protected void Page_Load(object sender, EventArgs e) { //获取我参与的未结单的会签 //获取参数 DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); dt_request.Rows.Add(new string[] { "hqlx", "mylist", "临时添加" }); object[] re_dsi = IPC.Call("获取会签数据", new object[] { dt_request }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dsr = (DataSet)(re_dsi[1]); } }
protected void Page_Load(object sender, EventArgs e) { DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); object[] re_dsi = IPC.Call("获取考勤数据", new object[] { dt_request }); if (re_dsi[0].ToString() == "ok" && re_dsi[1] != null) { Response.Write(re_dsi[1].ToString()); } else { Response.Write("错误err,接口调用失败"); } }
protected void Page_Load(object sender, EventArgs e) { if (UserSession.唯一键 == "") { Response.Write("保存失败,找不到用户登录状态信息。"); return; } if (Request["caozuo"].ToString() == "") { Response.Write("保存失败,操作不明确。"); return; } if (Request["id"].ToString() == "") { Response.Write("保存失败,布局目标不明确。"); return; } if (Request["lx"].ToString() == "") { Response.Write("保存失败,布局目标类型不明确。"); return; } //保存布局 string sp = ""; if (Request["caozuo"].ToString() == "baocun") { sp = "保存"; } if (Request["caozuo"].ToString() == "chongzhi") { sp = "重置"; } object[] re_dsi = IPC.Call("保存或者获取用户布局", new object[] { UserSession.唯一键, Request["lx"].ToString(), Request["id"].ToString(), Request["jsonstr"].ToString(), sp }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataSet dsreturn = (DataSet)re_dsi[1]; Response.Write(dsreturn.Tables["返回值单条"].Rows[0]["提示文本"].ToString()); } else { Response.Write(re_dsi[1].ToString());//向客户端输出错误字符串 } }
protected void Page_Load(object sender, EventArgs e) { //模拟长时间处理 //Thread.Sleep(5000); //清理历史数据 string lujing = "/exceltemp/"; DelFileAll(Server.MapPath(lujing)); //获取参数 DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); //根据id获取配置自动生成电子表格存到服务器上,注意命名防止重复覆盖。 DataSet dsreturn = new DataSet(); object[] re_dsi = IPC.Call("根据配置生成导出数据", new object[] { dt_request }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dsreturn = (DataSet)(re_dsi[1]); } //文件名 string filename = dsreturn.Tables["返回值单条"].Rows[0]["附件信息1"].ToString() + "-" + DateTime.Now.ToFileTime().ToString() + ".xls"; //生成 if (Directory.Exists(Server.MapPath(lujing))) { } else { DirectoryInfo directoryInfo = new DirectoryInfo(Server.MapPath(lujing)); directoryInfo.Create(); } DataSet dsxlsDB = new DataSet(); dsxlsDB.Tables.Add(dsreturn.Tables["导出的数据"].Copy()); MyXlsClass.goxls(dsxlsDB, filename, dsreturn.Tables["返回值单条"].Rows[0]["附件信息1"].ToString(), dsreturn.Tables["返回值单条"].Rows[0]["附件信息1"].ToString(), 30, Server.MapPath(lujing)); //返回下载地址和状态"" Response.Write("ok|" + lujing + filename); }
protected void Page_Load(object sender, EventArgs e) { Response.ContentType = "text/xml"; Response.Charset = "UTF-8"; try { DataSet dsjieguo = new DataSet(); DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); object[] re_ds = IPC.Call("获取省市区数据", new object[] { dt_request }); if (re_ds[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dsjieguo = (DataSet)re_ds[1]; } else { Response.Write(geterrmod(re_ds[1].ToString())); return; } //转换xml System.IO.StringWriter writer = new System.IO.StringWriter(); if (!dsjieguo.Tables.Contains("省市区数据")) { Response.Write(geterrmod("没有数据!")); return; } dsjieguo.Tables["省市区数据"].WriteXml(writer); string xmlstr = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + writer.ToString(); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(xmlstr); doc.Save(Response.OutputStream); } catch (Exception ex) { Response.Write(geterrmod("获取数据失败,执行错误!")); return; } }
public DataTable dtgzt = new DataTable(); //我的工作台数据 protected void Page_Load(object sender, EventArgs e) { //检查仪表盘显示权限 qx_zysj = AuthComm.chekcAuth_fromsession("2", UserSession.最终权值_全局独立权限, false); ////调用执行方法获取数据 object[] re_dsi = IPC.Call("获取我的工作台数据", new object[] { UserSession.唯一键, "" }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dtgzt = (DataTable)(re_dsi[1]); // } else { dtgzt = null; } }
protected void Page_Load(object sender, EventArgs e) { masterpageleftmenu1.OnNeedLoadData += new masterpageleftmenu.OnNeedDataHandler(MyWebControl_OnNeedLoadData); this.Page.Title = ConfigurationManager.AppSettings["SYSname"] + ""; titleshowname.InnerHtml = ConfigurationManager.AppSettings["SYSname"] + ""; mysmlogo.Src = ConfigurationManager.AppSettings["mylogo_s"]; showusername.InnerHtml = UserSession.登录名; //重新显示右上角为员工姓名 object[] re_dsi_uinf = IPC.Call("获取用户基础资料", new object[] { UserSession.唯一键 }); if (re_dsi_uinf[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataTable dt = (DataTable)re_dsi_uinf[1]; if (dt != null && dt.Columns.Contains("xingming")) { showusername.InnerHtml = dt.Rows[0]["xingming"].ToString() + '[' + showusername.InnerHtml + ']'; } } //获取用户头像 if (System.IO.File.Exists(Server.MapPath("/uploadfiles/faceup/" + UserSession.唯一键 + ".jpg"))) { mytouiang = "/uploadfiles/faceup/" + UserSession.唯一键 + ".jpg"; } DataSet ds_znx = GetInfo_znxtop(); if (ds_znx != null) { repeater_znx.DataSource = ds_znx.Tables["站内信提醒"]; repeater_znx.DataBind(); znxsl = ds_znx.Tables["站内信提醒"].Rows.Count.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { /* * if(Request["hqbz"].ToString() == "pie") * { * Response.Write(" { label: 'ddd', data: 10, shuliang: '233', color: '#68BC31' },{ label: '--', data: 20, shuliang: '233', color: '#2091CF' },{ label: '--', data: 30, shuliang: '233', color: '#AF4E96' },{ label: '--', data: 40, shuliang: '233', color: '#DA5430' }, { label: '--', data: 50, shuliang: '233', color: '#FEE074' }"); * } */ //调用执行方法获取数据 object[] re_dsi = IPC.Call("获取仪表盘数据", new object[] { Request["hqbz"].ToString(), UserSession.唯一键, "" }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 string restr = re_dsi[1].ToString(); // Response.Write(restr); } else { Response.Write("");//向客户端输出错误字符串 } }
protected void Page_Load(object sender, EventArgs e) { if (Request["idforedit"] == null || Request["idforedit"].Trim() == "") { return; } //调用执行方法获取数据 DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); object[] re_dsi = IPC.Call("获取数据demo", new object[] { dt_request }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataSet dsreturn = (DataSet)re_dsi[1]; showinfor.DataSource = dsreturn.Tables["数据记录"].DefaultView;//数据绑定 showinfor.DataBind(); //Response.Write(dsreturn.Tables["返回值单条"].Rows[0]["提示文本"].ToString()); } else { Response.Write(re_dsi[1].ToString());//向客户端输出错误字符串 } }
protected void Page_Load(object sender, EventArgs e) { //Response.Write(echostr); //公众平台上开发者设置的token, corpID, EncodingAESKey //string sToken = "QDG6eK"; string sToken = ConfigurationManager.AppSettings["wx_Token"].ToString(); //string sCorpID = "wxdb0c8553d3bf3ad5"; string sCorpID = ConfigurationManager.AppSettings["wx_CorpID"].ToString(); //string sEncodingAESKey = "jWmYm7qr5nMoAUwZRjGtBxmz3KA1tkAj3ykkR6q2B2C"; string sEncodingAESKey = ConfigurationManager.AppSettings["wx_EncodingAESKey"].ToString(); //string wx_corpsecret = "Mte0XxwwFPy9qbcztpE9CCsbuApg6eeSmljzghtax1H7wg2jFbSH_w3h-TbeXJjq"; string wx_corpsecret = ConfigurationManager.AppSettings["wx_corpsecret"].ToString(); string wx_agentid = ConfigurationManager.AppSettings["wx_agentid"].ToString(); if (Request["sendmsgf"] != null) { //发送微信消息 if (Request["sendmsgf"].ToString() == "test") { WebClient client = new WebClient(); //获取access_token string content = client.DownloadString("https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + sCorpID + "&corpsecret=" + wx_corpsecret + ""); string access_token = content.Split(',')[0].Split(':')[1].Replace("\"", "").Replace(" ", ""); string msg_json = "{"; msg_json = msg_json + "\"touser\": \"[[UserID]]\","; //msg_json = msg_json + "\"toparty\": \"PartyID1|PartyID2\","; //msg_json = msg_json + "\"totag\": \"TagID1|TagID2\","; msg_json = msg_json + "\"msgtype\": \"text\","; msg_json = msg_json + "\"agentid\": " + wx_agentid + ","; msg_json = msg_json + "\"text\": {\"content\": \"[[MsgContent]]\"},"; msg_json = msg_json + "\"safe\":\"0\"}"; msg_json = msg_json.Replace("[[UserID]]", "gotodk"); msg_json = msg_json.Replace("[[MsgContent]]", "测试消息22"); string restr = PostWebRequest("https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=" + access_token, msg_json, Encoding.UTF8); Response.Write(restr); } if (Request["sendmsgf"].ToString() == "send") { WebClient client = new WebClient(); //获取access_token string content = client.DownloadString("https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + sCorpID + "&corpsecret=" + wx_corpsecret + ""); string access_token = content.Split(',')[0].Split(':')[1].Replace("\"", "").Replace(" ", ""); string msg_json = "{"; msg_json = msg_json + "\"touser\": \"[[UserID]]\","; //msg_json = msg_json + "\"toparty\": \"PartyID1|PartyID2\","; //msg_json = msg_json + "\"totag\": \"TagID1|TagID2\","; msg_json = msg_json + "\"msgtype\": \"text\","; msg_json = msg_json + "\"agentid\": " + wx_agentid + ","; msg_json = msg_json + "\"text\": {\"content\": \"[[MsgContent]]\"},"; msg_json = msg_json + "\"safe\":\"0\"}"; //连接数据库,获取要发送的消息列表,获取的同时要更新成微信已发送,不管是否发送成功。 string restr = "微信消息发送结果:"; DataSet dsmsg = new DataSet(); object[] re_dsi_wx = IPC.Call("获取待发送微信消息的提醒", new object[] { "所有未发送" }); if (re_dsi_wx[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dsmsg = (DataSet)(re_dsi_wx[1]); if (dsmsg.Tables["返回值单条"].Rows[0]["执行结果"].ToString() == "ok") { for (int i = 0; i < dsmsg.Tables["待发数据"].Rows.Count; i++) { string msg_json_init = msg_json; msg_json_init = msg_json_init.Replace("[[UserID]]", dsmsg.Tables["待发数据"].Rows[i]["Uloginname"].ToString()); msg_json_init = msg_json_init.Replace("[[MsgContent]]", dsmsg.Tables["待发数据"].Rows[i]["msgtitle"].ToString()); restr = restr + Environment.NewLine + "---" + PostWebRequest("https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=" + access_token, msg_json_init, Encoding.UTF8); } } } else { string err = "调用错误" + re_dsi_wx[1].ToString(); Response.Write(err); return; } Response.Write(restr); } } if (Request["code"] != null) { try { string code = Request["code"].ToString(); //Response.Write(code); WebClient client = new WebClient(); //获取access_token string content = client.DownloadString("https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + sCorpID + "&corpsecret=" + wx_corpsecret + ""); string access_token = content.Split(',')[0].Split(':')[1].Replace("\"", "").Replace(" ", ""); //Response.Write(access_token); //client.Encoding = Encoding.UTF8; string address = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=" + access_token + "&code=" + code; //Response.Redirect(address); string endstr = client.DownloadString(address); Response.Write(endstr); HTMLAnalyzeClass HAC = new HTMLAnalyzeClass(); string wxusername = HAC.My_Cut_Str(endstr, "UserId\":\"", "\"", 1, false)[0].ToString(); //尝试找到对应账号和密码,如果找到,自动跳转到自动登录界面 string jm = ""; object[] re_dsi_wx = IPC.Call("获取微信自动登录参数", new object[] { wxusername }); if (re_dsi_wx[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 jm = re_dsi_wx[1].ToString(); } else { string err = "调用错误" + re_dsi_wx[1].ToString(); jm = ""; } //string zhanghao = wxusername; //string mima = "48d757d7d2c387c0f25d7bece01768dd"; //string jm = zhanghao+"|"+ mima; Response.Redirect("/adminht/login.aspx?aulgogo=1&aulcscs=" + jm + ""); //Response.Write(wxusername); } catch (Exception ex) { Response.Write(ex.ToString()); } } //仅用于验证 if (Request["echostr"] != null) { string msg_signature = Request["msg_signature"].ToString(); string timestamp = Request["timestamp"].ToString(); string nonce = Request["nonce"].ToString(); string echostr = Request["echostr"].ToString(); /* * ------------使用示例一:验证回调URL--------------- *企业开启回调模式时,企业号会向验证url发送一个get请求 * 假设点击验证时,企业收到类似请求: * GET /cgi-bin/wxpush?msg_signature=5c45ff5e21c57e6ad56bac8758b79b1d9ac89fd3×tamp=1409659589&nonce=263014780&echostr=P9nAzCzyDtyTWESHep1vC5X9xho%2FqYX3Zpb4yKa9SKld1DsH3Iyt3tP3zNdtp%2B4RPcs8TgAE7OaBO%2BFZXvnaqQ%3D%3D * HTTP/1.1 Host: qy.weixin.qq.com * * 接收到该请求时,企业应 1.解析出Get请求的参数,包括消息体签名(msg_signature),时间戳(timestamp),随机数字串(nonce)以及公众平台推送过来的随机加密字符串(echostr), * 这一步注意作URL解码。 * 2.验证消息体签名的正确性 * 3.解密出echostr原文,将原文当作Get请求的response,返回给公众平台 * 第2,3步可以用公众平台提供的库函数VerifyURL来实现。 */ Tencent.WXBizMsgCrypt wxcpt = new Tencent.WXBizMsgCrypt(sToken, sEncodingAESKey, sCorpID); string sVerifyMsgSig = msg_signature; //string sVerifyMsgSig = "5c45ff5e21c57e6ad56bac8758b79b1d9ac89fd3"; string sVerifyTimeStamp = timestamp; //string sVerifyTimeStamp = "1409659589"; string sVerifyNonce = nonce; //string sVerifyNonce = "263014780"; string sVerifyEchoStr = echostr; //string sVerifyEchoStr = "P9nAzCzyDtyTWESHep1vC5X9xho/qYX3Zpb4yKa9SKld1DsH3Iyt3tP3zNdtp+4RPcs8TgAE7OaBO+FZXvnaqQ=="; int ret = 0; string sEchoStr = ""; ret = wxcpt.VerifyURL(sVerifyMsgSig, sVerifyTimeStamp, sVerifyNonce, sVerifyEchoStr, ref sEchoStr); if (ret != 0) { System.Console.WriteLine("ERR: VerifyURL fail, ret: " + ret); return; } //ret==0表示验证成功,sEchoStr参数表示明文,用户需要将sEchoStr作为get请求的返回参数,返回给企业号。 Response.Write(sEchoStr); } }
protected void Page_Load(object sender, EventArgs e) { //处理ajax请求 string ajaxrun = ""; if (Request["ajaxrun"] == null || Request["ajaxrun"].ToString().Trim() == "") { return; } if (Request["jkname"] == null || Request["jkname"].ToString().Trim() == "") { return; } if (Request["zhanghao"] == null || Request["zhanghao"].ToString().Trim() == "" || Request["mima"] == null || Request["mima"].ToString().Trim() == "") { return; } string jkname = Request["jkname"].ToString(); ajaxrun = Request["ajaxrun"].ToString(); string zhanghao = Request["zhanghao"].ToString().Trim(); string mima = Request["mima"].ToString().Trim(); if (ajaxrun == "backlogin") { //处理验证码 string c = "0"; HttpCookie aaa = Request.Cookies["vccs"]; if (aaa == null) { c = "0"; Response.Cookies["vccs"].Value = "0"; Response.Cookies["vccs"].Expires = DateTime.Now.Add(new TimeSpan(6, 0, 0)); } c = Request.Cookies["vccs"].Value; if (Convert.ToInt32(c) >= 5)//超过错误次数才对验证码进行校验 { if (Request["yanzhengma"] == null || Request["yanzhengma"].ToString().Trim() == "" || Request["yanzhengma"].ToString().Trim().ToLower() != Session["ValidateCode"].ToString().ToLower()) { Response.Write("验证码错误!"); //搞乱验证码 Session["ValidateCode"] = Guid.NewGuid().ToString(); return; } } //调用执行方法获取数据 object[] re_dsi = IPC.Call(jkname, new object[] { zhanghao, mima, AuthComm.IP }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataSet dsreturn = (DataSet)re_dsi[1]; if (dsreturn.Tables["返回值单条"].Rows[0]["执行结果"].ToString() == "ok") { UserSession.唯一键 = dsreturn.Tables["用户信息"].Rows[0]["UAid"].ToString(); UserSession.登录名 = dsreturn.Tables["用户信息"].Rows[0]["Uloginname"].ToString(); UserSession.是否超管 = dsreturn.Tables["用户信息"].Rows[0]["SuperUser"].ToString(); UserSession.最终权值_后台菜单权限 = dsreturn.Tables["用户信息"].Rows[0]["UfinalUnumber1"].ToString(); UserSession.最终权值_前台导航权限 = dsreturn.Tables["用户信息"].Rows[0]["UfinalUnumber2"].ToString(); UserSession.最终权值_全局独立权限 = dsreturn.Tables["用户信息"].Rows[0]["UfinalUnumber3"].ToString(); UserSession.最终权值_特殊权限 = dsreturn.Tables["用户信息"].Rows[0]["UfinalUnumber4"].ToString(); UserSession.最终权值_备用权限 = dsreturn.Tables["用户信息"].Rows[0]["UfinalUnumber5"].ToString(); Response.Cookies["user_Uloginname_onlyforinput"].Value = Server.UrlEncode(dsreturn.Tables["用户信息"].Rows[0]["Uloginname"].ToString()); Response.Cookies["user_Uloginname_onlyforinput"].Expires = DateTime.MaxValue; Response.Write("ok"); return; } else { if (dsreturn.Tables["返回值单条"].Rows[0]["执行结果"].ToString() == "err_olnypassworderr") { //密码错误次数 Response.Cookies["vccs"].Value = (Convert.ToInt32(c) + 1).ToString(); Response.Cookies["vccs"].Expires = DateTime.Now.Add(new TimeSpan(6, 0, 0)); } Response.Write(dsreturn.Tables["返回值单条"].Rows[0]["提示文本"].ToString()); return; } } else { Response.Write(re_dsi[1].ToString());//向客户端输出错误字符串 return; } } }
/// <summary> /// 重新加载菜单 /// </summary> private void ReLoadNode() { errmsg.Text = ""; ht_nemu_tb["class_org"] = "组织架构"; ht_nemu_tb["class_zhishi"] = "知识分类"; ht_nemu_tb["class_wxerr"] = "维修错误分类"; if (Request["tb"] == null || Request["tb"].ToString().Trim() == "") { tbshowname = "组织架构"; dbtbname.Text = "class_org"; } else { string tb1 = Request["tb"].ToString().Trim(); if (ht_nemu_tb.Contains(tb1)) { tbshowname = ht_nemu_tb[tb1].ToString(); } else { tbshowname = ""; } dbtbname.Text = tb1; } if (Request["sortid"] == null || Request["sortid"].ToString().Trim() == "") { sh_SortID.Text = "0"; ee_SortID.Text = "0"; } else { sh_SortID.Text = Request["sortid"].ToString().Trim(); ee_SortID.Text = Request["sortid"].ToString().Trim(); } //加载原始数据等待修改 if (sh_SortID.Text == "0" || sh_SortID.Text == "" || dbtbname.Text == "") { } else { //调用执行方法获取数据 DataSet dsD = new DataSet(); object[] re_dsiD = IPC.Call("获取单条菜单数据", new object[] { dbtbname.Text, sh_SortID.Text }); if (re_dsiD[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dsD = (DataSet)re_dsiD[1]; try { ee_SortName.Text = dsD.Tables["数据记录"].Rows[0]["SortName"].ToString(); sh_SortName.Text = dsD.Tables["数据记录"].Rows[0]["SortName"].ToString(); ee_m_url.Text = dsD.Tables["数据记录"].Rows[0]["m_url"].ToString(); ee_m_tip.Text = dsD.Tables["数据记录"].Rows[0]["m_tip"].ToString(); ee_m_tag.Text = dsD.Tables["数据记录"].Rows[0]["m_tag"].ToString(); ee_m_ico.Text = dsD.Tables["数据记录"].Rows[0]["m_ico"].ToString(); string yc = dsD.Tables["数据记录"].Rows[0]["m_show"].ToString(); if (yc == "不隐藏") { ee_m_show1.Checked = true; ee_m_show0.Checked = false; } else { ee_m_show1.Checked = false; ee_m_show0.Checked = true; } } catch (Exception ex) { errmsg.Text = "获取数据出错"; } } else { errmsg.Text = re_dsiD[1].ToString();//向客户端输出错误字符串 } } TV.Nodes.Clear(); //调用执行方法获取数据 DataTable dt = new DataTable(); object[] re_dsi = IPC.Call("获取菜单数据", new object[] { dbtbname.Text, 0, 1 }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dt = (DataTable)re_dsi[1]; } else { errmsg.Text = re_dsi[1].ToString();//向客户端输出错误字符串 } this.InitNode(dt); }
protected void Page_Load(object sender, EventArgs e) { string rehtml = ""; object[] re_dsi = IPC.Call("获取弹窗中列表配置", new object[] { Request["guid"].ToString() }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataSet ds_DD = (DataSet)(re_dsi[1]); string jsmod = File.ReadAllText(Server.MapPath("/pucu/jqgirdjs_for_dialog_mod.txt").ToString()); //根据模板和配置数据,生成js代码 rehtml = jsmod; //复合表头 rehtml = rehtml.Replace("[*[FS_D_setGroupHeaders]*]", ds_DD.Tables["字段配置主表"].Rows[0]["FS_D_setGroupHeaders"].ToString()); //自适应宽度 if (ds_DD.Tables["字段配置主表"].Rows[0]["FS_D_shrinkToFit"].ToString() == "true") { rehtml = rehtml.Replace("[*[FS_D_shrinkToFit]*]", "true"); } else { rehtml = rehtml.Replace("[*[FS_D_shrinkToFit]*]", "false"); } //分页可选量 if (ds_DD.Tables["字段配置主表"].Rows[0]["FD_D_pagesize"].ToString().Trim() == "") { rehtml = rehtml.Replace("[*[FD_D_pagesize]*]", "25,50,100"); rehtml = rehtml.Replace("[*[Default_FD_D_pagesize]*]", "25"); } else { rehtml = rehtml.Replace("[*[FD_D_pagesize]*]", ds_DD.Tables["字段配置主表"].Rows[0]["FD_D_pagesize"].ToString()); rehtml = rehtml.Replace("[*[Default_FD_D_pagesize]*]", ds_DD.Tables["字段配置主表"].Rows[0]["FD_D_pagesize"].ToString().Split(',')[0]); } //列配置 string c_str = ""; //特殊处理第一列 //因为第一列在自带查看里不显示,所以要显示编号需要额外弄一列(这一列在sql取数据时一定要有) c_str = c_str + " { name: '隐藏编号', xmlmap: 'jqgird_spid', hidden: true,frozen:false,hidedlg:true}, " + Environment.NewLine; for (int i = 0; i < ds_DD.Tables["弹窗配置子表"].Rows.Count; i++) { DataRow dr = ds_DD.Tables["弹窗配置子表"].Rows[i]; switch (dr["DID_formatter"].ToString()) { case "字符串": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " }, " + Environment.NewLine; break; case "链接": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'showlink', formatoptions: { baseLinkUrl: '" + dr["DID_formatter_CS"].ToString().Split('|')[0] + "', target: '_blank', showAction: '', addParam: '" + dr["DID_formatter_CS"].ToString().Split('|')[1] + "', idName: '" + dr["DID_formatter_CS"].ToString().Split('|')[2] + "' } }, " + Environment.NewLine; break; case "整数": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'integer' }, " + Environment.NewLine; break; case "小数": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'number' }, " + Environment.NewLine; break; case "日期时间": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'date', formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' } }, " + Environment.NewLine; break; case "仅日期": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'date', formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d' } }, " + Environment.NewLine; break; case "自定义": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + "," + dr["DID_formatter_CS"].ToString() + " }, " + Environment.NewLine; break; default: //正常走不到这里,走到了就是数据库配置错了 break; } } rehtml = rehtml.Replace("[*[SubDialog]*]", c_str.TrimEnd(',')); } else { rehtml = "alert('获取弹窗配置失败:" + re_dsi[1].ToString() + "')"; } Response.Write(rehtml); }
protected void addbutton1_Click(object sender, EventArgs e) { BigInteger Unumber1_qx = 0; for (int i = 0; i < Unumber1.Items.Count; i++) { if (Unumber1.Items[i].Selected) { BigInteger numS = BigInteger.Parse(Unumber1.Items[i].Value); Unumber1_qx = Unumber1_qx | numS; } } BigInteger Unumber2_qx = 0; for (int i = 0; i < Unumber2.Items.Count; i++) { if (Unumber2.Items[i].Selected) { BigInteger numS = BigInteger.Parse(Unumber2.Items[i].Value); Unumber2_qx = Unumber2_qx | numS; } } BigInteger Unumber3_qx = 0; for (int i = 0; i < Unumber3.Items.Count; i++) { if (Unumber3.Items[i].Selected) { BigInteger numS = BigInteger.Parse(Unumber3.Items[i].Value); Unumber3_qx = Unumber3_qx | numS; } } BigInteger Unumber4_qx = 0; for (int i = 0; i < Unumber4.Items.Count; i++) { if (Unumber4.Items[i].Selected) { BigInteger numS = BigInteger.Parse(Unumber4.Items[i].Value); Unumber4_qx = Unumber4_qx | numS; } } BigInteger Unumber5_qx = 0; for (int i = 0; i < Unumber5.Items.Count; i++) { if (Unumber5.Items[i].Selected) { BigInteger numS = BigInteger.Parse(Unumber5.Items[i].Value); Unumber5_qx = Unumber5_qx | numS; } } string groupstr = ""; for (int i = 0; i < Uingroups.Items.Count; i++) { if (Uingroups.Items[i].Selected) { groupstr = groupstr + Uingroups.Items[i].Value + ","; } } groupstr = groupstr.TrimEnd(','); object[] re_dsiD = IPC.Call("编辑一个用户的权限", new object[] { ee_UAid.Text, Unumber1_qx.ToString(), Unumber2_qx.ToString(), Unumber3_qx.ToString(), Unumber4_qx.ToString(), Unumber5_qx.ToString(), groupstr }); //用id跳转自己 Response.Redirect("/adminht/auth_oneuser.aspx?UAid=" + ee_UAid.Text); }
protected void Page_Load(object sender, EventArgs e) { //验证权限 AuthComm.chekcAuth_fromsession("4", UserSession.最终权值_后台菜单权限, true); if (!IsPostBack) { if (Request["UAid"] == null || Request["UAid"].ToString().Trim() == "") { ; } else { string UAid = Request["UAid"].ToString().Trim(); //有UAid,开始找数据,找到了才能修改 DataSet ds = new DataSet(); object[] re_dsi = IPC.Call("获取单个用户权限", new object[] { UAid }); if (re_dsi[0].ToString() == "ok" && re_dsi[1] != null) { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 ds = (DataSet)re_dsi[1]; if (ds.Tables["返回值单条"].Rows[0]["执行结果"].ToString() == "ok") { //超管账号不允许编辑 if (ds.Tables["数据记录"].Rows[0]["SuperUser"].ToString() == "1") { addbutton1.Enabled = false; addbutton1.Text = "超管账号不能进行编辑"; } quyu_zhao.Visible = false; quyu_peizhi.Visible = true; //把可用的权限组弄上 //调用执行方法获取数据 DataTable dtdtD = new DataTable(); object[] re_dsiD = IPC.Call("获取菜单数据", new object[] { "auth_group", 0, 1 }); if (re_dsiD[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dtdtD = (DataTable)re_dsiD[1]; Uingroups.DataSource = dtdtD; Uingroups.DataTextField = "SortNameTree"; Uingroups.DataValueField = "SortID"; Uingroups.DataBind(); } else { errmsg.InnerHtml = re_dsiD[1].ToString();//向客户端输出错误字符串 } //把下拉菜单默认值弄上 ee_UAid.Text = ds.Tables["数据记录"].Rows[0]["UAid"].ToString(); ee_Uloginname.Text = ds.Tables["数据记录"].Rows[0]["Uloginname"].ToString(); UfinalUnumber.Text = ds.Tables["数据记录"].Rows[0]["UfinalUnumber1"].ToString() + "," + ds.Tables["数据记录"].Rows[0]["UfinalUnumber2"].ToString() + "," + ds.Tables["数据记录"].Rows[0]["UfinalUnumber3"].ToString() + "," + ds.Tables["数据记录"].Rows[0]["UfinalUnumber4"].ToString() + "," + ds.Tables["数据记录"].Rows[0]["UfinalUnumber5"].ToString(); //调用执行方法获取数据 DataSet dsQ = new DataSet(); object[] re_dsiQ = IPC.Call("获取所有已启用的权限枚举", new object[] { "隐藏开发专用" }); if (re_dsiQ[0].ToString() == "ok" && re_dsiQ[1] != null) { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dsQ = (DataSet)re_dsiQ[1]; Unumber1.DataSource = dsQ.Tables[0]; Unumber1.DataTextField = "ANBaseName"; Unumber1.DataValueField = "ANBaseNumber"; Unumber1.DataBind(); Unumber2.DataSource = dsQ.Tables[1]; Unumber2.DataTextField = "ANBaseName"; Unumber2.DataValueField = "ANBaseNumber"; Unumber2.DataBind(); Unumber3.DataSource = dsQ.Tables[2]; Unumber3.DataTextField = "ANBaseName"; Unumber3.DataValueField = "ANBaseNumber"; Unumber3.DataBind(); Unumber4.DataSource = dsQ.Tables[3]; Unumber4.DataTextField = "ANBaseName"; Unumber4.DataValueField = "ANBaseNumber"; Unumber4.DataBind(); Unumber5.DataSource = dsQ.Tables[4]; Unumber5.DataTextField = "ANBaseName"; Unumber5.DataValueField = "ANBaseNumber"; Unumber5.DataBind(); } else { errmsg.InnerHtml = re_dsiQ[0].ToString();//向客户端输出错误字符串 } //给对应的地方赋值 Dictionary <string, string> dic_Unumber1 = AuthComm.GetEnumFormUnumber(ds.Tables["数据记录"].Rows[0]["Unumber1"].ToString()); foreach (KeyValuePair <string, string> kv in dic_Unumber1) { ListItem lt = Unumber1.Items.FindByValue(kv.Value); if (lt != null) { lt.Selected = true; } } Dictionary <string, string> dic_Unumber2 = AuthComm.GetEnumFormUnumber(ds.Tables["数据记录"].Rows[0]["Unumber2"].ToString()); foreach (KeyValuePair <string, string> kv in dic_Unumber2) { ListItem lt = Unumber2.Items.FindByValue(kv.Value); if (lt != null) { lt.Selected = true; } } Dictionary <string, string> dic_Unumber3 = AuthComm.GetEnumFormUnumber(ds.Tables["数据记录"].Rows[0]["Unumber3"].ToString()); foreach (KeyValuePair <string, string> kv in dic_Unumber3) { ListItem lt = Unumber3.Items.FindByValue(kv.Value); if (lt != null) { lt.Selected = true; } } Dictionary <string, string> dic_Unumber4 = AuthComm.GetEnumFormUnumber(ds.Tables["数据记录"].Rows[0]["Unumber4"].ToString()); foreach (KeyValuePair <string, string> kv in dic_Unumber4) { ListItem lt = Unumber4.Items.FindByValue(kv.Value); if (lt != null) { lt.Selected = true; } } Dictionary <string, string> dic_Unumber5 = AuthComm.GetEnumFormUnumber(ds.Tables["数据记录"].Rows[0]["Unumber5"].ToString()); foreach (KeyValuePair <string, string> kv in dic_Unumber5) { ListItem lt = Unumber5.Items.FindByValue(kv.Value); if (lt != null) { lt.Selected = true; } } string[] groupstr = ds.Tables["数据记录"].Rows[0]["Uingroups"].ToString().Split(','); for (int i = 0; i < groupstr.Count(); i++) { if (groupstr[i].Trim() != "") { ListItem lt = Uingroups.Items.FindByValue(groupstr[i]); if (lt != null) { lt.Selected = true; } } } } else { errmsg.InnerHtml = ds.Tables["返回值单条"].Rows[0]["提示文本"].ToString(); } } else { errmsg.InnerHtml = re_dsi[1].ToString(); } } } }
protected void Page_Load(object sender, EventArgs e) { string rehtml = ""; object[] re_dsi = IPC.Call("获取通用数据列表配置", new object[] { Request["guid"].ToString() }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataSet ds_DD = (DataSet)(re_dsi[1]); //二次处理用户布局 try { object[] re_dsi_bj = IPC.Call("保存或者获取用户布局", new object[] { UserSession.唯一键, "onlygrid", ds_DD.Tables["报表配置主表"].Rows[0]["FSID"].ToString(), "[]", "获取" }); if (re_dsi_bj[0].ToString() == "ok") { DataSet ds_bj = (DataSet)(re_dsi_bj[1]); string jsonstr = ds_bj.Tables["自定义布局"].Rows[0]["jsonstr"].ToString(); DataTable dtbj = ToDataTable(jsonstr); for (int z = 0; z < ds_DD.Tables["字段配置子表"].Rows.Count; z++) { for (int b = 0; b < dtbj.Rows.Count; b++) { if (ds_DD.Tables["字段配置子表"].Rows[z]["DID_name"].ToString() == dtbj.Rows[b]["xmlmap"].ToString()) { ds_DD.Tables["字段配置子表"].Rows[z]["DID_width"] = dtbj.Rows[b]["width"].ToString(); ds_DD.Tables["字段配置子表"].Rows[z]["DID_hide"] = dtbj.Rows[b]["hidden"].ToString(); } } } } } catch { } string jsmod = File.ReadAllText(Server.MapPath("/pucu/jqgirdjs_for_grid_mod.txt").ToString()); //根据模板和配置数据,生成js代码 rehtml = jsmod; //复合表头 rehtml = rehtml.Replace("[*[FS_D_setGroupHeaders]*]", ds_DD.Tables["报表配置主表"].Rows[0]["FS_D_setGroupHeaders"].ToString()); //自适应宽度 if (ds_DD.Tables["报表配置主表"].Rows[0]["FS_D_shrinkToFit"].ToString() == "true") { rehtml = rehtml.Replace("[*[FS_D_shrinkToFit]*]", "true"); } else { rehtml = rehtml.Replace("[*[FS_D_shrinkToFit]*]", "false"); } //分页可选量 if (ds_DD.Tables["报表配置主表"].Rows[0]["FD_D_pagesize"].ToString().Trim() == "") { rehtml = rehtml.Replace("[*[FD_D_pagesize]*]", "25,50,100"); rehtml = rehtml.Replace("[*[Default_FD_D_pagesize]*]", "25"); } else { rehtml = rehtml.Replace("[*[FD_D_pagesize]*]", ds_DD.Tables["报表配置主表"].Rows[0]["FD_D_pagesize"].ToString()); rehtml = rehtml.Replace("[*[Default_FD_D_pagesize]*]", ds_DD.Tables["报表配置主表"].Rows[0]["FD_D_pagesize"].ToString().Split(',')[0]); } //是否显示删除按钮 rehtml = rehtml.Replace("[*[FS_del_show]*]", ds_DD.Tables["报表配置主表"].Rows[0]["FS_del_show"].ToString()); //本列表的配置主键(用于删除标记传递) rehtml = rehtml.Replace("[*[FSID]*]", ds_DD.Tables["报表配置主表"].Rows[0]["FSID"].ToString()); //是否显示导出按钮(连带打印) if (ds_DD.Tables["报表配置主表"].Rows[0]["FS_can_download"].ToString() == "1") { rehtml = rehtml.Replace("[*[FS_can_download]*]", "$('.bz-zheshidaochu').show();$('.bz-zheshidaochu').show();"); } else { rehtml = rehtml.Replace("[*[FS_can_download]*]", "$('.bz-zheshidaochu').hide();$('.bz-zheshidaochu').hide();"); } //是否显示新增按钮 rehtml = rehtml.Replace("[*[FS_add_show_link]*]", ds_DD.Tables["报表配置主表"].Rows[0]["FS_add_show_link"].ToString()); if (ds_DD.Tables["报表配置主表"].Rows[0]["FS_add_show"].ToString() == "1") { rehtml = rehtml.Replace("[*[FS_add_show]*]", "$('.bz-zheshixinzeng').show();"); } else { rehtml = rehtml.Replace("[*[FS_add_show]*]", "$('.bz-zheshixinzeng').hide();"); } //处理自定义按钮 string zdy_tihuan_str = ""; string jsmod_zdy_op = File.ReadAllText(Server.MapPath("/pucu/jqgirdjs_for_grid_mod_zdy_op.txt").ToString()); string zdy_op = ds_DD.Tables["报表配置主表"].Rows[0]["FS_zdy_op"].ToString(); string[] zdy_op_arr = zdy_op.Split(','); for (int op = 0; op < zdy_op_arr.Length; op++) { string tempanniu = zdy_op_arr[op]; if (tempanniu.Trim() != "") { string[] tp = tempanniu.Split('|'); string anniustr = jsmod_zdy_op.Replace("[*[zdyop_title]*]", tp[0]); anniustr = anniustr.Replace("[*[zdyop_buttonicon]*]", tp[1]); anniustr = anniustr.Replace("[*[zdyop_zdyname]*]", tp[2]); anniustr = anniustr.Replace("[*[FSID]*]", ds_DD.Tables["报表配置主表"].Rows[0]["FSID"].ToString()); zdy_tihuan_str = zdy_tihuan_str + anniustr; } } rehtml = rehtml.Replace("[*[FS_zxy_op_tihuan]*]", zdy_tihuan_str); //列配置 string c_str = ""; //特殊处理第一列 //因为第一列在自带查看里不显示,所以要显示编号需要额外弄一列(这一列在sql取数据时一定要有) c_str = c_str + " { name: '隐藏编号', xmlmap: 'jqgird_spid', hidden: true,frozen:false,hidedlg:true } ," + Environment.NewLine; for (int i = 0; i < ds_DD.Tables["字段配置子表"].Rows.Count; i++) { DataRow dr = ds_DD.Tables["字段配置子表"].Rows[i]; switch (dr["DID_formatter"].ToString()) { case "字符串": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " }, " + Environment.NewLine; break; case "链接": string target_str = ""; if (dr["DID_formatter_CS"].ToString().Split('|').Count() < 4) { target_str = "_top"; } else { target_str = dr["DID_formatter_CS"].ToString().Split('|')[3]; } c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'showlink', formatoptions: { baseLinkUrl: '" + dr["DID_formatter_CS"].ToString().Split('|')[0] + "', target: '" + target_str + "', showAction: '', addParam: '" + dr["DID_formatter_CS"].ToString().Split('|')[1] + "', idName: '" + dr["DID_formatter_CS"].ToString().Split('|')[2] + "' } }, " + Environment.NewLine; break; case "整数": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'integer' }, " + Environment.NewLine; break; case "小数": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'number' }, " + Environment.NewLine; break; case "日期时间": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'date', formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' } }, " + Environment.NewLine; break; case "仅日期": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'date', formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d' }, searchoptions: {dataInit:datePick } }," + Environment.NewLine; break; case "自定义": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: " + dr["DID_sortable"].ToString() + ",hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + "," + dr["DID_formatter_CS"].ToString() + " }, " + Environment.NewLine; break; default: //正常走不到这里,走到了就是数据库配置错了 break; } } rehtml = rehtml.Replace("[*[SubDialog]*]", c_str.TrimEnd(',')); } else { rehtml = "alert('获取报表配置失败:" + re_dsi[1].ToString() + "')"; } Response.Write(rehtml); }
protected void Page_Load(object sender, EventArgs e) { Response.ContentType = "text/xml"; Response.Charset = "UTF-8"; if (Request["R_PageNumber"] == null || Request["R_PageNumber"].ToString().Trim() == "") { Response.Write(geterrmod("获取数据失败!")); return; } if (Request["R_PageSize"] == null || Request["R_PageSize"].ToString().Trim() == "") { Response.Write(geterrmod("获取数据失败!")); return; } if (Request["jkname"] == null || Request["jkname"].ToString().Trim() == "") { Response.Write(geterrmod("获取数据失败!")); return; } string jkname = Request["jkname"].ToString(); jkname = HttpUtility.UrlDecode(jkname, System.Text.Encoding.UTF8); string currentpage = Request["R_PageNumber"].ToString(); string PageSize = Request["R_PageSize"].ToString(); try { DataSet dsjieguo = new DataSet(); DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); object[] re_ds = IPC.Call(jkname, new object[] { dt_request }); if (re_ds[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dsjieguo = (DataSet)re_ds[1]; } else { Response.Write(geterrmod(re_ds[1].ToString())); return; } //转换xml System.IO.StringWriter writer = new System.IO.StringWriter(); if (!dsjieguo.Tables.Contains("主要数据")) { Response.Write(geterrmod("没有主要数据!")); return; } dsjieguo.Tables["主要数据"].WriteXml(writer); //为图表增加新的解析 string fujaitubiao_str = "<chartYHB>"; if (dsjieguo.Tables.Contains("饼图数据")) { System.IO.StringWriter writer_bing = new System.IO.StringWriter(); dsjieguo.Tables["饼图数据"].WriteXml(writer_bing); fujaitubiao_str = fujaitubiao_str + writer_bing; } for (int t = 0; t < dsjieguo.Tables.Count; t++) { if (dsjieguo.Tables[t].TableName.IndexOf("曲线图数据") >= 0) { System.IO.StringWriter writer_quxian = new System.IO.StringWriter(); dsjieguo.Tables[t].WriteXml(writer_quxian); fujaitubiao_str = fujaitubiao_str + writer_quxian; } } fujaitubiao_str = fujaitubiao_str + "</chartYHB>"; string xmlstr = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + "<invoices>" + fujaitubiao_str + "<request>true</request><currentpage>" + currentpage + "</currentpage><totalpages>" + dsjieguo.Tables["附加数据"].Rows[0]["分页数"].ToString() + "</totalpages><totalrecords>" + dsjieguo.Tables["附加数据"].Rows[0]["记录数"].ToString() + "</totalrecords>" + writer.ToString() + "</invoices>"; System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(xmlstr); doc.Save(Response.OutputStream); } catch (Exception ex) { Response.Write(geterrmod("获取数据失败,执行错误!")); return; } }
protected void editjiedian_Click(object sender, EventArgs e) { errmsg.Text = ""; Button b = (Button)sender; //调用执行方法获取数据 Hashtable HTforParameter = new Hashtable(); HTforParameter["buttonid"] = b.ID; HTforParameter["dbtbname"] = dbtbname.Text; HTforParameter["SortID"] = sh_SortID.Text; HTforParameter["add_SortName"] = addnewjiedian_name.Text; HTforParameter["move_SortParentID"] = movenewsid.Text; HTforParameter["ee_SortName"] = ee_SortName.Text; BigInteger Unumber1_qx = 0; for (int i = 0; i < Unumber1.Items.Count; i++) { if (Unumber1.Items[i].Selected) { BigInteger numS = BigInteger.Parse(Unumber1.Items[i].Value); Unumber1_qx = Unumber1_qx | numS; } } HTforParameter["ee_Unumber1_qx"] = Unumber1_qx.ToString(); BigInteger Unumber2_qx = 0; for (int i = 0; i < Unumber2.Items.Count; i++) { if (Unumber2.Items[i].Selected) { BigInteger numS = BigInteger.Parse(Unumber2.Items[i].Value); Unumber2_qx = Unumber2_qx | numS; } } HTforParameter["ee_Unumber2_qx"] = Unumber2_qx.ToString(); BigInteger Unumber3_qx = 0; for (int i = 0; i < Unumber3.Items.Count; i++) { if (Unumber3.Items[i].Selected) { BigInteger numS = BigInteger.Parse(Unumber3.Items[i].Value); Unumber3_qx = Unumber3_qx | numS; } } HTforParameter["ee_Unumber3_qx"] = Unumber3_qx.ToString(); BigInteger Unumber4_qx = 0; for (int i = 0; i < Unumber4.Items.Count; i++) { if (Unumber4.Items[i].Selected) { BigInteger numS = BigInteger.Parse(Unumber4.Items[i].Value); Unumber4_qx = Unumber4_qx | numS; } } HTforParameter["ee_Unumber4_qx"] = Unumber4_qx.ToString(); BigInteger Unumber5_qx = 0; for (int i = 0; i < Unumber5.Items.Count; i++) { if (Unumber5.Items[i].Selected) { BigInteger numS = BigInteger.Parse(Unumber5.Items[i].Value); Unumber5_qx = Unumber5_qx | numS; } } HTforParameter["ee_Unumber5_qx"] = Unumber5_qx.ToString(); DataTable dt_request = StringOP.GetDataTableFormHashtable(HTforParameter); object[] re_dsi = IPC.Call("菜单维护操作", new object[] { dt_request }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 string dsreturn = re_dsi[1].ToString(); if (b.ID == "shanchu") { Response.Redirect("/adminht/auth_group_edit.aspx"); } else { Response.Redirect("/adminht/auth_group_edit.aspx?sortid=" + sh_SortID.Text); } } else { errmsg.Text = re_dsi[1].ToString();//向客户端输出错误字符串 } }
/// <summary> /// 重新加载菜单 /// </summary> private void ReLoadNode() { errmsg.Text = ""; tbshowname = "所有权限组"; dbtbname.Text = "auth_group"; if (Request["sortid"] == null || Request["sortid"].ToString().Trim() == "") { sh_SortID.Text = "0"; ee_SortID.Text = "0"; } else { sh_SortID.Text = Request["sortid"].ToString().Trim(); ee_SortID.Text = Request["sortid"].ToString().Trim(); } //加载原始数据等待修改 if (sh_SortID.Text == "0" || sh_SortID.Text == "" || dbtbname.Text == "") { } else { //调用执行方法获取数据 DataSet dsD = new DataSet(); object[] re_dsiD = IPC.Call("获取单条菜单数据", new object[] { dbtbname.Text, sh_SortID.Text }); if (re_dsiD[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dsD = (DataSet)re_dsiD[1]; try { ee_SortName.Text = dsD.Tables["数据记录"].Rows[0]["SortName"].ToString(); sh_SortName.Text = dsD.Tables["数据记录"].Rows[0]["SortName"].ToString(); //把已有的权限分解并展示 Dictionary <string, string> dic_Unumber1 = AuthComm.GetEnumFormUnumber(dsD.Tables["数据记录"].Rows[0]["Unumber1"].ToString()); foreach (KeyValuePair <string, string> kv in dic_Unumber1) { ListItem lt = Unumber1.Items.FindByValue(kv.Value); if (lt != null) { lt.Selected = true; } } Dictionary <string, string> dic_Unumber2 = AuthComm.GetEnumFormUnumber(dsD.Tables["数据记录"].Rows[0]["Unumber2"].ToString()); foreach (KeyValuePair <string, string> kv in dic_Unumber2) { ListItem lt = Unumber2.Items.FindByValue(kv.Value); if (lt != null) { lt.Selected = true; } } Dictionary <string, string> dic_Unumber3 = AuthComm.GetEnumFormUnumber(dsD.Tables["数据记录"].Rows[0]["Unumber3"].ToString()); foreach (KeyValuePair <string, string> kv in dic_Unumber3) { ListItem lt = Unumber3.Items.FindByValue(kv.Value); if (lt != null) { lt.Selected = true; } } Dictionary <string, string> dic_Unumber4 = AuthComm.GetEnumFormUnumber(dsD.Tables["数据记录"].Rows[0]["Unumber4"].ToString()); foreach (KeyValuePair <string, string> kv in dic_Unumber4) { ListItem lt = Unumber4.Items.FindByValue(kv.Value); if (lt != null) { lt.Selected = true; } } Dictionary <string, string> dic_Unumber5 = AuthComm.GetEnumFormUnumber(dsD.Tables["数据记录"].Rows[0]["Unumber5"].ToString()); foreach (KeyValuePair <string, string> kv in dic_Unumber5) { ListItem lt = Unumber5.Items.FindByValue(kv.Value); if (lt != null) { lt.Selected = true; } } } catch (Exception ex) { errmsg.Text = "获取数据出错"; } } else { errmsg.Text = re_dsiD[1].ToString();//向客户端输出错误字符串 } } TV.Nodes.Clear(); //调用执行方法获取数据 DataTable dt = new DataTable(); object[] re_dsi = IPC.Call("获取菜单数据", new object[] { dbtbname.Text, 0, 1 }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dt = (DataTable)re_dsi[1]; } else { errmsg.Text = re_dsi[1].ToString();//向客户端输出错误字符串 } this.InitNode(dt); //TV.ExpandAll(); }
protected void Page_Load(object sender, EventArgs e) { string rehtml = ""; object[] re_dsi = IPC.Call("获取弹窗中列表配置", new object[] { Request["guid"].ToString() }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataSet ds_DD = (DataSet)(re_dsi[1]); string jsmod = File.ReadAllText(Server.MapPath("/pucu/jqgirdjs_for_subtable_mod.txt").ToString()); //根据模板和配置数据,生成js代码 rehtml = jsmod; //复合表头 rehtml = rehtml.Replace("[*[FS_D_setGroupHeaders]*]", ds_DD.Tables["字段配置主表"].Rows[0]["FS_D_setGroupHeaders"].ToString()); //自适应宽度 if (ds_DD.Tables["字段配置主表"].Rows[0]["FS_D_shrinkToFit"].ToString() == "true") { rehtml = rehtml.Replace("[*[FS_D_shrinkToFit]*]", "true"); } else { rehtml = rehtml.Replace("[*[FS_D_shrinkToFit]*]", "false"); } //分页可选量 if (ds_DD.Tables["字段配置主表"].Rows[0]["FD_D_pagesize"].ToString().Trim() == "") { rehtml = rehtml.Replace("[*[FD_D_pagesize]*]", "25,50,100"); rehtml = rehtml.Replace("[*[Default_FD_D_pagesize]*]", "25"); } else { rehtml = rehtml.Replace("[*[FD_D_pagesize]*]", ds_DD.Tables["字段配置主表"].Rows[0]["FD_D_pagesize"].ToString()); rehtml = rehtml.Replace("[*[Default_FD_D_pagesize]*]", ds_DD.Tables["字段配置主表"].Rows[0]["FD_D_pagesize"].ToString().Split(',')[0]); } rehtml = rehtml.Replace("[*[FSID]*]", ds_DD.Tables["字段配置主表"].Rows[0]["FSID"].ToString()); rehtml = rehtml.Replace("[*[FS_title]*]", ds_DD.Tables["字段配置主表"].Rows[0]["FS_title"].ToString()); //列配置 string c_str = ""; //特殊处理第一列 //因为第一列在自带查看里不显示,所以要显示编号需要额外弄一列(这一列在sql取数据时一定要有) c_str = c_str + " { name: '隐藏编号', xmlmap: 'jqgird_spid', hidden: true,editable:false }, " + Environment.NewLine; // c_str = c_str + @"{ // name: 'myac',index: '', width: 80, fixed:true, sortable: false, resize: false, //formatter: 'actions', //formatoptions: // { // keys: true, // //delbutton: false,//disable delete button // delOptions: { recreateForm: true, beforeShowForm: beforeDeleteCallback}, // //editformbutton:true, editOptions:{recreateForm: true, beforeShowForm:beforeEditCallback} //} // },"; for (int i = 0; i < ds_DD.Tables["弹窗配置子表"].Rows.Count; i++) { DataRow dr = ds_DD.Tables["弹窗配置子表"].Rows[i]; string DID_edit_editable = dr["DID_edit_editable"].ToString(); string DID_edit_required = dr["DID_edit_required"].ToString(); string DID_edit_ftype = dr["DID_edit_ftype"].ToString(); string DID_edit_spset = dr["DID_edit_spset"].ToString(); string DID_name = dr["DID_name"].ToString(); string DID_showname = dr["DID_showname"].ToString(); switch (dr["DID_formatter"].ToString()) { case "字符串": if (dr["DID_name"].ToString() == ds_DD.Tables["字段配置主表"].Rows[0]["FD_D_key"].ToString()) { DID_edit_editable = "false"; } string edittype_custom = " "; if (dr["DID_edit_ftype"].ToString() == "下拉框") { string[] epzhi = DID_edit_spset.Split(','); string epzhi_str = ""; for (int p = 0; p < epzhi.Length; p++) { if (epzhi[p].IndexOf('|') >= 0) { epzhi_str = epzhi_str + epzhi[p].Split('|')[1].Trim() + ":" + epzhi[p].Split('|')[0].Trim() + ";"; } else { epzhi_str = epzhi_str + epzhi[p].Split('|')[0].Trim() + ":" + epzhi[p].Split('|')[0].Trim() + ";"; } } epzhi_str = epzhi_str.TrimEnd(';'); edittype_custom = ",edittype: 'select', editoptions: { value: '" + epzhi_str + "' }"; } if (dr["DID_edit_ftype"].ToString() == "弹窗选择") { //根据DID_edit_spset,读取隐藏的字段表数据。 object[] re_dsi_yctc = IPC.Call("获取弹窗中列表配置", new object[] { DID_edit_spset }); if (re_dsi_yctc[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataSet ds_DD_yctc = (DataSet)(re_dsi_yctc[1]); string s_FS_D_yinruzhi = ds_DD_yctc.Tables["字段配置主表"].Rows[0]["FS_D_yinruzhi"].ToString(); string FS_SPPZ_readonly = ds_DD_yctc.Tables["字段配置主表"].Rows[0]["FS_SPPZ_readonly"].ToString(); edittype_custom = ",edittype: 'custom', editoptions: { custom_element: subtab_tanchuang_elem, custom_value: subtab_tanchuang_value, DIDname:'" + DID_name + "', DIDshowname:'" + DID_showname + "',DIDeditspset:'" + DID_edit_spset + "',s_FS_D_yinruzhi:'" + s_FS_D_yinruzhi + "',FS_SPPZ_readonly:'" + FS_SPPZ_readonly + "'}"; } } c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: false,hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " ,editable:" + DID_edit_editable + " " + edittype_custom + ",editrules: {required: " + DID_edit_required + "} }, " + Environment.NewLine; break; case "链接": if (dr["DID_name"].ToString() == ds_DD.Tables["字段配置主表"].Rows[0]["FD_D_key"].ToString()) { DID_edit_editable = "false"; } c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: false,hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'showlink', formatoptions: { baseLinkUrl: '" + dr["DID_formatter_CS"].ToString().Split('|')[0] + "', target: '_blank', showAction: '', addParam: '" + dr["DID_formatter_CS"].ToString().Split('|')[1] + "', idName: '" + dr["DID_formatter_CS"].ToString().Split('|')[2] + "' } ,editable:" + DID_edit_editable + ",editrules: {required: " + DID_edit_required + "} }, " + Environment.NewLine; break; case "整数": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: false,hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'integer' ,editable:" + DID_edit_editable + ",edittype: 'custom', editoptions: { custom_element: subtab_spinner_elem, custom_value: subtab_spinner_value},editrules: {required: " + DID_edit_required + ",integer:true } }, " + Environment.NewLine; break; case "小数": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: false,hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'number' ,editable:" + DID_edit_editable + " ,editrules: {required: " + DID_edit_required + ",custom:true, custom_func:ck_erweixiaoshu } }, " + Environment.NewLine; break; case "日期时间": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: false,hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'date', formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' },editable:" + DID_edit_editable + ",editrules: {required: " + DID_edit_required + "} }, " + Environment.NewLine; break; case "仅日期": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: false,hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + " , formatter: 'date', formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' } ,editable:" + DID_edit_editable + ",edittype: 'custom', editoptions: { custom_element: subtab_datepicker_elem, custom_value: subtab_datepicker_value},editrules: {required: " + DID_edit_required + "} }, " + Environment.NewLine; break; case "图片": break; case "自定义": c_str = c_str + " { name: '" + dr["DID_showname"].ToString() + "', xmlmap: '" + dr["DID_name"].ToString() + "', index: '" + dr["DID_name"].ToString() + "', width: " + dr["DID_width"].ToString() + ", fixed: " + dr["DID_fixed"].ToString() + ", sortable: false,hidden: " + dr["DID_hide"].ToString() + ",frozen:" + dr["DID_frozen"].ToString() + "," + dr["DID_formatter_CS"].ToString() + " ,editable:" + DID_edit_editable + " }, " + Environment.NewLine; break; default: //正常走不到这里,走到了就是数据库配置错了 break; } } rehtml = rehtml.Replace("[*[SubDialog]*]", c_str.TrimEnd(',')); //替换表格id rehtml = rehtml.Replace("[*[grid_selector_ID]*]", "#" + Request["grid_selector_ID"].ToString()); rehtml = rehtml.Replace("[*[pager_selector_ID]*]", "#" + Request["pager_selector_ID"].ToString()); } else { rehtml = "alert('获取弹窗配置失败:" + re_dsi[1].ToString() + "')"; } Response.Write(rehtml); }
protected void Page_Load(object sender, EventArgs e) { //处理ajax请求 string ajaxrun = ""; if (Request["ajaxrun"] == null || Request["ajaxrun"].ToString().Trim() == "") { return; } if (Request["jkname"] == null || Request["jkname"].ToString().Trim() == "") { return; } string jkname = Request["jkname"].ToString(); ajaxrun = Request["ajaxrun"].ToString(); if (ajaxrun == "save") {/* * string show = "<br>Form:<br>"; * for (int i = 0; i < Request.Form.Count; i++) * { * * show = show + Request.Form.Keys[i].ToString() + " = " + Request.Form[i].ToString() + "<br>"; * } * show = show + "<br>QueryString:<br>"; * for (int i = 0; i < Request.QueryString.Count; i++) * { * * show = show + Request.QueryString.Keys[i].ToString() + " = " + Request.QueryString[i].ToString() + "<br>"; * } * * Response.Write(show);//向客户端输出字符串 */ //调用执行方法获取数据 DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); object[] re_dsi = IPC.Call(jkname, new object[] { dt_request }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataSet dsreturn = (DataSet)re_dsi[1]; Response.Write(dsreturn.Tables["返回值单条"].Rows[0]["提示文本"].ToString()); } else { Response.Write(re_dsi[1].ToString());//向客户端输出错误字符串 } } if (ajaxrun == "del") { //调用执行方法获取数据 DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); object[] re_dsi = IPC.Call(jkname, new object[] { dt_request }); if (re_dsi[0].ToString() == "ok") { ; } else { Response.Write(re_dsi[1].ToString());//向客户端输出错误字符串 } } if (ajaxrun == "info") { string idforedit = ""; if (Request["idforedit"] != null && Request["idforedit"].ToString().Trim() != "") { idforedit = Request["idforedit"].ToString(); } else { //没有id传进来返回空内容 Response.Write(""); return; } //调用执行方法获取数据 DataTable dt_request = RequestForUI.Get_parameter_forUI(Request); object[] re_dsi = IPC.Call(jkname, new object[] { dt_request }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 DataSet dsreturn = (DataSet)re_dsi[1]; //转换xml TextWriter tw = new StringWriter(); dsreturn.WriteXml(tw); string twstr = tw.ToString(); StringWriter writer = new StringWriter(); string xmlstr = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + twstr; Response.ContentType = "text/xml"; Response.Charset = "UTF-8"; System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(xmlstr); doc.Save(Response.OutputStream); Response.End(); } else { Response.Write(""); return; } } }
protected void editjiedian_Click(object sender, EventArgs e) { errmsg.Text = ""; Button b = (Button)sender; //如果是生成xml,不调用操作接口,直接调用接口获取数据并本地生成 if (b.ID == "shengchengxml") { //生成选定的菜单数据 DataTable dtT = new DataTable(); object[] re_dsiT = IPC.Call("获取菜单数据", new object[] { dbtbname.Text, 0, 1 }); if (re_dsiT[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 dtT = (DataTable)re_dsiT[1]; //dtT.WriteXml(Server.MapPath("/xml/" + dbtbname.Text + ".xml"), XmlWriteMode.WriteSchema); } else { errmsg.Text = re_dsiT[1].ToString();//向客户端输出错误字符串 } //不管选定的哪个菜单,都把权限枚举表里的有效数据也生成到本地,用于菜单权限判定。 DataSet ds_mj = new DataSet(); object[] re_dsi_mj = IPC.Call("获取所有已启用的权限枚举", new object[] { "" }); if (re_dsi_mj[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 ds_mj = (DataSet)re_dsi_mj[1]; //ds_mj.WriteXml(Server.MapPath("/xml/auth_enum_number_ANused.xml"), XmlWriteMode.WriteSchema); } else { errmsg.Text = re_dsi_mj[1].ToString();//向客户端输出错误字符串 } } //调用执行方法获取数据 Hashtable HTforParameter = new Hashtable(); HTforParameter["buttonid"] = b.ID; HTforParameter["dbtbname"] = dbtbname.Text; HTforParameter["SortID"] = sh_SortID.Text; HTforParameter["add_SortName"] = addnewjiedian_name.Text; HTforParameter["move_SortParentID"] = movenewsid.Text; HTforParameter["ee_SortName"] = ee_SortName.Text; HTforParameter["ee_m_url"] = ee_m_url.Text; HTforParameter["ee_m_tip"] = ee_m_tip.Text; HTforParameter["ee_m_tag"] = ee_m_tag.Text; HTforParameter["ee_m_ico"] = ee_m_ico.Text; HTforParameter["ee_m_show1"] = ee_m_show1.Checked.ToString(); HTforParameter["ee_m_show0"] = ee_m_show0.Checked.ToString(); DataTable dt_request = StringOP.GetDataTableFormHashtable(HTforParameter); object[] re_dsi = IPC.Call("菜单维护操作", new object[] { dt_request }); if (re_dsi[0].ToString() == "ok") { //这个就是得到远程方法真正的返回值,不同类型的,自行进行强制转换即可。 string dsreturn = re_dsi[1].ToString(); if (b.ID == "shanchu") { Response.Redirect("/adminht/menu_pub_edit.aspx?tb=" + dbtbname.Text); } else { Response.Redirect("/adminht/menu_pub_edit.aspx?sortid=" + sh_SortID.Text + "&tb=" + dbtbname.Text); } } else { errmsg.Text = re_dsi[1].ToString();//向客户端输出错误字符串 } }