<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="department_config.aspx.vb" Inherits="gogo_mechanism.department_config" %>
<%@ Import namespace="gogo_mechanism"%>
<html>
	<head id="head1"  runat="server">
    <title><%=pagename %></title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" type="text/css" href="lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="stylesheets/theme.css">
    <link rel="stylesheet" href="lib/font-awesome/css/font-awesome.css">
    <link href="site_css2.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="js/DatePicker/WdatePicker.js" language="javascript"></script>
    <script type="text/javascript" src="js/myjs.js" language="javascript"></script>
    <script src="lib/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="lib/bootstrap/js/bootstrap.js" type="text/javascript"></script>
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <!-- Le fav and touch icons -->
</head>
  <body class=""> 
     <!--<![endif]-->
    <form id="Form1" runat="server">
    <div class="content">
        
        <div class="header">
<div class="stats">
    <p class="stat">数量 <span class="number"><asp:label id="Label1" runat="server"></asp:label></span></p>
</div>
            <h1 class="page-title"><%=pagename %></h1>
        </div>
        
                <ul class="breadcrumb">
            <li><a href="info.aspx">系统首页</a> <span class="divider">/</span></li>
            <li class="active"><%=pagename %></li>
        </ul>

        <div class="container-fluid">
            <div class="row-fluid">
               <div class="search-toolbar"><i class="icon-search"></i> 筛选<asp:TextBox ID="fids" runat="server" onclick="showDIV(this,dwtrees);" ReadOnly="True" Width="150px">所有级别|000000000</asp:TextBox> <i class="icon-plus"></i>新增：隶属<asp:TextBox ID="fid" runat="server" onclick="showDIV(this,dwtree);" ReadOnly="True" Width="150px">无|000000000</asp:TextBox>
                   编号<asp:TextBox ID="did" runat="server" MaxLength="9" Width="100px"></asp:TextBox>
                   名称<asp:TextBox ID="mc" runat="server" Width="100px"></asp:TextBox>
                   最大任务数<asp:TextBox ID="tasknum" runat="server" MaxLength="9" Width="36px">100</asp:TextBox>

                   有效期<asp:TextBox ID="yxq" runat="server" onfocus="WdatePicker();"  Width="100px"></asp:TextBox>
                   短信预警<asp:CheckBox ID="sms" runat="server" />
                   邮件预警<asp:CheckBox ID="mail" runat="server" />
                   扫描最大深度<asp:TextBox ID="depth" runat="server" Width="40px">5</asp:TextBox>
                   允许选择记录模式<asp:CheckBox ID="recordmode" runat="server" />
                   排序权重<asp:TextBox ID="qz" runat="server" style="width:29px;" Width="29px">20</asp:TextBox>
                   <br />
                   <asp:RegularExpressionValidator ID="RegularExpressionValidator11" 
                       runat="server" ControlToValidate="did" ErrorMessage="编号格式不对" 
                       ValidationExpression="[1-9]\d{8}"></asp:RegularExpressionValidator>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                       ControlToValidate="did" ErrorMessage="编号不能为空"></asp:RequiredFieldValidator>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                       ControlToValidate="mc" ErrorMessage="名称不能为空"></asp:RequiredFieldValidator>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                       ControlToValidate="qz" ErrorMessage="权重不能为空"></asp:RequiredFieldValidator>
                   <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                       ControlToValidate="qz" ErrorMessage="权重须为整数" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                       ControlToValidate="tasknum" ErrorMessage="最大任务数不能为空"></asp:RequiredFieldValidator>
                   <asp:RegularExpressionValidator ID="RegularExpressionValidator12" 
                       runat="server" ControlToValidate="tasknum" ErrorMessage="最大任务数须为整数" 
                       ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                       ControlToValidate="yxq" ErrorMessage="有效期不能为空"></asp:RequiredFieldValidator>
                   <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" 
                       ControlToValidate="yxq" ErrorMessage="日期格式错误" 
                       
                       ValidationExpression="(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)"></asp:RegularExpressionValidator>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                       ControlToValidate="depth" ErrorMessage="扫描深度不能为空"></asp:RequiredFieldValidator>
                   <asp:RegularExpressionValidator ID="RegularExpressionValidator13" 
                       runat="server" ControlToValidate="depth" ErrorMessage="扫描深度须为整数" 
                       ValidationExpression="^\d+$"></asp:RegularExpressionValidator>

               </div>         
<div class="btn-toolbar">
    <asp:Button ID="Button4" runat="server" Text="添加部门" class="btn btn-primary"/>
    <asp:Button ID="Button1" runat="server" CausesValidation="False" Text="当页全选" class="btn"/>
    <asp:Button ID="Button2" runat="server" CausesValidation="False" Text="取消选择" class="btn"/>
    <asp:Button ID="Button3" runat="server" CausesValidation="False" Text="删除选中"  class="btn btn-danger"/>
</div>
<div class="btn-group"></div>
<div class="well">
<asp:GridView ID="GridView1" runat="server"  AutoGenerateColumns="False" 
        GridLines="None" PageSize="15" Width="100%" CssClass="table">
<Columns>
                                        <asp:TemplateField HeaderText="选择">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="id" HeaderText="单位部门编号" ReadOnly="True" />
                                        <asp:TemplateField HeaderText="单位部门名称">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="mc2" runat="server" 
                                                    Text='<%# DataBinder.Eval(Container, "DataItem.mc") %>'></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="mc1" runat="server" 
                                                    Text='<%# DataBinder.Eval(Container, "DataItem.mc") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="上级单位部门名称">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="fid2" runat="server" onclick="showDIV(this,dwtree2);" Text='<%# getdepartmentname2(DataBinder.Eval(Container, "DataItem.fid")) %>'  ReadOnly="True" Width="150px"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="fid1" runat="server" Text='<%# getdepartmentname(DataBinder.Eval(Container, "DataItem.fid")) %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="最大任务数">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="tasknum2" runat="server" 
                                                    Text='<%# DataBinder.Eval(Container, "DataItem.tasknum") %>' Width="40px" style="width:40px;"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                              <%# DataBinder.Eval(Container, "DataItem.tasknum") %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                            <asp:TemplateField HeaderText="有效期">
                                            <ItemTemplate>
                                               <%# lt(DataBinder.Eval(Container, "DataItem.yxq"))%>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:TextBox ID="yxq2" runat="server" Text='<%# c_date(DataBinder.Eval(Container, "DataItem.yxq"))%>' Width="100px" onfocus="WdatePicker();"></asp:TextBox>
                                                <br />
                                         </EditItemTemplate>
                                        </asp:TemplateField>

                                         <asp:TemplateField HeaderText="短信预警">
                                            <EditItemTemplate>
                                            <asp:CheckBox ID="sms2" runat="server" Checked='<%# DataBinder.Eval(Container, "DataItem.sms") %>' />                                              
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                            <%# DataBinder.Eval(Container, "DataItem.sms") %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                             <asp:TemplateField HeaderText="邮件预警">
                                            <EditItemTemplate>
                                             <asp:CheckBox ID="mail2" runat="server" Checked='<%# DataBinder.Eval(Container, "DataItem.mail") %>' />
                                                                                           </EditItemTemplate>
                                            <ItemTemplate>
                                               <%# DataBinder.Eval(Container, "DataItem.mail") %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                         <asp:TemplateField HeaderText="扫描深度">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="depth2" runat="server" 
                                                    Text='<%# DataBinder.Eval(Container, "DataItem.depth") %>' Width="40px" style="width:40px;"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                               <%# DataBinder.Eval(Container, "DataItem.depth") %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                         <asp:TemplateField HeaderText="允许选择记录模式">
                                            <EditItemTemplate>
                                             <asp:CheckBox ID="recordmode2" runat="server" Checked='<%# DataBinder.Eval(Container, "DataItem.recordmode") %>' />
                                                                                           </EditItemTemplate>
                                            <ItemTemplate>
                                               <%# DataBinder.Eval(Container, "DataItem.recordmode")%>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                          <asp:TemplateField HeaderText="权重">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="qz2" runat="server" 
                                                    Text='<%# DataBinder.Eval(Container, "DataItem.qz") %>' Width="40px" style="width:40px;"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="qz1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.qz") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                         <asp:TemplateField HeaderText="编辑" ShowHeader="False">
                                            <EditItemTemplate>
                                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                                    CommandName="Update" Text="更新"></asp:LinkButton>
                                                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                                    CommandName="Cancel" Text="取消"></asp:LinkButton>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                                    CommandName="Edit" Text="编辑"></asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
        <PagerStyle CssClass="pagerclass" />
        <EmptyDataTemplate>
            暂无单位部门信息！
        </EmptyDataTemplate>
        </asp:GridView>
</div>
                  
            </div>
        </div>
    </div>
<!--隐藏开始-->
			<div class="menudiv" id="dwtree">
            <asp:TreeView ID="fidTreeView" runat="server" ImageSet="XPFileExplorer" 
        NodeIndent="15" ShowLines="True">
            <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
            <NodeStyle Font-Names="Tahoma" ForeColor="Black" 
                HorizontalPadding="2px" NodeSpacing="0px" VerticalPadding="2px" />
            <ParentNodeStyle Font-Bold="False" />
            <SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" 
                HorizontalPadding="0px" VerticalPadding="0px" />
        </asp:TreeView>
            </div>
			<!--隐藏结束-->
            <!--隐藏开始-->
			<div class="menudiv" id="dwtrees">
            <asp:TreeView ID="fidTreeViews" runat="server" ImageSet="XPFileExplorer" 
        NodeIndent="15" ShowLines="True">
            <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
            <NodeStyle Font-Names="Tahoma" ForeColor="Black" 
                HorizontalPadding="2px" NodeSpacing="0px" VerticalPadding="2px" />
            <ParentNodeStyle Font-Bold="False" />
            <SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" 
                HorizontalPadding="0px" VerticalPadding="0px" />
        </asp:TreeView>
            </div>
			<!--隐藏结束-->
            <div class="menudiv" id="dwtree2">
            <asp:TreeView ID="fidTreeView2" runat="server" ImageSet="XPFileExplorer" 
        NodeIndent="15" ShowLines="True">
            <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
            <NodeStyle Font-Names="Tahoma" ForeColor="Black" 
                HorizontalPadding="2px" NodeSpacing="0px" VerticalPadding="2px" />
            <ParentNodeStyle Font-Bold="False" />
            <SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" 
                HorizontalPadding="0px" VerticalPadding="0px" />
        </asp:TreeView>
            </div>
			<!--隐藏结束-->			
    </form>
</body>
</html>