<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.ProductSpecificationsControl"
    CodeBehind="ProductSpecifications.ascx.cs" %>
<%@ Register TagPrefix="nopCommerce" TagName="NumericTextBox" Src="NumericTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="SimpleTextBox" Src="SimpleTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="ToolTipLabel" Src="ToolTipLabelControl.ascx" %>
<asp:GridView ID="gvProductSpecificationAttributes" runat="server" AutoGenerateColumns="false"
    DataKeyNames="ProductSpecificationAttributeID" OnRowDeleting="gvProductSpecificationAttributes_RowDeleting"
    OnRowDataBound="gvProductSpecificationAttributes_RowDataBound" OnRowCommand="gvProductSpecificationAttributes_RowCommand"
    Width="100%">
    <Columns>
        <asp:TemplateField HeaderText="Attribute" ItemStyle-Width="30%">
            <ItemTemplate>
                <asp:DropDownList ID="ddlSpecificationAttribute" runat="server" />
                <asp:HiddenField ID="hfProductSpecificationAttributeID" runat="server" Value='<%# Eval("ProductSpecificationAttributeID") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Value" ItemStyle-Width="30%">
            <ItemTemplate>
                <nopCommerce:SimpleTextBox ID="txtProductSpecificationAttributeValue" runat="server"
                    Text='<%# Eval("AttributeValue") %>' ValidationGroup="ProductSpecification" ErrorMessage="Attribute value is required" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Display order" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <nopCommerce:NumericTextBox runat="server" CssClass="adminInput" Width="50px" ID="txtProductSpecificationAttributeDisplayOrder"
                    Value='<%# Eval("DisplayOrder") %>' RequiredErrorMessage="Display order is required"
                    RangeErrorMessage="The value must be from -99999 to 99999" ValidationGroup="ProductSpecification"
                    MinimumValue="-99999" MaximumValue="99999"></nopCommerce:NumericTextBox>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Update" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="15%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Button ID="btnUpdate" runat="server" CssClass="adminButton" Text="Update" ValidationGroup="ProductSpecification"
                    CommandName="UpdateProductSpecificationAttribute" ToolTip="Update specification attribute" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Delete" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="15%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Button ID="btnDeleteProductSpecificationAttribute" runat="server" CssClass="adminButton"
                    Text="Delete" CausesValidation="false" CommandName="Delete" ToolTip="Delete specification attribute" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<p>
    <strong>Add a new product specification attribute</strong>
</p>
<table class="adminContent">
    <td class="adminTitle">
        <nopCommerce:ToolTipLabel runat="server" ID="lblAttributeType" Text="Select specification attribute:"
            ToolTip="Choose a product specification attribute. You can manage specification attributes from Catalog : Attributes : Product Specification."
            ToolTipImage="~/Administration/Common/ico-help.gif" />
    </td>
    <td class="adminData">
        <asp:DropDownList class="text" ID="ddlNewProductSpecificationAttribute" AutoPostBack="False"
            CssClass="adminInput" runat="server">
        </asp:DropDownList>
    </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblAttributeValue" Text="Attribute value:"
                ToolTip="The value of the specification attribute." ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <nopCommerce:SimpleTextBox ID="txtNewProductSpecificationAttributeValue" runat="server"
                ValidationGroup="NewProductSpecification" ErrorMessage="Attribute value is required" />
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblDisplayOrder" Text="Display order:"
                ToolTip="The display order of the specification attribute. 1 represents the top of the list."
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <nopCommerce:NumericTextBox runat="server" CssClass="adminInput" ID="txtNewProductSpecificationAttributeDisplayOrder"
                Value="1" RequiredErrorMessage="Display order is required" RangeErrorMessage="The value must be from -99999 to 99999"
                MinimumValue="-99999" MaximumValue="99999" ValidationGroup="NewProductSpecification">
            </nopCommerce:NumericTextBox>
        </td>
    </tr>
    <tr>
        <td colspan="2" align="left">
            <asp:Button runat="server" ID="btnNewProductSpecification" CssClass="adminButton"
                Text="Add attribute" ValidationGroup="NewProductSpecification" OnClick="btnNewProductSpecification_Click"
                ToolTip="Add specification attribute" />
        </td>
    </tr>
</table>
