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

<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 101px;
        }
        .style2
        {
            width: 61px;
        }
        .style3
        {
            width: 115px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <table style="width:100%;">
        <tr>
            <td class="style3">
                <asp:Label ID="Label1" runat="server" Text="عنوان رای گیری"></asp:Label></td>
            <td class="style2">
                <asp:DropDownList ID="DrpTitleRaigiri" runat="server" 
                    DataSourceID="LinqDtsOnvanRaigiri" DataTextField="RaigiriName" 
                    DataValueField="RaigiriTitleId" Height="16px" Width="187px" ValidationGroup="2" 
                    >
                </asp:DropDownList>
                <asp:LinqDataSource ID="LinqDtsOnvanRaigiri" runat="server" 
                    ContextTypeName="Lsc_EVotingDataContext" EntityTypeName="" 
                    OrderBy="RaigiriTitleId desc" TableName="tblRaigiriTitles">
                </asp:LinqDataSource>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                <asp:Button ID="BtnInsert" runat="server" onclick="BtnInsert_Click" 
                    Text="نمایش" ValidationGroup="2" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
           <td class="style3">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
           <td class="style2" colspan="2">
                <asp:GridView ID="dgJozeiat" runat="server" AutoGenerateColumns="False" 
                    CellPadding="4" DataSourceID="LinqDtsJozeiat" ForeColor="#333333" 
                    GridLines="None" Width="98%">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="JozeiatRaiId" HeaderText="کد" 
                            SortExpression="JozeiatRaiId" />
                        <asp:BoundField DataField="RaigiriName" HeaderText="عنوان" 
                            SortExpression="RaigiriName" />
                        <asp:BoundField DataField="RaiQuantity" HeaderText="تعداد رای" 
                            SortExpression="RaiQuantity" />
                        <asp:BoundField DataField="KandidName" HeaderText="کاندید" 
                            SortExpression="KandidName" />
                        <asp:BoundField DataField="RaigiriTitleId" HeaderText="RaigiriTitleId" 
                            SortExpression="RaigiriTitleId" Visible="False" />
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
                <asp:LinqDataSource ID="LinqDtsJozeiat" runat="server" 
                    ContextTypeName="Lsc_EVotingDataContext" EntityTypeName="" 
                    TableName="xtblJozeiatRais" Where="RaigiriTitleId == @RaigiriTitleId">
                    <WhereParameters>
                        <asp:ControlParameter ControlID="DrpTitleRaigiri" Name="RaigiriTitleId" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </WhereParameters>
                </asp:LinqDataSource>
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

