<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FriendManage.aspx.cs" Inherits="PowerEasy.Module.General.WebSite.User.UserFriend.FriendManage" %>

<!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>
</head>
<body>
    <pe:ExtendedSiteMapPath ID="YourPosition" SiteMapProvider="UserMapProvider" runat="server" />
    <asp:Repeater ID="RptFriendGroup" runat="server">
        <HeaderTemplate>
            <div class="model_info_sate mtop10">
                <ul>
        </HeaderTemplate>
        <ItemTemplate>
            <%# RequestInt32("GroupID",-1) == PowerEasy.Framework.Common.DataConverter.ToInt32(Eval("FriendGroupID")) ? "<li class=\"hover\">" : "<li>"%><span><a
                href='<%#string.Format("FriendManage.aspx?GroupID={0}",Eval("FriendGroupID"))%>'><%#Eval("FriendGroupName")%></a></span></li>
        </ItemTemplate>
        <FooterTemplate>
            </ul></div>
        </FooterTemplate>
    </asp:Repeater>
    <form id="MainForm" runat="server">
    <pe:MemberExtendedGridView ID="EgvFriend" AutoGenerateCheckBoxColumn="true" DataKeyNames="ID"
        OnRowCommand="EgvFriend_RowCommand" DataSourceID="OdsFriend" AutoGenerateColumns="false"
        AllowPaging="true" runat="server" ItemName="<%$ Res: User_Shop_FriendManage_EgvFriend_ItemName,好友 %>"
        ItemUnit="<%$ Res: User_Shop_FriendManage_EgvFriend_ItemUnit,个 %>">
        <Columns>
            <pe:BoundField DataField="FriendName" HeaderText="<%$ Res: User_Shop_FriendManage_BoundField1,姓名 %>"
                HeaderStyle-Width="13%">
            </pe:BoundField>
            <pe:TemplateField HeaderText="<%$ Res: User_Shop_FriendManage_TemplateField1,组别 %>"
                HeaderStyle-Width="10%">
                <ItemTemplate>
                    <%#GetGroupName(Convert.ToInt32(Eval("GroupID"))) %>
                </ItemTemplate>
            </pe:TemplateField>
            <pe:BoundField HeaderText="<%$ Res: User_Shop_FriendManage_BoundField2,邮件地址 %>" HeaderStyle-Width="20%"
                DataField="Email">
            </pe:BoundField>
            <pe:BoundField HeaderText="<%$ Res: User_Shop_FriendManage_BoundField3,主页 %>" DataField="Homepage">
            </pe:BoundField>
            <pe:BoundField HeaderText="QQ" HeaderStyle-Width="12%" DataField="QQ">
            </pe:BoundField>
            <pe:TemplateField HeaderText="<%$ Res: User_Shop_FriendManage_TemplateField2,操作 %>"
                HeaderStyle-Width="12%">
                <ItemTemplate>
                    <asp:LinkButton runat="server" OnClientClick="<%$ Res: User_Shop_FriendManage_LinkButton_OnClientClick,if(!this.disabled) {return confirm('确定删除该好友吗？'); }%>"
                        CommandName="Del" CommandArgument='<%#Eval("ID")%>' Text="<%$ Res: User_Shop_FriendManage_LinkButton,删除 %>"></asp:LinkButton>
                    <asp:HyperLink ID="LnkSend" runat="server" Visible='<%# Convert.ToInt32(Eval("GroupID"))!=0 %>'
                        NavigateUrl='<%#string.Format("../Message/Message.aspx?inceptUser={0}",Eval("FriendName"))%>'
                        Text="<%$ Res: User_Shop_FriendManage_LnkSend,发短消息 %>"></asp:HyperLink>
                </ItemTemplate>
            </pe:TemplateField>
        </Columns>
    </pe:MemberExtendedGridView>
    <asp:Button ID="BtnDelete" CssClass="input_button_seven" runat="server" Text="<%$ Res: User_Shop_FriendManage_BtnDelete,删除选定的好友 %>"
        OnClientClick="return batchconfirm('确定删除选定的好友吗？');" OnClick="BtnDelete_Click" />
    <asp:Button ID="BtnMoveFriend" Width="20%" CssClass="input_button_ten" runat="server" OnClientClick="return batchconfirm();"
        Text="<%$ Res: User_Shop_FriendManage_BtnMoveFriend,将好友移动到-&gt; %>" OnClick="BtnMoveFriend_Click" />
    <asp:DropDownList ID="DropFriendGroup" DataTextField="FriendGroupName" AutoPostBack="false"
        DataValueField="FriendGroupID" runat="server">
    </asp:DropDownList>
    <asp:ObjectDataSource ID="OdsFriend" runat="server" SelectCountMethod="GetTotalOfFriend"
        SelectMethod="GetList" TypeName="PowerEasy.Module.General.BusinessLogic.UserManage.UserFriend"
        StartRowIndexParameterName="startRowIndexId" MaximumRowsParameterName="maxNumberRows"
        EnablePaging="True">
        <SelectParameters>
            <asp:ControlParameter ControlID="HdnUserName" Name="userName" Type="string" />
            <asp:QueryStringParameter Name="groupId" Type="Int32" QueryStringField="GroupID"
                DefaultValue="-1" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:HiddenField ID="HdnUserName" runat="server" />
    </form>
</body>
</html>
