<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StandardRecord.aspx.cs" Inherits="SocoShop.Web.Admin.StandardRecord" %>
<%@ Import Namespace="SocoShop.Common" %>
<%@ Import Namespace="SocoShop.Entity" %>
<%@ Import Namespace="SocoShop.Business" %>
<ul>
    <li class="left">规格组：</li>
    <li class="right"><%foreach (StandardInfo standard in standardList){ %><input type="checkbox" name="StandardControl" value="<%=standard.ID %>" /> <input type="hidden" id="StandardInfo<%=standard.ID %>" value=" <%=standard.Name+"|"+standard.ValueList%>" /><%=standard.Name%>  <%} %> <input type="button" class="button" value="确定选择" onclick="selectStandardList()" /></li>
</ul>
<ul>
	<li class="standardTitle">商品规格 <img src="Style/Images/add.gif" style="vertical-align:bottom; cursor:pointer" title="添加" onclick="addStandardRecord()" /></li>
</ul>
<table cellpadding="0" cellspacing="0" border="0" width="100%"  class="tableList" id="standardRecordTable">
    <tr class="tableHead">
        <%if (selectStandard != string.Empty)
          {
              foreach (string temp in selectStandard.Split(','))
              { %>
        <td id="Standard_<%=temp %>"><%=StandardBLL.ReadStandardCache(Convert.ToInt32(temp)).Name%><img src="Style/Images/delete.gif" alt="删除" onclick="deleteStandard(<%=temp%>)" style="vertical-align:bottom;cursor:pointer" /></td>
        <%}
          }%> 
           
        <%if(standardType==(int)ProductStandardType.Group){ %>
        <td>产品</td>
        <%} %>           
        <td>管理<input type="hidden" id="StandardIDList" name="StandardIDList" value="<%=selectStandard %>" /></td>
    </tr>
    <% int i = 0; foreach (StandardRecordInfo standardRecord in standardRecordList){ %>
    <tr class="tableMain" id="standardRecord<%=i %>">    
         <%if (selectStandard != string.Empty)
          {
              string[] valueArray = standardRecord.ValueList.Split(',');
              string[] idArray = selectStandard.Split(',');
              for (int k = 0; k < idArray.Length;k++ )
              { %>
        <td>
            <select name="Standard<%=i %>" style="width:80px">
                <%foreach (string option in StandardBLL.ReadStandardCache(Convert.ToInt32(idArray[k])).ValueList.Split(','))
                  { %>
                <option <%if(option==valueArray[k]){%> selected="selected"<%} %> value="<%=option%>"><%=option%></option>
                <%} %>
            </select>
        </td>
        <%}
          }%>    
          
        <%if(standardType==(int)ProductStandardType.Group){ %>
        <td><span id="ProductName<%=i %>"><%=ReadProductName(productList,standardRecord.ProductID)%></span><input type="hidden" id="Product<%=i %>" name="Product" value="<%=standardRecord.ProductID %>" /> <img src="Style/Images/edit.gif" title="编辑" onclick="selectProduct(<%=i %>)" style="vertical-align:bottom;cursor:pointer" /></td>
        <%} %>   
        <td><img src="Style/Images/delete.gif" alt="删除" onclick="deleteStandardRecord(<%=i %>)" style="cursor:pointer" /></td>
    </tr>
    <%i++;} %>
   <input name="recordCount" id="recordCount" type="hidden" value="<%=i %>" />
</table>
