<%@ Page Title="" Language="C#" MasterPageFile="~/BackStage/HelperMaster.Master" AutoEventWireup="true" CodeBehind="Frm_SetLimit.aspx.cs" Inherits="AndroidSevice.Web.WLTGL.Frm_SetLimit" %>
<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function sAlert(info) {
            var message = info;
            layer.alert(message, 8); //风格一，layer弹出层特效
        }
        function sAlerts(info, reltype) {
            var message = info;
            var realtype = reltype
            layer.alert(message, 8); //风格一，layer弹出层特效
            if (realtype == 'true') {
                parent.location.reload(); //刷新父页面
            }
        }
        function sAlertok(info) {
            layer.alert(info, { closeBtn: 0
            }, function () {
                parent.location.reload(); //刷新父页面
            });
        }

        function SelectAll() {
            var checkboxs = document.getElementsByName("limitcheck");
            for (var i = 0; i < checkboxs.length; i++) {
                var e = checkboxs[i];
                e.checked = !e.checked;
            }
        }
        function sAlertOut(info) {
            layer.alert(info, { closeBtn: 0
            }, function () {
                window.location.href = '../../default.aspx'; //刷新父页面
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="container-fluid">
				<div class="row-fluid">
					<div class="span13">
						<div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="icon-th-list"></i>
								</span>
								<h5>权限设置</h5>
                                <asp:HiddenField ID="HiddenField1" runat="server" />
							</div>  
                          <div class="widget-content">
                                    快速选择权限组：
                                    <table id="wew" class="table table-bordered table-striped table-hover">
                                           
                                            <%
                                                if (dtLimitGroup != null && dtLimitGroup.Rows.Count != 0)
                                                {
                                                    for (int i = 0; i < rowCount; i++)
                                                    {%>
                                                        <tr style="border-width:0px">
                                                        <% for (int j = 0 +8*i; j < 8 * (i + 1); j++)
                                                        {
                                                            if (j < dtLimitGroup.Rows.Count)
                                                            {
                                                    %>
											            <td style="border-width:0px" > <button type="button"  onclick="window.location.href='Frm_SetLimit.aspx?Id=<%=dtLimitGroup.Rows[j]["Id"].ToString() %>'"  class="btn" ><%=dtLimitGroup.Rows[j]["LimitName"].ToString()%></button></td>
                                                    <%
}
                                                            else
                                                            {%>
                                                            
                                                           <% }
                                                        } %>
                                                        </tr>
                                                        
                                                <%}}
                                                %>
                                               
							        </table>
                             <button type="submit" name="sub" value="sub" class="btn" ><i class="icon-hdd"></i>保存</button>
                              <div class="row-fluid">
                                <div class="span2">
                                  <!--边栏内容-->
                                 <div class="TreeViewDiv1">
                                    <asp:TreeView ID="TreeViewCategories" SelectedNodeStyle-BackColor="#c0c0c0"
                                          onselectednodechanged="TreeView1_SelectedNodeChanged" runat="server" 
                                          ImageSet="Simple">
                                    </asp:TreeView>
                                    </div>
                                </div>
                                <div class="span10">
                                  <!--主体内容-->
                                  <table id="we" class="table table-bordered table-striped table-hover">
                                                                <thead>
										                            <tr>
                                                                        <th style=" width:20px;"><input type="checkbox" name="allChecked" id="allChecked" onclick="SelectAll()"/></th>
											                            <th>权限名称</th>
										                            </tr>
									                            </thead>
                                                                <tbody>
                                                                <%
                                                                    if (dtlist != null && dtlist.Rows.Count != 0)
                                                                    {
                                                                        for (int i = 0; i < dtlist.Rows.Count; i++)
                                                                        {
                                                                      %>
                                                                <tr>
                                                                        <td><a href="#">
                                                                        <input  name="limitcheck" type="hidden" value=<%=dtlist.Rows[i]["limittype"].ToString()+":"+_loginid+":0" %> />
                                                                        <input type="checkbox" value=<%=dtlist.Rows[i]["limittype"].ToString()+":"+_loginid+":1" %> name="limitcheck" <%=dtlist.Rows[i]["userlimitvalue"].ToString()=="1"?"checked":"" %>/></a>
                                                                        </td>
                                                                        <td><%=dtlist.Rows[i]["limitname"].ToString()%></td>
									                            </tr>
                                                                <%
                                                                        }
                                                                    }
                                                                     %>
                                                                </tbody>
							                            </table>
                                  <div class="pager">
                                                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" FirstPageText="首页" LastPageText="尾页" PrevPageText="上一页" NextPageText="下一页" 
                                                        onpagechanging="AspNetPager1_PageChanging" NumericButtonCount="5"
                                                        PageSize="20" AlwaysShow="True" />
                                                        </div>
                                </div>
                              </div>
                          </div>
						</div>
					</div>
				</div>
			</div>
</asp:Content>
