<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.PollInfoControl"
    CodeBehind="PollInfo.ascx.cs" %>
<%@ Register TagPrefix="nopCommerce" TagName="ToolTipLabel" Src="ToolTipLabelControl.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="NumericTextBox" Src="NumericTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="SimpleTextBox" Src="SimpleTextBox.ascx" %>
<table class="adminContent">
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblLanguage" Text="Language:" ToolTip="Choose the language for this poll. Customers who have this language selected in your store, will then see the poll."
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <asp:DropDownList ID="ddlLanguage" AutoPostBack="False" CssClass="adminInput" runat="server">
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblName" Text="Name:" ToolTip="The descriptive name of this poll. This is the text that the customer will see e.g. 'What do you think of our store?'."
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <nopCommerce:SimpleTextBox runat="server" ID="txtName" CssClass="adminInput" ErrorMessage="Name is required"
                ValidationGroup="EditPoll"></nopCommerce:SimpleTextBox>
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblSystemKeyword" Text="System keyword:"
                ToolTip="A system keyword for this poll." ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <asp:TextBox ID="txtSystemKeyword" CssClass="adminInput" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblPublished" Text="Published:" ToolTip="Determines whether this poll is published (visible) in your store."
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <asp:CheckBox ID="cbPublished" runat="server" Checked="True"></asp:CheckBox>
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblDisplayOrder" Text="Display order:"
                ToolTip="The display order of this poll. 1 represents the top of the list." ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <nopCommerce:NumericTextBox runat="server" CssClass="adminInput" ID="txtDisplayOrder"
                Value="1" RequiredErrorMessage="Display order is required" RangeErrorMessage="The value must be from -99999 to 99999"
                MinimumValue="-99999" MaximumValue="99999" ValidationGroup="EditPoll"></nopCommerce:NumericTextBox>
        </td>
    </tr>
</table>
<div runat="server" id="pnlPollAnswers">
    <p>
        <hr />
    </p>
    <asp:GridView ID="gvPollAnswers" runat="server" AutoGenerateColumns="false" DataKeyNames="PollAnswerID"
        OnRowDeleting="gvPollAnswers_RowDeleting" OnRowDataBound="gvPollAnswers_RowDataBound"
        OnRowCommand="gvPollAnswers_RowCommand" Width="100%">
        <Columns>
            <asp:TemplateField HeaderText="Poll answer" ItemStyle-Width="40%">
                <ItemTemplate>
                    <nopCommerce:SimpleTextBox runat="server" ID="txtName" Text='<%# Eval("Name") %>'
                        CssClass="adminInput" ErrorMessage="Name is required"></nopCommerce:SimpleTextBox>
                    <asp:HiddenField ID="hfPollAnswerID" runat="server" Value='<%# Eval("PollAnswerID") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Count" HeaderText="Count" HeaderStyle-HorizontalAlign="Center"
                ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
            <asp:TemplateField HeaderText="Display order" HeaderStyle-HorizontalAlign="Center"
                ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <nopCommerce:NumericTextBox runat="server" CssClass="adminInput" ID="txtDisplayOrder"
                        Value='<%# Eval("DisplayOrder") %>' Width="50px" RequiredErrorMessage="Display order is required"
                        RangeErrorMessage="The value must be from -99999 to 99999" MinimumValue="-99999"
                        MaximumValue="99999"></nopCommerce:NumericTextBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Update" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
                ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <asp:Button ID="btnUpdate" runat="server" CssClass="adminButton" Text="Update" ValidationGroup="UpdatePollAnswer"
                        CommandName="UpdatePollAnswer" ToolTip="Update poll answer" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Delete" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
                ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <asp:Button ID="btnDelete" runat="server" CssClass="adminButton" Text="Delete" CausesValidation="false"
                        CommandName="Delete" ToolTip="Delete poll answer" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <p>
        <strong>Add a new poll answer </strong>
    </p>
    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                <nopCommerce:ToolTipLabel runat="server" ID="lblAnswerName" Text="Name:" ToolTip="The name (value) of this answer. This is the text that the customer will see e.g. 'Excellant'."
                    ToolTipImage="~/Administration/Common/ico-help.gif" />
            </td>
            <td class="adminData">
                <nopCommerce:SimpleTextBox runat="server" ID="txtPollAnswerName" CssClass="adminInput"
                    ErrorMessage="Name is required" ValidationGroup="AddPollAnswer"></nopCommerce:SimpleTextBox>
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                <nopCommerce:ToolTipLabel runat="server" ID="lblAnswerDisplayOrder" Text="Display order:"
                    ToolTip="The display order of this poll answer. 1 represents the top of the list."
                    ToolTipImage="~/Administration/Common/ico-help.gif" />
            </td>
            <td class="adminData">
                <nopCommerce:NumericTextBox runat="server" CssClass="adminInput" ID="txtPollAnswerDisplayOrder"
                    Value="1" RequiredErrorMessage="Display order is required" RangeErrorMessage="The value must be from -99999 to 99999"
                    ValidationGroup="AddPollAnswer" MinimumValue="-99999" MaximumValue="99999"></nopCommerce:NumericTextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="left">
                <asp:Button runat="server" ID="btnAddPollAnswer" Text="Add poll answer" CssClass="adminButton"
                    ValidationGroup="AddPollAnswer" OnClick="btnAddPollAnswer_Click" ToolTip="Add poll answer" />
            </td>
        </tr>
        <tr>
            <td colspan="2" width="100%">
                <hr />
            </td>
        </tr>
    </table>
</div>
