<%@ page language="C#" autoeventwireup="true" inherits="GroupFlyProduce_ProduceAdmin_ProduceProduct__Operat, GroupTGWeb_deploy" %>

<%@ Register Src="UserControl/MessageShow.ascx" TagName="MessageShow" TagPrefix="China315" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>

    <link rel="stylesheet" type="text/css" href="style/index.css" />

    <script type="text/javascript">
    //多图
    function openChild()
    { 
        var k = window.showModalDialog("Image_List_Select.aspx",window,"dialogWidth:820px;status:no;dialogHeight:650px"); 
        if(k != null) 
        {
               // var strLen=k.length;
               //var lastIndex=k.lastIndexOf('/');
               //document.getElementById("TextBoxMultiImage").value = k.substring(lastIndex+1,strLen);
              var imgvalue = new Array();
              imgvalue = k.split(",");
              document.getElementById("TextBoxMultiImage").value = imgvalue[0]; 
            //  document.getElementById("ImageOriginalImge").src = imgvalue[1]; 
        }
    }
    
    //单图
    function openSingleChild()
    { 
        var k = window.showModalDialog("Image_List_Select.aspx",window,"dialogWidth:820px;status:no;dialogHeight:650px"); 
        if(k != null) 
        { 
              var imgvalue = new Array();
              imgvalue = k.split(",");
              document.getElementById("TextBoxOriginalImage").value = imgvalue[0]; 
              document.getElementById("ImageOriginalImge").src = imgvalue[1]; 
        }
    } 
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="main">
        <div class="title">
            <asp:Label ID="LabelTitle" runat="server" Text="产品添加"></asp:Label></div>
        <table cellpadding="0" cellspacing="1" style="width: 100%;">
            <tr>
                <td align="right" width="20%">
                    <asp:Localize ID="LocalizeProductCategory" runat="server" Text="商品分类："></asp:Localize>
                </td>
                <td>
                    <asp:DropDownList ID="DropDownListProductCategoryID" runat="server" CssClass="allinput2">
                    </asp:DropDownList>
                    <asp:Label ID="Label6" runat="server" ForeColor="red" Text="*"></asp:Label>
                    <asp:CompareValidator ID="CompareDropDownListFatherCateGory" runat="server" ControlToValidate="DropDownListProductCategoryID"
                        Display="Dynamic" ErrorMessage="该值必需选择" Operator="NotEqual" ValueToCompare="-1"></asp:CompareValidator>
                </td>
            </tr>
            <tr>
                <td align="right" width="20%">
                    <asp:Localize ID="LocalizeName" runat="server" Text="商品名称："></asp:Localize>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxName" runat="server" CssClass="allinput2"></asp:TextBox>
                    <asp:Label ID="Label1" runat="server" ForeColor="red" Text="*"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxName" runat="server"
                        ControlToValidate="TextBoxName" ErrorMessage="该值不能为空 "></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxName" runat="server"
                        ControlToValidate="TextBoxName" Display="Dynamic" ErrorMessage="最多50个字符" ValidationExpression="^[\s\S]{0,50}$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <%-- <tr>
                <td align="right">
                   <asp:Localize ID="LocalizeRepertoryCount" runat="server" Text="初始库存："></asp:Localize>  </td>
                <td >
                    <asp:TextBox ID="TextBoxRepertoryCount" runat="server" CssClass="allinput1"></asp:TextBox>                    
                    <asp:Label ID="Label7" runat="server" ForeColor="red" Text="*"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxRepertoryCount" 
                        runat="server" ControlToValidate="TextBoxRepertoryCount" ErrorMessage="该值不能为空 "></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxRepertoryCount" 
                        runat="server" ControlToValidate="TextBoxRepertoryCount" Display="Dynamic" 
                        ErrorMessage="最多50个字符" ValidationExpression="^[\s\S]{0,50}$"></asp:RegularExpressionValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxRepertoryCount1" 
                        runat="server" ControlToValidate="TextBoxRepertoryCount" Display="Dynamic" 
                        ErrorMessage="只能输入数字" ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                    </td>
            </tr>--%>
            <tr>
                <td align="right" width="20%">
                    <asp:Localize ID="LocalizeShopPrice" runat="server" Text="售价："></asp:Localize>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxShopPrice" runat="server" CssClass="allinput2"></asp:TextBox>
                    <asp:Label ID="Label11" runat="server" ForeColor="red" Text="*"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxShopPrice" runat="server"
                        ControlToValidate="TextBoxShopPrice" ErrorMessage="该值不能为空 " Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxShopPrice" runat="server"
                        ControlToValidate="TextBoxShopPrice" Display="Dynamic" ErrorMessage="价格格式不正确"
                        ValidationExpression="^[0-9]+(.[0-9]{1,3})?$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td align="right" width="20%">
                    <asp:Localize ID="LocalizeUnitName" runat="server" Text="计量单位："></asp:Localize>
                </td>
                <td>
                    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                        <ContentTemplate>
                            <asp:TextBox ID="TextBoxUnitName" runat="server" CssClass="allinput2"></asp:TextBox>
                            <asp:Label ID="Label15" runat="server" ForeColor="red" Text="*"></asp:Label>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxUnitName" runat="server"
                                ControlToValidate="TextBoxUnitName" ErrorMessage="该值不能为空 " Display="Dynamic"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxName1" runat="server"
                                ControlToValidate="TextBoxUnitName" Display="Dynamic" ErrorMessage="最多10个字符"
                                ValidationExpression="^[\s\S]{0,10}$"></asp:RegularExpressionValidator>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <%--  <tr>
                <td align="right" >
                   <asp:Localize ID="LocalizeRepertoryNumber" runat="server" Text="库存编号："></asp:Localize></td>
                <td>
                    <asp:TextBox ID="TextBoxRepertoryNumber" runat="server" CssClass="allinput1"></asp:TextBox>
                    <asp:Label ID="Label8" runat="server" ForeColor="red" Text="*"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxRepertoryNumber" 
                        runat="server" ControlToValidate="TextBoxRepertoryNumber" 
                        ErrorMessage="该值不能为空 "></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxUnitName" 
                        runat="server" ControlToValidate="TextBoxUnitName" Display="Dynamic" 
                        ErrorMessage="最多50个字符" ValidationExpression="^[\s\S]{0,50}$"></asp:RegularExpressionValidator>
                    </td>
            </tr> --%>
            <%-- <tr>
                <td  align="right">
                   <asp:Localize ID="LocalizeWeight" runat="server" Text="商品重量："></asp:Localize></td>
                <td >
                    <asp:TextBox ID="TextBoxWeight" runat="server" CssClass="allinput1"></asp:TextBox>
                    <asp:Label ID="Label9" runat="server" ForeColor="red" Text="*"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxWeight" 
                        runat="server" ControlToValidate="TextBoxWeight" ErrorMessage="该值不能为空 "></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxWeight" 
                        runat="server" ControlToValidate="TextBoxWeight" Display="Dynamic" 
                        ErrorMessage="只能输入数字" ValidationExpression="^[0-9]+(.[0-9]{1,3})?$"></asp:RegularExpressionValidator>
                    </td>
            </tr>--%>
            <tr>
                <td align="right" width="20%">
                    <asp:Localize ID="LocalizeOrderID" runat="server" Text="商品排序："></asp:Localize>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxOrderID" runat="server" CssClass="allinput2"></asp:TextBox>
                    <asp:Label ID="Label10" runat="server" ForeColor="red" Text="*"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxOrderID" runat="server"
                        ControlToValidate="TextBoxOrderID" ErrorMessage="该值不能为空 "></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxOrderID" runat="server"
                        ControlToValidate="TextBoxOrderID" Display="Dynamic" ErrorMessage="只能输入数字" ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <%--  <tr>
                <td align="right" >
                   <asp:Localize ID="LocalizeReferCount" runat="server" Text="浏览量："></asp:Localize></td>
                <td >
                    <asp:TextBox ID="TextBoxReferCount" runat="server" CssClass="allinput1">0</asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxReferCount" 
                        runat="server" ControlToValidate="TextBoxReferCount" Display="Dynamic" 
                        ErrorMessage="只能输入数字" ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxReferCount" 
                        runat="server" ControlToValidate="TextBoxReferCount" 
                        ErrorMessage="该值不能为空 "></asp:RequiredFieldValidator>
                </td>
            </tr>--%>
            <tr>
                <td align="right" width="20%">
                    <asp:Localize ID="LocalizeIsSaled" runat="server" Text="商品状态："></asp:Localize>
                </td>
                <td>
                    <asp:DropDownList ID="DropDownListIsSaled" runat="server" CssClass="allinput2">
                    </asp:DropDownList>
                    <asp:Label ID="Label14" runat="server" ForeColor="red" Text="*"></asp:Label>
                    <asp:CompareValidator ID="CompareDropDownListIsSaled" runat="server" ControlToValidate="DropDownListIsSaled"
                        Display="Dynamic" ErrorMessage="该值必需选择" Operator="NotEqual" ValueToCompare="-1"></asp:CompareValidator>
                </td>
            </tr>
            <tr>
                <td align="right" valign="top" width="20%">
                    <asp:Localize ID="Localize1SimpleDescription" runat="server" Text=""></asp:Localize>
                    商品简介：
                </td>
                <td valign="top">
                    <asp:TextBox ID="TextBoxSimpleDescription" runat="server" TextMode="MultiLine" CssClass="allinput1"></asp:TextBox>
                    <asp:Label ID="Label12" runat="server" ForeColor="red" Text="*"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxSimpleDescription" runat="server"
                        ControlToValidate="TextBoxSimpleDescription" ErrorMessage="该值不能为空 "></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxSimpleDescription"
                        runat="server" ControlToValidate="TextBoxSimpleDescription" Display="Dynamic"
                        ErrorMessage="最多50个字符" ValidationExpression="^[\s\S]{0,50}$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Localize ID="LocalizeDetailsDescription" runat="server" Text="商品详细："></asp:Localize>
                </td>
                <td valign="top">
                    <asp:TextBox ID="TextBoxDetailsDescription" runat="server" TextMode="MultiLine" CssClass="allinput1"></asp:TextBox>
                    <asp:Label ID="Label13" runat="server" ForeColor="red" Text="*"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxDetailsDescription"
                        runat="server" ControlToValidate="TextBoxDetailsDescription" ErrorMessage="该值不能为空 "></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Localize ID="LocalizeKeywords" runat="server" Text="商品关键字："></asp:Localize>
                </td>
                <td valign="top">
                    <asp:TextBox ID="TextBoxKeywords" runat="server" CssClass="allinput2" Width="300px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Localize ID="LocalizeProductDescription" runat="server" Text="商品描述："></asp:Localize>
                </td>
                <td valign="top">
                    <asp:TextBox ID="TextBoxProductDescription" runat="server" TextMode="MultiLine" CssClass="allinput1"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" valign="bottom">
                    <asp:Localize ID="LocalizeSingleImage" runat="server" Text="商品图片："></asp:Localize>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxOriginalImage" runat="server" CssClass="allinput2"></asp:TextBox>
                    <input id="ButtonSelectSingleImage" type="button" value="选择图片" onclick="openSingleChild()"
                        class="bt3 cancel" />
                    <img id="ImageOriginalImge" runat="server" alt="" src="~/ProduceAdmin/images/noImage.gif"
                        width="100" height="60" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Localize ID="LocalizeProductImage" runat="server" Text="商品多图："></asp:Localize>
                </td>
                <td>
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:DataList ID="DataListPorductImage" runat="server" RepeatDirection="Horizontal">
                                <ItemTemplate>
                                    <table cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td style="width: 90px; text-align: center;">
                                                <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("OriginalImge","{0}") %>'
                                                    Height="70px" Width="90px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center">
                                                <input id="checkboxItem" runat="server" value='<%# Eval("Guid") %>' type="checkbox" />
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:DataList>
                            <asp:TextBox ID="TextBoxMultiImage" runat="server" CssClass="allinput2"></asp:TextBox>
                            <input id="ButtonSelectImage" type="button" value="选择图片" onclick="openChild()" class="bt3 cancel" />
                            <asp:Button ID="ButtonPicAdd" runat="server" Text="添加" CausesValidation="false" CssClass="bnt1 cancel"
                                OnClick="ButtonPicAdd_Click" />
                            <asp:Button ID="ButtonPicDel" runat="server" Text="删除" CausesValidation="false" CssClass="bnt1 cancel"
                                OnClick="ButtonPicDel_Click" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr style="background-color: rgb(238, 238, 238);">
                <td align="right">
                </td>
                <td>
                    <div class="bottomLine">
                        <asp:Button ID="ButtonConfirm" runat="server" Text="确定" CssClass="bnt1" OnClick="ButtonConfirm_Click"
                            ToolTip="Submit" />
                        <asp:Button ID="ButtonReset" runat="server" Text="重置" CssClass="bnt1 cancel" />
                        <asp:Button ID="Button1" runat="server" CssClass="bt3 cancel" CausesValidation="false"
                            PostBackUrl="ProduceProduct_List.aspx" Text="返回列表" />
                        <China315:MessageShow ID="MessageShow" Visible="false" runat="server" />
                        <br />
                        <asp:HiddenField ID="hiddenFieldGuid" runat="server" Value="0" />
                    </div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
