<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="Message.aspx.cs"
    Inherits="PowerEasy.Module.General.WebSite.User.Message.MessageUI" %>

<!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" />
    <form id="MainForm" runat="server">
    <div class="model_info_list">
        <div class="model_info_one">
            <asp:Localize ID="Localize10" Text="<%$ Res: User_Message_Message_Localize1,撰写短消息 %>"
                runat="server" />
        </div>
        <div class="model_info_content">
            <table width="100%" border="0" cellpadding="2" cellspacing="1" class="table_style">
                <tr class="first">
                    <td class="ok_tab" width="25%">
                        <asp:Localize ID="Localize2" Text="<%$ Res: User_Message_Message_Localize2,收件人： %>"
                            runat="server" />
                    </td>
                    <td>
                        <asp:ScriptManager ID="scriptManage1" runat="server">
                        </asp:ScriptManager>
                        <asp:UpdatePanel ID="updatepannel1" runat="server">
                            <ContentTemplate>
                                <asp:TextBox ID="TxtInceptUser" runat="server" CssClass="inputxt" />
                                <asp:DropDownList ID="dropFriendGroups" runat="server" AutoPostBack="true" DataTextField="FriendGroupName"
                                    DataValueField="FriendGroupID" />
                                <asp:DropDownList ID="DropFriends" runat="server" />
                                <pe:RequiredFieldValidator ID="ValrInceptUser" runat="server" ControlToValidate="TxtInceptUser"
                                    ErrorMessage="<%$ Res: User_Message_Message_ValrInceptUser,收件人不能为空 %>" Display="Dynamic" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td class="ok_tab">
                        <asp:Localize ID="Localize3" Text="<%$ Res: User_Message_Message_Localize3,短消息主题： %>"
                            runat="server" />
                    </td>
                    <td>
                        <asp:TextBox ID="TxtTitle" runat="server" Width="300" MaxLength="50" CssClass="inputxt" />
                        <pe:RequiredFieldValidator ID="ValrTitle" runat="server" ControlToValidate="TxtTitle"
                            ErrorMessage="<%$ Res: User_Message_Message_ValrTitle,短消息主题不能为空 %>" Display="Dynamic" />
                    </td>
                </tr>
                <tr>
                    <td class="ok_tab">
                        <asp:Localize ID="Localize4" Text="<%$ Res: User_Message_Message_Localize4,短消息内容： %>"
                            runat="server" />
                    </td>
                    <td>
                        <pe:CKeditor ID="EditorContent" runat="server" Width="580px" Height="300px" Toolbar="Basic"
                            ImageUpload="false" FlashUpload="false" Foreground="true" ModuleName="message" FileRecord="false" />
                        <pe:CKeditorValidator ID="ValrContent" runat="server" ControlToValidate="EditorContent"
                            ErrorMessage="<%$ Res: User_Message_Message_ValrContent,短消息内容不能为空 %>" Display="Dynamic" />
                    </td>
                </tr>
            </table>
            <div class="ok_bottom">
                <asp:HiddenField ID="HdnMessageID" runat="server" />
                <asp:Button ID="BtnSend" runat="server" CssClass="submit_button" Text="<%$ Res: User_Message_Message_BtnSend,发送 %>"
                    CommandName="Send" OnClick="BtnSend_Click" />
                <asp:Button ID="BtnSave" runat="server" CssClass="submit_button" Text="<%$ Res: User_Message_Message_BtnSave,保存 %>"
                    CommandName="Save" OnClick="BtnSave_Click" />
                <input name="Cancel" type="button" class="submit_button" id="Button1" value="清除"
                    onclick="javascript:return ResetContent()" />
            </div>
        </div>
    </div>
    <div class="clear">
    </div>
    <div class="model_Info_Tips">
        <asp:Localize ID="Localize5" Text="<%$ Res: User_Message_Message_Localize5,1、可以用英文状态下的逗号将用户名隔开实现群发，最多 %>"
            runat="server" /><b><asp:Label ID="LblMaxSendNum" runat="server" Text="" /></b><asp:Localize
                ID="Localize6" Text="<%$ Res: User_Message_Message_Localize6,个用户。 %>" runat="server" /><br />
        <asp:Localize ID="Localize7" Text="<%$ Res: User_Message_Message_Localize7,2、标题最多 %>"
            runat="server" /><b><%=TxtTitle.MaxLength.ToString()%></b><asp:Localize ID="Localize8"
                Text="<%$ Res: User_Message_Message_Localize8,个字符，内容最多 %>" runat="server" /><b><%=MaxContentLength%></b><asp:Localize
                    ID="Localize9" Text="<%$ Res: User_Message_Message_Localize9,个字符 %>" runat="server" /><br />
        <asp:Label ID="Label1" runat="server" Text="3、在添加了好友之后，可以在收件人下拉框选择好友为收件人"></asp:Label><br />
    </div>

    <script type="text/javascript">
        
           
            function SelectFromFriend()
            {
            var txtInceptUser = document.getElementById('<%=TxtInceptUser.ClientID%>');
            var dropFriends = document.getElementById('<%=DropFriends.ClientID%>');        
                if(dropFriends.selectedIndex==0)
                {
                    return false;
                }
                var selectedFriend = dropFriends.value;
                
                if(txtInceptUser.value !='')
                {
                    var users = txtInceptUser.value.split(',');
                    for(var i=0;i<users.length;i++)
                    {
                        if(users[i]==selectedFriend)
                        {
                            return false;
                        }
                    }
                    txtInceptUser.value +=","+selectedFriend;
                }
                else
                {
                    txtInceptUser.value =selectedFriend;
                }
            }

            function ResetContent() {
                var TxtInceptUser = document.getElementById('<%=TxtInceptUser.ClientID%>');
                var TxtTitle = document.getElementById('<%=TxtTitle.ClientID%>');
                var EditorContent = document.getElementById('<%=EditorContent.ClientID%>');
                TxtInceptUser.value = '';
                TxtTitle.value = '';
                <%=EditorContent.ClientID%>$$ckeditor$$obj.setData('');
             }
    </script>

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