<%@ control language="C#" autoeventwireup="true" inherits="UserControl_SelectGoodsList, ShopWe" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<script type="text/javascript">
function AddGoods(Guid,Name,Number)
{
   var largess=document.getElementById("GoodsDiv");
   var ObjID=generateMixed(10);
   largess.innerHTML+="<li id=\"Row"+ObjID+"\"><input name=\"InputGoodsGuid\" type=\"hidden\" value="+Guid+" /><img src=\"../Themes/Default/Images/wk_img.gif\" alt=\"Image\"/>"+Name+"&nbsp;&nbsp;&nbsp;&nbsp;"+Number+"&nbsp;&nbsp;&nbsp;&nbsp;"+
                      "<img src=\"../Themes/Default/Images/del_imgred.gif\" alt=\"删除\" /> <a href=\"#\" class=\"grey\" onclick='DeleteSelectGoods(\"Row"+ObjID+"\")'>删除</a></li>";
}
function DeleteSelectGoods(ObjID)
{
   var Row= document.getElementById(ObjID);
   Row.parentNode.removeChild(Row);   //删除
   //document.getElementById("fileDiv").removeChild(document.getElementById("file" + obj));
}
</script>

<div class="come_title_3">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <h2>
                    待选择商品</h2>
            </td>
            <td>
                <div class="title_help">
                    <a href="http://www.shopwe.cn/bbs/" target="_blank">
                        <img src="../Themes/Default/Images/help_1.jpg" alt="shopwe论坛" width="50" height="20" /></a>
                    <a href="http://help.shopwe.cn/video/AddGoods/AddGoods.htm" target="_blank">
                        <img src="../Themes/Default/Images/video_help.jpg" alt="shopwe视频教程" width="50" height="20" /></a>
                    <a href="http://help.shopwe.cn/help/Show.asp?id=46" target="_blank">
                        <img src="../Themes/Default/Images/help.jpg" alt="shopwe帮助中心" width="50" height="20" /></a></div>
            </td>
        </tr>
    </table>
</div>
<asp:UpdatePanel ID="UpdatePanelPage" runat="server">
    <ContentTemplate>
        <asp:Repeater ID="RepeaterTable" runat="server">
            <HeaderTemplate>
                <div class="k_all7">
                    <div class="ys_bf_bj">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
            </HeaderTemplate>
            <ItemTemplate>
                <div class="come_all54">
                    <div class="come_img54">
                        <asp:Image ID="GoodsImage" runat="server" Width="54px" Height="54px" ImageUrl='<%# GetGoodsImage(new Guid(Eval("GoodsGuid").ToString())) %>' />
                    </div>
                    <p>
                        <%# Eval("GoodsName")%>
                    </p>
                    <p>
                        <img src="../css/images/add_img.gif" alt="添加相关商品" /><a href="javascript:AddGoods('<%# Eval("GoodsGuid") %>','<%# Eval("GoodsName")%>','<%# Eval("GoodsNumber") %>');HideDiv('AnalogyTip');"
                            class="blue">添加</a>
                    </p>
                </div>
            </ItemTemplate>
            <FooterTemplate>
                </td> </tr> </table> </div> </div>
            </FooterTemplate>
        </asp:Repeater>
        <div class="k_all6">
            <div class="bk2_line">
                <div class="txte">
                    <asp:DropDownList ID="SelectGoodsClass" runat="server" AutoPostBack="True" OnSelectedIndexChanged="SelectGoodsClass_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:Literal ID="GoodsCount" runat="server"></asp:Literal>
                </div>
                <div class="yahoo2">
                    <webdiyer:AspNetPager ID="AspNetPagerGoods" runat="server" OnPageChanged="AspNetPagerGoods_PageChanged"
                        PageSize="8" CssClass="yahoo2">
                    </webdiyer:AspNetPager>
                </div>
            </div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
<div class="come_title">
    <h2>
        已经添加的商品</h2>
</div>
<div class="k_all6">
    <asp:Panel ID="PanelAnalogy" runat="server">
        <div class="ys_bf_eeor" id="AnalogyTip">
            <table>
                <tr>
                    <td align="center" style="height: 30px">
                        您好，你还未添加相关商品。</td>
                </tr>
            </table>
        </div>
    </asp:Panel>
    <div class="din">
        <ul id="GoodsDiv">
            <asp:Literal ID="SelectGoodsDiv" runat="server"></asp:Literal>
        </ul>
    </div>
</div>
