<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="pg_LettersRecieved.aspx.cs" Inherits="rl_admins_pg_LettersRecieved" Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" Runat="Server">
    <div class="contentDiv">
        <table border="0" cellpadding="0" cellspacing="0" >
            <tr id="Tr1">
                <td id="rightTableData" valign="top">
                    <div id="linksPanel" style="margin-right:15px; margin-top : 10px;">
                        <table id="tblpanel" border="0" cellpadding="0" cellspacing="0" style="width:200px;">
                            <tr>
                                <td id="panelheadright" class="panelheadright">
                                </td>
                                <td id="panelheadrepeat" class="panelheadrepeat" align="center" style="width:160px;">
                                    <asp:Label ID="lblpanelHead" runat="server" Text="منوی سایت" style="color:White; font-weight:bold; "></asp:Label>
                                </td>
                                <td id="panelheadleft" class="panelheadleft">
                                </td>
                            </tr>
                            <tr>
                                <td id="panelmarginright" class="panelmarginright">
                                </td>
                                <td valign="top" class="panelcontentback" style="background-image:none; background-color : White; "> <!-- ************ Content Place !-->
                                    <div class="panelcontent" style="margin-top:17px;">
                                        <asp:Panel ID="panelMenues" runat="server">
                                        </asp:Panel>
                                    </div>
                                </td>
                                <td id="panelmarginleft" class="panelmarginleft" align="left">
                                </td>
                            </tr>
                            <tr>
                                <td id="panelbottomright" class="panelbottomright" align="right" >
                                </td>
                                <td id="panelbottomrepeat" class="panelbottomrepeat" style="width:160px;">
                                </td>
                                <td id="panelbottomleft" class="panelbottomleft" align="left";>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
                <td id="contentTableData" style="width:100%; padding-right : 10px;" align="right"; valign="top"; >
                     <div id="frameContainer" style="padding:10px 10px 25px 10px;">
                        <table id="Table2" border="0" cellpadding="0" cellspacing="0" style="width:100%;">
                            <tr>
                                <td id="Td92" class="panelheadright">
                                </td>
                                <td id="Td102" class="panelheadrepeat" align="center" >
                                    <asp:Label ID="lblFrameTitle" runat="server" Text="لیست نامه های دریافتی" style="color:White;"></asp:Label>
                                </td>
                                <td id="Td112" class="panelheadleft">
                                </td>
                            </tr>
                            <tr>
                                <td id="Td122" class="panelmarginright">
                                </td>
                                <td valign="top" class="panelcontentback" > <!-- ************ Content Place !-->
                                    <div id="divRoleType" class="panelcontent" style="text-align:center; " runat="server">
                                        <div id="gridUsers" style="padding-right: 20px; padding-left : 20px;">
                                            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                                <ContentTemplate>
                                                    <asp:GridView ID="GridView1" runat="server" style="width:100%;" 
                                                        AllowPaging="True" AutoGenerateColumns="False" 
                                                        CssClass="grid" PageSize="15" PagerStyle-CssClass="gridPager" 
                                                        DataKeyNames="letterId" DataSourceID="SqlDataSource1" 
                                                        onrowcommand="GridView1_RowCommand" 
                                                        onpageindexchanging="GridView1_PageIndexChanging" 
                                                        EmptyDataText="رکوردی یافت نشد" >
                                                        <PagerSettings NextPageText="&gt;" PreviousPageText="&lt;" />
                                                        <Columns>
                                                            <asp:TemplateField HeaderText="وضعیت" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                                <ItemTemplate>
                                                                    <asp:ImageButton ID="btnRead" CommandName="ReadPress" CommandArgument='<%#Eval("letterId") %>' runat="server" ImageUrl='<%#FindImageUrl(Eval("letterId"))%>' ToolTip="خوانده شد" />
                                                                </ItemTemplate>
                                                                <HeaderStyle CssClass="gridHeader" />
                                                                <ItemStyle CssClass="gridCell" />
                                                            </asp:TemplateField>
                                                            <asp:BoundField DataField="letterId" HeaderText="کد نامه" 
                                                                HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                                <HeaderStyle CssClass="gridHeader" />
                                                                <ItemStyle CssClass="gridCell" />
                                                            </asp:BoundField>
                                                            <asp:TemplateField HeaderText="موضوع نامه" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="btnSubject" runat="server" CommandName="ShowContext" CommandArgument='<%#Eval("letterId") %>' style="text-decoration:none;"><%#Eval("subject") %></asp:LinkButton>
                                                                    <cc1:HoverMenuExtender ID="HoverMenuExtender1" runat="server" DynamicServicePath="" Enabled="True" PopupPosition="Left" 
                                                                        TargetControlID="btnSubject" OffsetX="275" OffsetY="20" PopupControlID="panelContext">
                                                                    </cc1:HoverMenuExtender>
                                                                    <asp:Panel ID="panelContext" runat="server" CssClass="pophtmlpanel">
                                                                        <div id="newsContext" runat="server">
                                                                            <%#Eval("context").ToString()%>
                                                                        </div>
                                                                    </asp:Panel>
                                                                </ItemTemplate>
                                                                <HeaderStyle CssClass="gridHeader" />
                                                                <ItemStyle CssClass="gridCell" />
                                                            </asp:TemplateField>
                                                            <asp:BoundField DataField="letterDate" HeaderText="تاریخ ارسال" 
                                                                HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                                <HeaderStyle CssClass="gridHeader" />
                                                                <ItemStyle CssClass="gridCell" />
                                                            </asp:BoundField>
                                                            <asp:BoundField DataField="letterType" HeaderText="نوع نامه" 
                                                                HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                                <HeaderStyle CssClass="gridHeader" />
                                                                <ItemStyle CssClass="gridCell" />
                                                            </asp:BoundField>
                                                            <asp:BoundField DataField="senderName" HeaderText="نام فرستنده" 
                                                                HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                                <HeaderStyle CssClass="gridHeader" />
                                                                <ItemStyle CssClass="gridCell" />
                                                            </asp:BoundField>
                                                            <asp:TemplateField HeaderText="حذف نامه" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="btnDelete" runat="server" CommandName="DeletePress" CommandArgument='<%#Eval("letterId") %>' CssClass="gridsmallbuttons" Width="60px" Height="20px" style="margin-top:4px;" >حذف</asp:LinkButton>
                                                                    <cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="آیا برای حذف کاربر اطمینان دارید؟" TargetControlID="btnDelete">
                                                                    </cc1:ConfirmButtonExtender>
                                                                </ItemTemplate>
                                                                <HeaderStyle CssClass="gridHeader" />
                                                                <ItemStyle CssClass="gridCell" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                        <PagerStyle CssClass="gridPager" BorderStyle="None" HorizontalAlign="Center" 
                                                            VerticalAlign="Middle" />
                                                    </asp:GridView>
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="btnUnRead" EventName="Click"/>
                                                    <asp:AsyncPostBackTrigger ControlID="btnAll" EventName="Click"/>
                                                    <asp:AsyncPostBackTrigger ControlID="btnEnteghad" EventName="Click"/>
                                                    <asp:AsyncPostBackTrigger ControlID="btnNazar" EventName="Click"/>
                                                    <asp:AsyncPostBackTrigger ControlID="btnPishnahadat" EventName="Click"/>
                                                </Triggers>
                                            </asp:UpdatePanel>
                                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                                ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>"
                                                ProviderName="System.Data.SqlClient" 
                                                SelectCommand="SELECT [letterId], [subject], [context], [letterDate], [letterType], [senderName] FROM [t_Letters] ORDER BY [letterId]"></asp:SqlDataSource>
                                        </div>
                                    </div>
                                </td>
                                <td id="Td132" class="panelmarginleft" align="left">
                                </td>
                            </tr>
                            <tr>
                                <td id="Td142" class="panelbottomright" align="right" >
                                </td>
                                <td id="Td152" class="panelbottomrepeat" >
                                </td>
                                <td id="Td162" class="panelbottomleft" align="left";>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                    <table border="0" cellpadding="0" cellspacing="5px" width="100%">
                                        <tr>  
                                            <td width="100%">
                                            </td>  
                                            <td width="60px">
                                                <asp:LinkButton ID="btnUnRead" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" onclick="btnUnRead_Click" >خوانده نشده</asp:LinkButton>
                                            </td>
                                            <td width="60px">
                                                <asp:LinkButton ID="btnEnteghad" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" 
                                                    onclick="btnEnteghad_Click"  >انتقادات</asp:LinkButton>
                                            </td>
                                            <td width="60px">
                                                <asp:LinkButton ID="btnNazar" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" 
                                                    onclick="btnNazar_Click"  >نظرات</asp:LinkButton>
                                            </td>
                                            <td width="60px">
                                                <asp:LinkButton ID="btnPishnahadat" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" 
                                                    onclick="btnPishnahadat_Click"  >پیشنهادات</asp:LinkButton>
                                            </td>
                                            <td width="60px">
                                                <asp:LinkButton ID="btnAll" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" onclick="LinkButton1_Click" >همه</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>

