<%@ Page Language="C#" AutoEventWireup="true" Inherits="Common_SelectViewer, QianboCMS" EnableEventValidation="false" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!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 runat="server">
    <title>选择签收用户</title>
    <link href="../User/Images/Layout.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="../Js/Common.js"></script>
    <script type="text/javascript">
        var api = frameElement.api, W = api.opener, D = W.document;
    </script>
    <script type="text/javascript" language="javascript">
        function Insert(val, UserId) {
            var tmp = "";
            if (val != "") {
                tmp = W.document.getElementById(val).value;
                array = tmp.split('|');
                for (var i = 0; i < array.length; i++) {
                    if (array[i] == $("Text_" + UserId).value) {
                        return;
                    }
                }
                if (tmp.length == 0) {
                    W.document.getElementById(val).value += $("Text_" + UserId).value;
                    api.close();
                }
                else {
                    W.document.getElementById(val).value += "|" + $("Text_" + UserId).value;
                    api.close();
                }
            }
            else {
                alert("非法操作！");
            }
        }
    </script>
</head>

<body>
    <form id="form1" runat="server">
        <table width="99%" cellspacing="1" cellpadding="0" class="wzdh" align="center">
            <tr>
                <td align="left" style="padding-left: 5px;">
					搜索用户名：
					<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
                    <asp:Button ID="Button1" runat="server" CssClass="btn" Text="搜索" OnClick="Button1_Click" />
				</td>
            </tr>
        </table>
        <table width="99%" align="center" class="border" cellspacing="1" cellpadding="0">
            <asp:Repeater ID="RepUserList" runat="server">
                <HeaderTemplate>
                    <tr class="titleBg">
                        <td>用户名</td>
                        <td width="150px">所属用户组</td>
                        <td width="120px">会员状态</td>
                        <td width="60px">操作</td>
                    </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="tdbg">
                        <td>
                            <asp:Label Text='<%#Eval("LogName")%>' runat="server" ID="lbLogName"></asp:Label>
                            <input type="text" name="Text_<%#Eval("UserId")%>" value="<%#Eval("LogName")%>" style="display: none;" />
						</td>
                        <td><%#Eval("UserGroupName")%></td>
                        <td><asp:Label ID="lblislock" Text='<%#GetIsLock(Eval("IsLock"))%>' runat="server"></asp:Label></td>
                        <td><a onclick="Insert('<%=ControlId %>',<%#Eval("UserId") %>)" class="mouseStyle">选择</a></td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
            <tr class="tdbg">
                <td colspan="4">
                    <webdiyer:AspNetPager ID="AspNetPager" runat="server" AlwaysShow="True" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" OnPageChanging="AspNetPager_PageChanging" PageSize="10" PrevPageText="上一页" ShowCustomInfoSection="Left" ShowInputBox="Never" CustomInfoSectionWidth="28%" ShowNavigationToolTip="True" Width="99%" HorizontalAlign="Right"></webdiyer:AspNetPager>
                </td>
            </tr>
        </table>
        <asp:Literal ID="litMsg" runat="server" Visible="false"></asp:Literal>
    </form>
</body>
</html>