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

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Assembly="ShopNum1.Control" Namespace="ShopNum1.Control" TagPrefix="cc1" %>
<%@ Register Src="UserControl/MessageShow.ascx" TagName="MessageShow" TagPrefix="uc1" %>
<!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>Untitled Page</title>
    <style type="text/css">
        .content
        {
        }
        .content .contentHeader
        {
            background-color: #BCC7E0;
            border: solid 1px #4B66A5;
            font-weight: bold;
        }
        .content .contentMain
        {
            border-left: solid 1px #4B66A5;
            border-top: solid 0px #4B66A5;
            border-right: solid 1px #4B66A5;
            border-bottom: solid 1px #4B66A5;
        }
    </style>

    <script type="text/javascript">
    function changeTab(count,index)
    {
        for (var i = 1; i <= count; i++)
        {
          document.getElementById('current' + i).className = '';
          document.getElementById('content' + i).style.display = 'none';
        }
        document.getElementById('current' + index).className = 'current';
        document.getElementById('content' + index).style.display = 'block';
    } 
    
     function openSingleChild1()
    { 
        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('/');
           var editor = FCKeditorAPI.GetInstance('FCKeditorDetail'); 
           {
             editor.InsertHtml("<img src='" + location.href.substring(0,location.href.toLowerCase().indexOf("admin")) + k.replace("../","") + "'>");
           }
        }
     }
    //选择多图
    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); 
         //document.getElementById("img1").v 
        }
    } 
    //选择单图
   function openSingleChild()
    { 
        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("TextBoxOriginalImge").value = k.substring(lastIndex+1,strLen); 
         document.getElementById("ImageOriginalImge").src = k; 
        }
    } 
  
 //插入附件
  function openSingleAttachMent() 
  {
        var k = window.showModalDialog("AttachMent_List_Select.aspx",window,"dialogWidth:820px;status:no;dialogHeight:650px"); 
        if(k != null) {
            var oEditor = FCKeditorAPI.GetInstance("FCKeditorDetail"); 
            var content = oEditor.GetXHTML(true);
            var strs = new Array();
            strs = k.split(",");
            oEditor.SetHTML(content + "<a href='"+ strs[0] +"'>"+ strs[1] +"</a>");
        }
   }
    </script>

</head>
<body style="padding: 0; background-image: url(images/Bg_right.gif); background-repeat: repeat;">
    <link type="text/css" rel="Stylesheet" href="css/index.css" />
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div style="text-align: center;">
        <div id="header">
            <ul>
                <li id="current1" class="current"><a style="cursor: pointer;" onclick="changeTab(4,1);">
                    <asp:Label runat="server" ID="tab01" Text="基本信息" /></a></li>
                <li id="current2"><a style="cursor: pointer;" onclick="changeTab(4,2);">
                    <asp:Label runat="server" ID="tab02" Text="详细介绍" /></a></li>
                <li id="current3"><a style="cursor: pointer;" onclick="changeTab(4,3);">
                    <asp:Label runat="server" ID="tab03" Text="搜索优化" /></a></li>
                <li id="current4"><a style="cursor: pointer;" onclick="changeTab(4,4);">
                    <asp:Label runat="server" ID="tab05" Text="商品多图" /></a></li>
            </ul>
            <br style="clear: both;" />
        </div>
        <!-- **************************基本信息************************** -->
        <div id="content1" runat="server">
            <!-- 基本信息-->
            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr style="display: none">
                    <td align="right" width="20%">
                        <asp:Label ID="LabelIsReal" runat="server" Text="商品性质："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="DropDownListIsReal" runat="server" CssClass="select1">
                            <asp:ListItem Value="1">实体商品</asp:ListItem>
                            <asp:ListItem Value="0">虚拟商品</asp:ListItem>
                        </asp:DropDownList>
                        <asp:Label ID="Label9" runat="server" Text="*" ForeColor="red"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" width="20%">
                        <asp:Label ID="LabelName" runat="server" Text="商品名称："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxName" runat="server" CssClass="input1"></asp:TextBox>
                        <font color="red">
                            <asp:Label ID="Label2" runat="server" Text="*"></asp:Label></font>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidatorName" runat="server" ControlToValidate="TextBoxName"
                            Display="Dynamic" ErrorMessage="该值不能为空"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelRepertoryNumber" runat="server" Text="货号："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxRepertoryNumber" runat="server" CssClass="input1"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelProductCategoryID" runat="server" Text="商品分类："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="DropDownListProductCategoryID" runat="server" CssClass="select1">
                        </asp:DropDownList>
                        <font color="red">
                            <asp:Label ID="Label11" runat="server" Text="*"></asp:Label></font>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidatorDropDownListProductCategoryID"
                            runat="server" ControlToValidate="DropDownListProductCategoryID" Display="Dynamic"
                            ErrorMessage="该值不能为空"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelWeight" runat="server" Text="商品重量："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxWeight" MaxLength="9" runat="server" CssClass="input1">0</asp:TextBox>
                        <asp:Label ID="Label4" runat="server" Text="（克）"></asp:Label>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidatorShopPrice2" runat="server"
                            ControlToValidate="TextBoxWeight" Display="Dynamic" ErrorMessage="输入格式不正确" ValidationExpression="^[0-9]{1,7}(\.[0-9]{1,3})?$"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelRepertoryCount" runat="server" Text="库存量："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxRepertoryCount" MaxLength="9" runat="server" CssClass="input1">1</asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxRepertoryCount" runat="server"
                            ControlToValidate="TextBoxRepertoryCount" Display="Dynamic" ErrorMessage="该值不能为空"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidatorShopPrice4" runat="server"
                            ControlToValidate="TextBoxRepertoryCount" Display="Dynamic" ErrorMessage="只能输入数字"
                            ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelUnitName" runat="server" Text="计量单位："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxUnitName" runat="server" CssClass="input1"></asp:TextBox>
                      <%--  <asp:DropDownList ID="DropDownListUnitName" runat="server" CssClass="select1" AutoPostBack="True"
                            OnSelectedIndexChanged="DropDownListUnitName_SelectedIndexChanged">
                            <asp:ListItem Value="-1">-请选择-</asp:ListItem>
                        </asp:DropDownList>--%>
                        <font color="red">
                            <asp:Label ID="Label15" runat="server" Text="*"></asp:Label></font>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxUnitName" ControlToValidate="TextBoxUnitName"
                            Display="Dynamic" runat="server" ErrorMessage="该值不能为空"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelRepertoryAlertCount" runat="server" Text="库存警告数量："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxNameRepertoryAlertCount" MaxLength="9" runat="server" CssClass="input1">1</asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxNameRepertoryAlertCount"
                            runat="server" ControlToValidate="TextBoxNameRepertoryAlertCount" Display="Dynamic"
                            ErrorMessage="该值不能为空"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidatorShopPrice3" runat="server"
                            ControlToValidate="TextBoxNameRepertoryAlertCount" Display="Dynamic" ErrorMessage="输入格式不正确"
                            ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelExchangeScore" runat="server" Text="兑换积分额度："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxExchangeScore" MaxLength="9" runat="server" CssClass="input1">1</asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidatorShopPrice6" runat="server"
                            ControlToValidate="TextBoxOrderID" Display="Dynamic" ErrorMessage="只能输入数字" ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelOrderID" runat="server" Text="商品排序号："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxOrderID" MaxLength="9" runat="server" CssClass="input1"></asp:TextBox>
                        <font color="red">
                            <asp:Label ID="Label20" runat="server" Text="*"></asp:Label></font>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidatorOrderID" runat="server" ControlToValidate="TextBoxOrderID"
                            Display="Dynamic" ErrorMessage="该值不能为空"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidatorShopPrice5" runat="server"
                            ControlToValidate="TextBoxOrderID" Display="Dynamic" ErrorMessage="只能输入数字" ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelBrief" runat="server" Text="商品简单介绍："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxBrief" runat="server" Height="60px" TextMode="MultiLine"
                            Width="440px" CssClass="input1"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidatorBrief" runat="server"
                            ControlToValidate="TextBoxBrief" Display="Dynamic" ErrorMessage="简单介绍最多250个字符"
                            ValidationExpression="^[\s\S]{0,250}$"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelThumbImage" runat="server" Text="商品图片："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxOriginalImge" runat="server" CssClass="input2" MaxLength="250"></asp:TextBox>
                        <input id="ButtonSelectSingleImage" type="button" value="选择图片" onclick="openSingleChild()"
                            class="bt3" style="position: relative; top: 0px; top: 0px\9; *top: -3px; _top: -3px;" />
                        <br />
                        <img id="ImageOriginalImge" alt="" src="~/images/noImage.gif" runat="server" /><asp:RegularExpressionValidator
                            ID="RegularExpressionValidatorOriginalImge" runat="server" ControlToValidate="TextBoxOriginalImge"
                            Display="Dynamic" ErrorMessage="图片链接地址最多250个字符" ValidationExpression="^[\s\S]{0,250}$"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr style="display: none">
                    <td align="right">
                        <asp:Label ID="LabelIsOnlySaled" runat="server" Text="销售方式："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="DropDownListIsOnlySaled" runat="server" CssClass="select2">
                            <asp:ListItem Value="1">可作为商品销售和配件销售</asp:ListItem>
                            <asp:ListItem Value="0">只能作为配件销售</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelShow" runat="server" Text="前台显示选项："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:CheckBox ID="CheckBoxIsNew" runat="server" Text="新品" Checked="True" CssClass="sinput1" />
                        &nbsp;<asp:CheckBox ID="CheckBoxIsBest" runat="server" Text="精品" />
                        &nbsp;<asp:CheckBox ID="CheckBoxIsHot" runat="server" Text="热销" />
                        &nbsp;<asp:CheckBox ID="CheckBoxIsRecommend" runat="server" Text="推荐" />
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelIsSaled" runat="server" Text="保存以后："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="DropDownListIsSaled" runat="server" CssClass="select2">
                            <asp:ListItem Value="1">上架销售</asp:ListItem>
                            <asp:ListItem Value="0">放入仓库</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelMemo" runat="server" Text="商家备注："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxMemo" runat="server" Height="60px" TextMode="MultiLine" Width="440px" MaxLength ="250"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                    </td>
                    <td align="left">
                        &nbsp;
                    </td>
                </tr>
            </table>
        </div>
        <!-- **************************详细介绍************************** -->
        <div id="content2" runat="server" style="display: none;">
            <%--     <div id="content2" runat="server">--%>
            <!-- 详细介绍-->
            <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
                <tr>
                    <td width="20%">
                    </td>
                    <td align="left" height="40">
                        <input id="ButtonSelectSingleImage1" type="button" value="插入图片" onclick="openSingleChild1()"
                            class="bt3" />
                        <input id="ButtonAttachMent" type="button" value="插入附件" class="bt3" onclick="openSingleAttachMent()" />
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelDetail" runat="server" Text="详细介绍："></asp:Label>
                    </td>
                    <td align="left">
                        <FCKeditorV2:FCKeditor ID="FCKeditorDetail" runat="server" Height="400px" Width="80%">
                        </FCKeditorV2:FCKeditor>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                    </td>
                    <td align="left">
                    </td>
                </tr>
            </table>
        </div>
        <!-- **************************搜索优化************************** -->
        <div id="content3" runat="server" style="display: none;">
            <%-- <div id="content3" runat="server">--%>
            <!-- 搜索优化-->
            <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
                <tr>
                    <td align="right" width="20%">
                        <asp:Label ID="LabelTitle" runat="server" Text="详细页标题："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxTitle" runat="server" Height="60px" TextMode="MultiLine"
                            Width="440px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelDescription" runat="server" Text="详细页描述："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxDescription" runat="server" Height="60px" TextMode="MultiLine"
                            Width="440px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="LabelKeywords" runat="server" Text="详细页搜索关键字："></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="TextBoxKeywords" runat="server" Height="60px" TextMode="MultiLine"
                            Width="440px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                    </td>
                    <td align="left">
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <!-- **************************商品多图************************** -->
    <div id="content4" runat="server" style="display: none;">
        <%--    <div id="content5" runat="server">--%>
        <asp:UpdatePanel ID="UpdatePanel4" runat="server">
            <ContentTemplate>
                <!-- 商品多图 -->
                <asp:DataList ID="DataListPorductImage" runat="server" RepeatDirection="Horizontal"
                    RepeatColumns="5" Width="100%">
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td>
                                    <div>
                                        <!--暂时加上/ShopNum1,到时候用此网站的虚拟目录的名称-->
                                        <asp:Image ID="loadImg" runat="server" Height="70px" ImageUrl='<%#  GroupFly.Common.Globals.ImagePath+ Eval("OriginalImge") %>'
                                            Width="90px" />
                                        <%--<img src='container.dataitem("ImagePath")' width="90" height="70" border="0">--%>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" style="width: 90px">
                                    <input id="checkboxItem" runat="server" value='<%# Eval("Guid") %>' type="checkbox" />
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:DataList>
                <table cellpadding="4" cellspacing="3" width="100%">
                    <tr>
                        <td align="right" width="49%">
                            <asp:TextBox ID="TextBoxMultiImage" runat="server" CssClass="input2"></asp:TextBox>
                        </td>
                        <td align="left">
                            <input id="ButtonSelectImage" type="button" value="选择图片" onclick="openChild()" class="bt3" />
                            <asp:Button ID="ButtonAddMultiImage" runat="server" Text="添加" OnClick="ButtonAddMultiImage_Click"
                                CssClass="bt2" CausesValidation="false" />
                            <asp:Button ID="ButtonDeleteImage" runat="server" Text="删除" OnClick="ButtonDeleteImage_Click"
                                CausesValidation="false" CssClass="bt2" />
                        </td>
                    </tr>
                </table>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <br />
        <!-- **************************底部************************** -->
        <div style="background-color: #EEEEEE; padding-left: 20%;">
            <asp:Button ID="ButtonConfirm" runat="server" Text="确定" OnClick="ButtonConfirm_Click"
                CssClass="bt2" />
            <input id="inputReset" runat="server" type="reset" value="重置" class="bt2" />
            <a href="ScoreProduct_List.aspx">
                <img src="images/back.png" border="0" align="top" /></a>
            <uc1:MessageShow ID="MessageShow" runat="server" Visible="False" />
        </div>
    </div>
    <asp:UpdatePanel ID="updatePanelHiddenFields" runat="server">
        <ContentTemplate>
            <asp:HiddenField ID="HiddenFieldAtrributeValue0" runat="server" Value="true" />
            <asp:HiddenField ID="HiddenFieldAtrributeValue1" runat="server" Value="false" />
            <asp:HiddenField ID="HiddenFieldAtrributeValue2" runat="server" Value="false" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:HiddenField ID="hiddenFieldGuid" runat="server" Value="0" />
    </form>
</body>
</html>
