<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Page_Mechanism_List.aspx.cs" Inherits="BDLSerSystem.SystemSet.Page_Mechanism_List" %>
<%@ Register TagPrefix="componentart" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<HTML>
	<HEAD>
		<title>User_Reg</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<LINK href="../css/css.css" type="text/css" rel="stylesheet">	
		<script src="../JS/Site.js"></script>
<script language="JavaScript">
function winconfirm(){
    question = confirm("您确实要删除所选项目吗?")     
if(!question){   
          event.returnValue=false;   
      }   
}
</script>
<script type="text/javascript">
    function SetTextBox(id, s) {
        document.getElementById(id).value = s;
        HideTreeView();
    }
    function ToggleTreeView() {
        if (document.getElementById("treeDiv").style.visibility == "visible")
            HideTreeView();
        else
            ShowTreeView();
    }
    function ShowTreeView() {
        document.getElementById("treeDiv").style.visibility = "visible";
    }
    function HideTreeView() {
        document.getElementById("treeDiv").style.visibility = "hidden";
    }
    function document.onclick() //任意点击时关闭该控件	//ie6的情况可以由下面的切换焦点处理代替
    {
        with (window.event) {
            //判断是不是机构输入框获得焦点
            if (window.event.srcElement.name == "SMech_FathName") {
                ShowTreeView();
            }
            else {
                HideTreeView();
            }
        }
    }
    function checkOne(box_no) {
        var frm = document.Form1;
        if (box_no.checked == true) {
            frm.Del_IDList.value = frm.Del_IDList.value + "," + box_no.value + ",";
        }
        else {
            frm.Del_IDList.value = frm.Del_IDList.value.replace("," + box_no.value + ",", "");
        }
        if (frm.Del_IDList.value == "") {
            //修改，删除不可用
            document.getElementById("Btn_Edit").className = "Btn_Zu_MidNo";
            document.getElementById("Btn_Del").className = "Btn_Zu_RightNo";
            document.getElementById("Div_Edit").style.display = "";
            document.getElementById("Div_Del").style.display = "";
        }
        else {
            document.getElementById("Btn_Edit").className = "Btn_Zu_Mid";
            document.getElementById("Btn_Del").className = "Btn_Zu_Right";
            document.getElementById("Div_Edit").style.display = "none";
            document.getElementById("Div_Del").style.display = "none";
        }
    }
    function pickrow(row) {
        if (event.srcElement.type == "checkbox") return;
        var x = row.getElementsByTagName("input");
        for (var j = 0; j < x.length; j++) {
            if (x[j].type = "checkbox") {
                x[j].checked = !x[j].checked;
                checkOne(x[j]);
            }
        }
    }
    function checkEdit(sDel_IDList) {
        var r, re;
        var strlength = sDel_IDList.length;
        re = /\,/; // 创建正则表达式模式。
        while (re.test(sDel_IDList)) {
            sDel_IDList = sDel_IDList.replace(re, "");
        }
        //alert("字符串中还有" + (strlength - sDel_IDList.length) + "点");
        var Tag_Counts = strlength - sDel_IDList.length;
        if (Tag_Counts == 2) {
            //可以修改
            openWithIframe('机构组织结构设置', 'Page_Mechanism_Add.aspx?Mech_ID=' + sDel_IDList, 700, 350, 0, 'Page_Mechanism_List.aspx');
        }
        else {
            alert('一次只能修改一个选定项目!');
            return false;
        }
    }
</script>
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<div align="center">
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="43" background="../Images/Menu_Bg.png" class="tbl_1line_b"><div align="right">
    <table width="98%" height="30"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="55px"><div align="center"><input type="button" class="Btn_Zu_Left" value="新增"  onClick="openWithIframe('机构组织结构设置','Page_Mechanism_Add.aspx',700,350,0,'Page_Mechanism_List.aspx');this.blur();"></div></td>
              <td width="55px"><div align="center"><input type="button" name="Btn_Edit" id="Btn_Edit" class="Btn_Zu_MidNo" value="修改" onClick="checkEdit(Del_IDList.value);"></div></td>
              <td width="54px"><div align="center"><asp:Button ID="Btn_Del" runat="server" 
                      CssClass="Btn_Zu_RightNo" Text="删除" onclick="Btn_Del_Click" /></div></td>
              <td width="20px">&nbsp;</td>              
              <td width="54px"><div align="center"><asp:Button ID="Btn_Back" runat="server" CssClass="Btn_Quan_Small" Text="返回" /></div></td>
              <td width="55px"><div id="Div_Edit" style="position: relative; top: 0px; filter: alpha(opacity=0); background-color: #777;z-index: 2; left: -183px;  width:55px;height:30px;"></div></td>
              <td width="55px"><div id="Div_Del" style="position: relative; top: 0px; filter: alpha(opacity=0); background-color: #777;z-index: 2; left: -183px;  width:54px;height:30px;"></div></td>
              <td>&nbsp;</td>
            </tr>
          </table>
    </div></td>
  </tr>
  <tr>
    <td valign="top"><div align="right">
                     <table width="98%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td height="35" colspan="3" background="../images/Page_Title.png" class="tbl_3line_rtl">
										        <table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td><div align="left" class="font_style_2a5b8c">&nbsp;&nbsp;&nbsp;&nbsp;机构组织架构管理<asp:TextBox ID="Del_IDList" runat="server" style="DISPLAY: none"></asp:TextBox><asp:TextBox ID="SMechFathIDBack" runat="server" Visible="false"></asp:TextBox></div>
														</td>
														<td width="50">&nbsp;</div>
														</td>
													</tr>
												</table></td>
									</tr>
									<tr>
										<td background="../images/tbl_rl.png" width="6px"></td>
										<td class="tbl_4line_rblt" valign="top"><div align="center">
												<table width="100%" border="0" cellspacing="0" cellpadding="0">
												    <tr><td height="40" class="tbl_1line_b"><div align="left">					    
												        <table width="100%"  border="0" cellpadding="0" cellspacing="0">
                                                            <tr>
                                                              <td width="80" height="40"><div align="right">机构编码：</div></td>
                                                              <td width="80"><div align="left"><asp:TextBox ID="SMech_Code" runat="server" CssClass="TextBox3" Width="80px"></asp:TextBox></div></td>
                                                              <td width="80"><div align="right">机构名称：</div></td>
                                                              <td width="100"><div align="left"><asp:TextBox ID="SMech_Name" runat="server" CssClass="TextBox3" Width="100px"></asp:TextBox></div></td>
                                                              <td width="80"><div align="right">所属机构：</div></td>
                                                              <td width="200"><div align="left"><asp:TextBox ID="SMech_FathName" runat="server" CssClass="TextBox3" Width="200px"></asp:TextBox></div>
                                                              <div id="treeDiv" style="CLEAR:both; BORDER-RIGHT:1px solid #b2b2b2; BORDER-TOP:1px solid #b2b2b2;BORDER-LEFT:1px solid #b2b2b2; BORDER-BOTTOM:1px solid  #b2b2b2;MARGIN-TOP:1px; BACKGROUND:white;VISIBILITY:hidden; WIDTH:200px; POSITION:absolute;">
																			<ComponentArt:TreeView id="TreeView1" runat="server" Width="200px" 
                                                                                CssClass="TreeView" NodeCssClass="22"
																				SelectedNodeCssClass="TreeViewcss" HoverNodeCssClass="TreeViewMouseOn" NodeEditCssClass="NodeEdit"
																				LineImageWidth="19" LineImageHeight="20" DefaultImageWidth="16" DefaultImageHeight="16" ItemSpacing="0"
																				NodeLabelPadding="3" ShowLines="true" LineImagesFolderUrl="../images/lines/" EnableViewState="true" AutoPostBackOnSelect="True" 
                                                                                onnodeselected="TreeView1_NodeSelected"></ComponentArt:TreeView>
																		</div>
                                                              </td>
                                                              <td width="100"><div align="center"><asp:Button ID="Btn_Search" runat="server" CssClass="BtnStyle" Text="查  询" onclick="Btn_Search_Click" /></div></td>
                                                              <td>&nbsp;</td>
                                                            </tr>
                                                          </table>
												    </div></td></tr>
													<tr>
														<td height="35"><div align="center"><asp:Label ID="ShowInfo" Runat="server"></asp:Label></td>
													</tr>
													<tr>
														<td>&nbsp;</td>
													</tr>
												</table>
											</div>
										</td>
										<td background="../images/tbl_rl2.png" width="6px"></td>
									</tr>
									<tr>
										<td height="6"><div align="center"><img src="../images/tbl_bl.png" width="6" height="6"></div>
										</td>
										<td height="6" background="../images/tbl_bt.png"></td>
										<td height="6"><div align="center"><img src="../images/tbl_br.png" width="6" height="6"></div>
										</td>
									</tr>
								</table>
    </div></td>
  </tr>
</table>
			</div>
		</form>
	</body>
</HTML>
