<%@ Page ValidateRequest ="false" Language="C#" Theme ="SkinFile" MasterPageFile="~/All.master" AutoEventWireup="true" CodeFile="JSGL.aspx.cs" Inherits="QXGL_JSGL" %>
<%@ Register src="../UserControl/OperatePage.ascx" tagname="OperatePage" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link href="../CSS_1/StyleSheet.css" type="text/css" rel="stylesheet" />
<script language ="javascript" type ="text/javascript" >
var xmlDom = new ActiveXObject("Msxml2.DOMDocument.3.0");
xmlDom.async = false;
xmlDom.loadXML("<root></root>");
function ckSfkd(sender) {
var str_mk_id = sender.id.substring(7);
if (sender.checked) {
var mk = xmlDom.createNode(1, "mk", "");
var mk_id = xmlDom.createAttribute("id");
mk_id.value = str_mk_id;
mk.setAttributeNode(mk_id);
var sfkx = xmlDom.createAttribute("sfkx");
sfkx.value = "0";
mk.setAttributeNode(sfkx);
xmlDom.documentElement.appendChild(mk);
}
else {
var node = xmlDom.selectSingleNode('//mk[@id="' + str_mk_id + '"]');
node.parentNode.removeChild(node);
document.getElementById("ckSfkx_" + str_mk_id).checked = false;
}
document.getElementById("<%=hiddenMK_IDs.ClientID%>").value = xmlDom.xml;
//alert(xmlDom .xml);
}
function ckSfkx(sender) {
var str_mk_id = sender.id.substring(7);
if (sender.checked) {
var mk_node = xmlDom.selectSingleNode('//mk[@id="' + str_mk_id + '"]');
if (mk_node == null) {
var mk = xmlDom.createNode(1, "mk", "");
var mk_id = xmlDom.createAttribute("id");
mk_id.value = str_mk_id;
mk.setAttributeNode(mk_id);
var sfkx = xmlDom.createAttribute("sfkx");
sfkx.value = "1";
mk.setAttributeNode(sfkx);
xmlDom.documentElement.appendChild(mk);
}
else {
var node = xmlDom.selectSingleNode('//mk[@id="' + str_mk_id + '"]');
node.attributes[1].value = "1";
}
document.getElementById("ckSfkd_" + str_mk_id).checked = true;
}
else {
var node = xmlDom.selectSingleNode('//mk[@id="' + str_mk_id + '"]');
node.attributes[1].value = "0";
}
document.getElementById("<%=hiddenMK_IDs.ClientID%>").value = xmlDom.xml;
//alert(xmlDom .xml);
}
function showdiv() {
document.getElementById("divQuery").style.display = "block";
}
function Surediv() {
document.getElementById("divQuery").style.display = "none";
}
function canclediv() {
xmlDom.loadXML("<root></root>");
document.getElementById("<%=hiddenMK_IDs.ClientID%>").value = xmlDom.xml;
var all = document.getElementById("divQuery");
var checks = all.getElementsByTagName("input");
for (var i = 0; i < checks.length; i++) {
if (checks[i].type == "checkbox")
checks[i].checked = false;
}
document.getElementById("divQuery").style.display = "none";
}
// function xml_xs() {
// xmlDom.loadXML(document.getElementById("ContentPlaceHolder1_hiddenMK_IDs").value);
// var mk_ids_array = xmlDom.selectNodes("//mk");
// for (var i = 0; i < mk_ids_array.length; i++) {
// if (mk_ids_array[i].getAttribute("sfkx") == "1") {
// document.getElementById("ckSfkx_" + mk_ids_array[i].getAttribute("id")).checked = true; //注意这一句话的写法
// }
// document.getElementById("ckSfkd_" + mk_ids_array[i].getAttribute("id")).checked = true;
// }
// }
</script>
<style type="text/css">
.style1
{
width: 38px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<%--<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate >--%>
<div style="font-size:small">
<div style=" background-color :#7bbfea; font-size :small ;">
<table cellspacing="1" cellpadding="3" border="0" width ="100%">
<tr>
<th colspan ="4" style ="FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: white; HEIGHT: 25px; background-image:url(../images/win_top.png); background-repeat :repeat-x ;">
角色管理</th>
</tr>
<tr>
<td class="style1">名称 </td>
<td style =" width :55%"><asp:TextBox runat ="server" ID="txtJS_XM"></asp:TextBox></td>
<td colspan ="2">
模块 <input type ="button" value ="点击进行模块编辑" onclick ="showdiv()"/>
</td>
</tr>
<tr>
<td class="style1">备注</td>
<td colspan ="3"><asp:TextBox ID="txtJS_BZ" runat="server" TextMode ="MultiLine"
Height="50px" Width="98%"></asp:TextBox>
</td>
</tr>
<tr>
<td align ="right" colspan ="2">
<asp:Label runat ="server" ID="lblMessage" ForeColor ="Red" ></asp:Label>
</td>
<td align ="right" colspan ="2">
<div runat ="server" id="divContent">
<asp:Button runat ="server" ID="btnAdd" Text ="增加" onclick="btnAdd_Click" CommandName ="write"
Width="69px" />
<asp:Button runat ="server" ID="btnEmptyAdd" Text ="修改保存" CommandName ="write" onclick="btnEmptyAdd_Click" />
</div>
</td>
</tr>
</table>
</div>
<%--<input type ="hidden" id ="hiddenMK_IDs" runat ="server" value ="<root></root>" />--%>
<asp:GridView DataKeyNames ="JS_ID" AutoGenerateColumns ="false" runat="server" Width =100%
ID="gvShow" onrowdatabound="gvShow_RowDataBound">
<Columns >
<asp:TemplateField >
<HeaderTemplate >行号</HeaderTemplate>
<ItemTemplate >
<asp:LinkButton runat ="server" ID="lnbtnRowNum" Text ="<%#_RowCount++%>"
onclick="lnbtnRowNum_Click"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<HeaderTemplate >删除</HeaderTemplate>
<ItemTemplate >
<asp:Button runat ="server" CommandName="write" ID="btnDel" Text ="删除" onclick="btnDel_Click" OnClientClick ="return confirm('确定要删除吗?')" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText ="名称" DataField ="JS_XM" />
<asp:BoundField HeaderText ="备注" DataField ="JS_BZ" />
</Columns>
</asp:GridView>
<uc1:OperatePage ID="OperatePage1" runat="server" />
<div id="divQuery" style=" width:500px; background-color :White; position :absolute;left:500px;top:150px;border-style:solid;border-width:thin; display :none; height :350px; overflow :auto ; ">
<table cellspacing="1" cellpadding="3" border="0">
<tr>
<td >
</td>
<td align ="right" >
<input type ="button" id ="btnClientCancle" value ="取消" onclick ="canclediv()" />
<input type ="button" id ="butpass" value ="确定" onclick ="Surediv()" />
</td>
</tr>
<tr>
<td style = " width :50px; vertical-align :text-top ">模块:</td>
<td>
<asp:TreeView ID="tree" runat="server">
</asp:TreeView>
</td>
</tr>
</table >
<input type =hidden id ="hiddenMK_IDs" runat ="server" value ="<root></root>" />
</div>
<script language ="javascript" type ="text/javascript" >
// function xml_xs() {
xmlDom.loadXML(document.getElementById("<%=hiddenMK_IDs.ClientID%>").value);
var mk_ids_array = xmlDom.selectNodes("//mk");
for (var i = 0; i < mk_ids_array.length; i++) {
if (mk_ids_array[i].getAttribute("sfkx") == "1") {
document.getElementById("ckSfkx_" + mk_ids_array[i].getAttribute("id")).checked = true; //注意这一句话的写法
}
document.getElementById("ckSfkd_" + mk_ids_array[i].getAttribute("id")).checked = true;
}
// }
</script>
</div>
<%--</ContentTemplate></asp:UpdatePanel>--%>
</asp:Content>