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

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 219px;
        }
        .style2
        {
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <table style="width:100%;">
        <tr>
            <td class="style2">
                <asp:Label ID="Label1" runat="server" Text="عنوان رای گیری:"></asp:Label>
            </td>
            <td class="style1">
                <asp:TextBox ID="Txt_Title" runat="server" ValidationGroup="11"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="Txt_Title" ErrorMessage="عنوان رای گیری وارد نشده است!" 
                    ValidationGroup="11"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                <asp:Label ID="Label2" runat="server" Text="تاریخ شروع:"></asp:Label>
            </td>
            <td class="style1">
                <asp:TextBox ID="Txt_BeginDate" runat="server" ValidationGroup="11"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="Txt_BeginDate" 
                    ErrorMessage="تاریخ شروع رای گیری وارد نشده است!" ValidationGroup="11"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                <asp:Label ID="Label3" runat="server" Text="تاریخ پایان:"></asp:Label>
            </td>
            <td class="style1">
                <asp:TextBox ID="Txt_FinishDate" runat="server" ValidationGroup="11"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="Txt_FinishDate" 
                    ErrorMessage="تاریخ پایان رای گیری واردنشده است!" ValidationGroup="11"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td class="style1">
                <asp:Button ID="BtnInsert" runat="server" onclick="BtnInsert_Click" Text="درج" 
                    ValidationGroup="11" Width="45px" />
            </td>
            <td>
                <asp:Label ID="Lbl_Massage" runat="server" Font-Bold="True" ForeColor="#FF3300" 
                    Text="درج انجام شد!" Visible="False"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2" colspan="3">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" CellPadding="4" DataKeyNames="RaigiriTitleId" 
                    DataSourceID="LinqDtsRaiTitle" ForeColor="#333333" GridLines="None" 
                    PageSize="5" Width="98%">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:CommandField ShowEditButton="True" />
                        <asp:BoundField DataField="RaigiriTitleId" HeaderText="کد" 
                            InsertVisible="False" ReadOnly="True" SortExpression="RaigiriTitleId" />
                        <asp:BoundField DataField="RaigiriName" HeaderText="عنوان" 
                            SortExpression="RaigiriName" />
                        <asp:CheckBoxField DataField="CloseBit" HeaderText="وضعیت" 
                            SortExpression="CloseBit" />
                        <asp:BoundField DataField="DateCreation" HeaderText="تاریخ شروع" 
                            SortExpression="DateCreation" />
                        <asp:BoundField DataField="DateFinish" HeaderText="تاریخ پایان" 
                            SortExpression="DateFinish" />
                        <asp:CommandField ShowDeleteButton="True" />
                    </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="LinqDtsRaiTitle" runat="server" 
                    ContextTypeName="Lsc_EVotingDataContext" EnableDelete="True" 
                    EnableUpdate="True" EntityTypeName="" OrderBy="RaigiriTitleId desc" 
                    TableName="tblRaigiriTitles">
                </asp:LinqDataSource>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td class="style1">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

