<%@ Page Title="" Language="C#" MasterPageFile="~/eosWinkartWeb/eosWinkartWeb.Master"
    AutoEventWireup="true" CodeBehind="SendMessage.aspx.cs" Inherits="WebKart.eosWinkartWeb.SendMessage" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" border="0">
        <tr>
            <td colspan="2" class="CenterTD">
                <asp:Label ID="lblError" runat="server" Text="" SkinID="LblError"></asp:Label>
            </td>
        </tr>
    </table>
    <asp:Panel ID="pnlSend" runat="server">
        <table width="100%" border="0">
            <tr>
                <td class="RightTD">
                    <asp:TextBox ID="txtSubject" runat="server" Width="500px" MaxLength="100" ValidationGroup="SendMessage"></asp:TextBox>
                    <asp:RequiredFieldValidator ControlToValidate="txtSubject" ID="rfvSubject" runat="server"
                        SetFocusOnError="true" ValidationGroup="SendMessage">عنوان پیام را وارد نمایید.</asp:RequiredFieldValidator>
                </td>
                <td class="LeftTD">
                    عنوان پیغام:
                </td>
            </tr>
            <tr>
                <td class="RightTD">
                    <asp:TextBox ID="txtMessage" runat="server" Width="500px" TextMode="MultiLine" ValidationGroup="SendMessage"
                        Height="95px"></asp:TextBox>
                    <asp:RequiredFieldValidator ControlToValidate="txtMessage" ID="rfvMessage" runat="server"
                        SetFocusOnError="true" ValidationGroup="SendMessage">متن پیام را وارد نمایید.</asp:RequiredFieldValidator>
                </td>
                <td class="LeftTD">
                    متن پیغام:
                </td>
            </tr>
            <tr>
                <td class="RightTD">
                    <asp:RadioButtonList ID="rblIsForces" runat="server" RepeatDirection="Vertical" Width="500px">
                        <asp:ListItem Text="پیام عادی" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="پیام سیستمی - برای استفاده از سامانه باید خوانده شود." Enabled="false"></asp:ListItem>
                    </asp:RadioButtonList>
                </td>
                <td class="LeftTD">
                    نوع پیام:
                </td>
            </tr>
            <tr>
                <td class="LeftTD" colspan="2">
                    <asp:Button ID="btnSendTop" runat="server" Text="ارسال" SkinID="btnOrange" ValidationGroup="SendMessage"
                        OnClick="btnSendMessage_Click" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <hr />
                </td>
            </tr>
            <tr>
                <td class="RightTD">
                    <asp:DropDownList ID="drpSections" runat="server" AutoPostBack="true" Width="500px"
                        DataTextField="Name" DataValueField="Code" AppendDataBoundItems="true" OnSelectedIndexChanged="drpSections_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td class="RightTD">
                    پرسنل قسمت:
                </td>
            </tr>
            <tr>
                <td colspan="2" class="RightTD">
                    <telerik:RadGrid ID="grdPersonel" runat="server" AutoGenerateColumns="false" AllowMultiRowSelection="true"
                        AllowSorting="False" dir="rtl" Font-Names="Tahoma" Font-Size="8pt">
                        <ClientSettings>
                            <Selecting AllowRowSelect="true" />
                        </ClientSettings>
                        <MasterTableView DataKeyNames="PerNo" GroupLoadMode="Client" GroupsDefaultExpanded="true"
                            AllowSorting="False">
                            <Columns>
                                <telerik:GridClientSelectColumn DataTextField="PersonName" HeaderText="نام پرسنل"  >
                                             <HeaderStyle Font-Names="Tahoma" Font-Size="8pt" HorizontalAlign="Center" />
                                <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                </telerik:GridClientSelectColumn>
                                <telerik:GridBoundColumn DataField="PerNo" HeaderText="کد پرسنل">
                                             <HeaderStyle Font-Names="Tahoma" Font-Size="8pt" HorizontalAlign="Center" />
                                <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="PersonName" HeaderText="نام پرسنل">
                                             <HeaderStyle Font-Names="Tahoma" Font-Size="8pt" HorizontalAlign="Center" />
                                <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Right" />
                                </telerik:GridBoundColumn>
                            </Columns>
                            <GroupByExpressions>
                                <telerik:GridGroupByExpression>
                                    <GroupByFields>
                                        <telerik:GridGroupByField FieldName="Section" />
                                    </GroupByFields>
                                    <SelectFields>
                                        <telerik:GridGroupByField FieldName="sectionName" FieldAlias="قسمت" />
                                    </SelectFields>
                                </telerik:GridGroupByExpression>
                            </GroupByExpressions>
                        </MasterTableView>
                    </telerik:RadGrid>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <hr />
                </td>
            </tr>
            <tr>
                <td class="LeftTD" colspan="2">
                    <asp:Button ID="btnSendMessage" runat="server" Text="ارسال" SkinID="btnOrange" ValidationGroup="SendMessage"
                        OnClick="btnSendMessage_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
