<%@ Register TagPrefix="uc1" TagName="Pager" Src="../../modules/Pager.ascx" %>
<%@ Page language="c#" Codebehind="UserMenu.aspx.cs" AutoEventWireup="True" Inherits="health.aspx.sys.UserMenu" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>UserMenu</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link href="../../css/style.css" rel="stylesheet" type="text/css" />
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0">
				<TR>
					<TD colSpan="3" height="25"><FONT face="宋体"></FONT></TD>
				</TR>
				<TR>
					<TD width="5%"><FONT face="宋体"></FONT></TD>
					<TD>
						<table class="sys_grid" width="100%" border="0">
							<tr>
								<td>
									<table class="sys_grid" cellSpacing="0" cellPadding="0" width="100%" border="0">
										<tr>
											<td class="font-tit0214" align="center" width="100%" colSpan="4"><asp:label id="lblUserName" runat="server"></asp:label></td>
										</tr>
										<tr>
											<td class="tr-line01" width="100%" colSpan="3" height="2"></td>
										</tr>
										<tr>
											<td class="font-tit0214" colSpan="4" height="25">所属角色：</td>
										</tr>
									</table>
									<table id="tab" cellSpacing="0" cellPadding="0" width="100%" border="0">
										<TBODY>
											<tr>
												<td vAlign="top" align="center"><asp:datagrid id="dgrdGroup" runat="server" Width="100%" AutoGenerateColumns="False" AllowPaging="True"
														AllowSorting="True">
														<ItemStyle Height="25px"></ItemStyle>
														<HeaderStyle HorizontalAlign="Center" Font-Bold="True" ForeColor="Black" CssClass="sys_grid_head_cell"></HeaderStyle>
														<Columns>
															<asp:TemplateColumn HeaderText="角色名称">
																<HeaderStyle Width="30%" CssClass="sys_grid_cell_label"></HeaderStyle>
																<ItemTemplate>
																	<INPUT style="WIDTH: 100px; HEIGHT: 21px" type="hidden" size="11" runat="server" ID="Hidden1"
																		NAME="Hidden1"><%#DataBinder.Eval(Container.DataItem, "ROSE_NAME")%>
																</ItemTemplate>
																<EditItemTemplate>
																	<INPUT style="WIDTH: 1px; HEIGHT: 11px" type="hidden" size="1" runat="server" ID="Hidden2"
																		NAME="Hidden2">
																	<asp:TextBox id=tbGroupName runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ROSE_NAME")%>' Width="80px">
																	</asp:TextBox>
																</EditItemTemplate>
															</asp:TemplateColumn>
															<asp:TemplateColumn HeaderText="角色描述">
																<HeaderStyle Width="55%" CssClass="sys_grid_cell_label"></HeaderStyle>
																<ItemTemplate>
																	<%# DataBinder.Eval(Container.DataItem, "ROSE_DESC")%>
																</ItemTemplate>
																<EditItemTemplate>
																	<asp:TextBox id="tbGroupDescription" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ROSE_DESC")%>' Width="120px">
																	</asp:TextBox>
																</EditItemTemplate>
															</asp:TemplateColumn>
															<asp:TemplateColumn HeaderText="启用">
																<ItemStyle HorizontalAlign="Center" Height="25px"></ItemStyle>
																<HeaderStyle Width="15%" CssClass="sys_grid_cell_label"></HeaderStyle>
																<ItemTemplate>
																	<%# DataBinder.Eval(Container.DataItem, "IF_VALID").ToString() == "1" ? "√" : "×" %>
																</ItemTemplate>
																<EditItemTemplate>
																	<asp:CheckBox id=cbIsValid runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "IF_VALID").ToString() == "1" ? true : false %>'>
																	</asp:CheckBox>
																</EditItemTemplate>
															</asp:TemplateColumn>
														</Columns>
														<PagerStyle Visible="False" HorizontalAlign="Left" ForeColor="#000066" BackColor="White" Mode="NumericPages"></PagerStyle>
													</asp:datagrid><uc1:pager id="Pager1" runat="server"></uc1:pager><INPUT id="hdnItemIndex" style="WIDTH: 0px; HEIGHT: 0px" type="hidden" size="1" name="hdnItemIndex"
														runat="server"><INPUT id="hdnEditMode" style="WIDTH: 0px; HEIGHT: 0px" type="hidden" size="1" name="hdnEditMode"
														runat="server">
												</td>
											</tr>
											<tr>
												<td></td>
											</tr>
										</TBODY>
									</table>
									<table cellSpacing="0" cellPadding="0" width="100%" border="0">
										<tr>
											<td class="font-tit0214" colSpan="4"><FONT face="宋体"><asp:label id="lblMenu" runat="server">请选择主菜单:</asp:label><asp:dropdownlist id="ddlApp" runat="server" Width="176px" AutoPostBack="True" onselectedindexchanged="ddlApp_SelectedIndexChanged"></asp:dropdownlist></FONT><INPUT id="hdnDgChanged" style="WIDTH: 8px; HEIGHT: 21px" type="hidden" size="1" value="0"
													name="hdnDgChanged" runat="server">
											</td>
											<td><asp:radiobutton id="rbtnAllRight" runat="server" AutoPostBack="True" GroupName="RightType" Checked="True"
													Text="全部权限" oncheckedchanged="rbtnRight_CheckedChanged"></asp:radiobutton><asp:radiobutton id="rbtnGroupRight" runat="server" AutoPostBack="True" GroupName="RightType" Text="角色权限" oncheckedchanged="rbtnRight_CheckedChanged"></asp:radiobutton><asp:radiobutton id="rbtnUserRight" runat="server" AutoPostBack="True" GroupName="RightType" Text="用户权限" oncheckedchanged="rbtnRight_CheckedChanged"></asp:radiobutton></td>
										</tr>
									</table>
									<table cellSpacing="0" cellPadding="0" width="100%" border="0">
										<TR>
											<TD align="center"><asp:datagrid id="dgrdRight" runat="server" Width="100%" AutoGenerateColumns="False" AllowSorting="True">
													<ItemStyle Height="25px"></ItemStyle>
													<HeaderStyle Font-Bold="True" HorizontalAlign="Center" ForeColor="Black" CssClass="sys_grid_head_cell"></HeaderStyle>
													<Columns>
														<asp:TemplateColumn HeaderText="菜单">
															<HeaderStyle CssClass="sys_grid_cell_label"></HeaderStyle>
															<HeaderTemplate>
																<INPUT onclick="chkSelectAllClick(this);" type="checkbox">菜单
															</HeaderTemplate>
															<ItemTemplate>
																<INPUT onclick="chkSelectClick(this);" type="checkbox"><INPUT id="hdnChanged" style="WIDTH: 1px; HEIGHT: 18px" type="hidden" size="1" value="0"
																	runat="server" NAME="hdnChanged">&nbsp;
																<%# DataBinder.Eval(Container.DataItem, "MENU_NAME") %>
															</ItemTemplate>
														</asp:TemplateColumn>
														<asp:TemplateColumn HeaderText="新增">
															<HeaderStyle CssClass="sys_grid_cell_label"></HeaderStyle>
															<ItemStyle HorizontalAlign="Center" Height="25px"></ItemStyle>
															<ItemTemplate>
																<asp:CheckBox id="chkIsAdd" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "IF_ADD").ToString() == "1" ? true : false %>'>
																</asp:CheckBox>
															</ItemTemplate>
														</asp:TemplateColumn>
														<asp:TemplateColumn HeaderText="修改">
															<HeaderStyle CssClass="sys_grid_cell_label"></HeaderStyle>
															<ItemStyle HorizontalAlign="Center" Height="25px"></ItemStyle>
															<ItemTemplate>
																<asp:CheckBox id="chkIsModify" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "IF_MODIFY").ToString() == "1" ? true : false %>'>
																</asp:CheckBox>
															</ItemTemplate>
														</asp:TemplateColumn>
														<asp:TemplateColumn HeaderText="删除">
															<HeaderStyle CssClass="sys_grid_cell_label"></HeaderStyle>
															<ItemStyle HorizontalAlign="Center" Height="25px"></ItemStyle>
															<ItemTemplate>
																<asp:CheckBox id="chkIsDelete" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "IF_DELETE").ToString() == "1" ? true : false %>'>
																</asp:CheckBox>
															</ItemTemplate>
														</asp:TemplateColumn>
														<asp:TemplateColumn HeaderText="浏览">
															<HeaderStyle CssClass="sys_grid_cell_label"></HeaderStyle>
															<ItemStyle HorizontalAlign="Center" Height="25px"></ItemStyle>
															<ItemTemplate>
																<asp:CheckBox id="chkIsQuery" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "IF_QUERY").ToString() == "1" ? true : false %>'>
																</asp:CheckBox>
															</ItemTemplate>
														</asp:TemplateColumn>
														<asp:TemplateColumn HeaderText="打印">
															<HeaderStyle CssClass="sys_grid_cell_label"></HeaderStyle>
															<ItemStyle HorizontalAlign="Center" Height="25px"></ItemStyle>
															<ItemTemplate>
																<asp:CheckBox id="chkIsPrint" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "IF_PRINT").ToString() == "1" ? true : false %>'>
																</asp:CheckBox>
															</ItemTemplate>
														</asp:TemplateColumn>
														<asp:TemplateColumn HeaderText="签核">
															<HeaderStyle CssClass="sys_grid_cell_label"></HeaderStyle>
															<ItemStyle HorizontalAlign="Center" Height="25px"></ItemStyle>
															<ItemTemplate>
																<asp:CheckBox id="chkIsCheck" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "IF_CHECK").ToString() == "1" ? true : false %>'>
																</asp:CheckBox>
															</ItemTemplate>
														</asp:TemplateColumn>
													</Columns>
													<PagerStyle HorizontalAlign="Left" ForeColor="#000066" BackColor="White" Mode="NumericPages"></PagerStyle>
												</asp:datagrid>
											</TD>
										</TR>
									</table>
								</td>
							</tr>
						</table>
					</TD>
					<TD width="5%"><FONT face="宋体"></FONT></TD>
				</TR>
				<TR>
					<TD></TD>
					<TD></TD>
					<TD></TD>
				</TR>
			</TABLE>
		</form>
		<script language="javascript">	
		
		var find,cancel,save;
		
		function bodyLoad()
		{

			var i,j;
			var myTable = document.getElementById("dgrdRight");
			for(i=1;i<myTable.rows.length;i++)
			{
				for(j=1;j<myTable.rows[i].cells.length;j++)
					myTable.rows[i].cells[j].children[0].onclick=chkClick;
				myTable.rows[i].cells[4].children[0].onclick=chkQueryClick;
			}
		}
		
		function chkClick()
		{
			var obj=event.srcElement;
			var tr=obj.parentElement.parentElement;
			tr.cells[0].children[1].value="1";
			Form1.hdnDgChanged.value="1";
			if(obj.checked)
				tr.cells[4].children[0].checked=true;
			else
				tr.cells[0].children[0].checked=false;	
		}
		
		function chkQueryClick()
		{
			var obj=event.srcElement;
			var tr=obj.parentElement.parentElement;
			tr.cells[0].children[1].value="1";
			Form1.hdnDgChanged.value="1";
			var i;
			if(!obj.checked)
			{
				for(i=0;i<tr.cells.length;i++)
					tr.cells[i].children[0].checked=false;
			}
		}	
			
		function chkSelectAllClick(obj)
		{
			var myTable = document.getElementById("dgrdRight");
			var i;
			for(i=1;i<myTable.rows.length;i++)
			{
				myTable.rows[i].cells[0].children[0].checked=!obj.checked;
				myTable.rows[i].cells[0].children[0].click();
			}
			Form1.hdnDgChanged.value="1";
		}
				
		function chkSelectClick(obj)
		{
			var tr=obj.parentElement.parentElement;
			var i;
			for(i=1;i<tr.cells.length;i++)
				tr.cells[i].children[0].checked=obj.checked;
			tr.cells[0].children[1].value="1";	
			Form1.hdnDgChanged.value="1";			
		}
		</script>
	</body>
</HTML>
