<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Voteuserbysid.aspx.cs" Inherits="Vote.Admin.Voteuserbysid" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body style=" font-size:12px; margin:15px; font-family:Verdana ">
    <form id="form1" runat="server">
    <div>
    







  <div class="myblock" >
 <div style=" margin:5px;">


 <h3>
 <asp:Label runat="server" ID="lbl_votename"></asp:Label> 
 投票人员名单</h3>
 </div>




 
 
 
 <div style=" float:right; padding-right:40px;">

 过滤：<asp:DropDownList Width="150px" runat="server" ID="ddl_dept" AutoPostBack="True">
 <asp:ListItem Text="所有人员" Value=""></asp:ListItem>
 </asp:DropDownList>
 姓名：<asp:TextBox ID="txt_username" Width=100 runat="server"></asp:TextBox>


     <asp:Button ID="btn_search" runat="server" Text="搜索" CssClass="css" />

    &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="#" style=" color:#333" onclick="window.open('vote_addvoteuser.aspx?sid=<%=Request.QueryString["sid"] %>','','width=500px,left=100px,top=100px,height=400px'); return false;"><img src="img/add.gif"  style=" vertical-align:middle" border=0px/>添加投票人员</a>
 </div>
 
 
      







 
   <div class="content">
  
  
  
  
  
 
 <table cellspacing="0" class="thelist2" cellpadding="8" rules="all" border="1"  style="color:#333333;border-color:LightGrey;width:99%;border-collapse:collapse;">
			<tbody>
			
			
			<tr class="DG_Header">
			 	
				<th scope="col">
				用户名</th>
				 
                 <th scope="col">
				 密码
				</th>
				
				<th align="center" scope="col" >
				 员工号
				</th>
			 
					<th align="center" scope="col" >
				 部门
				</th>
                <th align="center" scope="col" >
				 删除
				</th>
		 	</tr>
			
			
			<!-- memberlist  -->
			
			
			
			
				 
	   <asp:ListView ID="lv_member" runat="server" DataKeyNames="id,sid" 
            DataSourceID="SqlDataSource1" >
			 
			         <ItemTemplate>
           <tr>
			 
			 <td  width="200px">
	            <%#Eval("username") %>
			</td>
			 <td>
				<%#Eval("pwd") %> 
			</td>
			
			<td width="300px">
			<%#Eval("staffcode") %>	
			</td>
			  <td width="300px">
			<%#Eval("dept") %>	
			</td>
			
			<td width="100">
                <asp:ImageButton ID="ib_del"  OnClientClick="JavaScript:return confirm('确定删除吗？')"   ImageUrl="img/del.jpg" runat="server"   CommandName="Delete" />        
           
                
              </td>
			
			 
			 </tr>
            </ItemTemplate>
			 
			 
			   
            
            
			    <LayoutTemplate>
			      <span ID="itemPlaceholder" runat="server" />
                  <br />

                   <asp:DataPager ID="DataPager1" PageSize=20 runat="server">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowLastPageButton="True" />
                            </Fields>
                        </asp:DataPager>


                </LayoutTemplate>
			 
			
			 </asp:ListView>
			 
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			</tbody>
			</table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
   <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        DeleteCommand=" delete from vote_subjects_users where uid=@id and sid=@sid "  
          
  SelectCommand=" 
  select vote_users.* ,sid from vote_users inner join vote_subjects_users on
vote_users.id=vote_subjects_users.uid where sid=@sid
and (@dept='' or dept=@dept)
 and (@username='' or username like '%'+@username+'%') 
 order by vote_users.username asc  " 
          
            >
            
             
           <SelectParameters>
             <asp:QueryStringParameter QueryStringField="sid" DefaultValue="0" Name="sid" Type="String" />
             <asp:ControlParameter  Name="dept" ControlID="ddl_dept" DefaultValue="" ConvertEmptyStringToNull="false" />
               <asp:ControlParameter  Name="username" ControlID="txt_username" DefaultValue="" ConvertEmptyStringToNull="false" />
           </SelectParameters>
      </asp:SqlDataSource>
      
      
 </div>
 </div>






    </div>
    </form>
</body>
</html> 