<%@ Page Language="C#" MasterPageFile="MasterPage.Master" AutoEventWireup="true" CodeBehind="GiftPackAdd.aspx.cs" Inherits="SocoShop.Web.Admin.GiftPackAdd" %>
<%@ Register Namespace="SkyCES.EntLib" Assembly="SkyCES.EntLib" TagPrefix="SkyCES"%>
<%@ Import Namespace="SocoShop.Entity" %>
<%@ Import Namespace="SocoShop.Common" %>
<%@ Import Namespace="SocoShop.Business" %>
<asp:Content ID="MasterContent" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
<script language="javascript" src="/Admin/js/calendar.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="/Admin/js/GiftGroupAdd.js"></script>	
<script type="text/javascript" src="/Admin/Pop/lhgdialog_ex.js"></script>	
<div class="position"><img src="/Admin/Style/Images/PositionIcon.png"  alt=""/>礼品包<%=ShopCommon.GetAddUpdate()%></div>
<div  class="listBlock">
    <ul>
        <li class="listOn" id="TitleDefault" onclick="SwitchBlock('Default')">基本设置</li>
        <li id="TitleGiftGroup" onclick="SwitchBlock('GiftGroup')">礼品组</li>
    </ul>	
</div>
<div class="line"></div>
<div class="add" id="ContentDefault">
	<ul>
		<li class="left">活动名称：</li>
		<li class="right"><SkyCES:TextBox ID="Name" CssClass="input" runat="server" Width="400px" CanBeNull="必填" /></li>
	</ul>
	<ul>
		<li class="left">图片：</li>
		<li class="right"><SkyCES:TextBox ID="Photo" CssClass="input" runat="server" Width="400px" /></li>
	</ul>
	<ul>
		<li class="left">上传图片：</li>
		<li class="right"><iframe src="UploadAdd.aspx?Control=Photo&TableID=<%=GiftPackBLL.TableID %>&FilePath=GiftPackPhoto/Original" width="400" height="30px" frameborder="0" allowTransparency="true" scrolling="no"></iframe></li>
	</ul> 
	<ul>
		<li class="left">活动时间：</li>
		<li class="right"><SkyCES:TextBox ID="StartDate" CssClass="input" runat="server" Width="140px" CanBeNull="必填" RequiredFieldType="日期时间"  onfocus="cdr.show(this);"/> 到 <SkyCES:TextBox ID="EndDate" CssClass="input" runat="server" Width="140px" CanBeNull="必填" RequiredFieldType="日期时间"  onfocus="cdr.show(this);" /></li>
	</ul>
	<ul>
		<li class="left">价格：</li>
		<li class="right"><SkyCES:TextBox ID="Price" CssClass="input" runat="server" Width="100px"  CanBeNull="必填" RequiredFieldType="金额"  Text="0"/></li>
	</ul>
</div>
<div  class="add" id="ContentGiftGroup" style="display:none">	
	<ul>
		<li class="left"></li>
		<li class="right"><input type="button" class="button" onclick="childPop('GiftGroupAdd.aspx?GiftPackID=<%=strGiftPackID %>',650,600,'增加礼品组','GiftGroupAdd')" value="增加礼品组"  style="width:80px" /></li>
	</ul>
	<div id="GiftGroup">
    <%int i = 0; if (countArray.Length > 0){for (i = 0; i < countArray.Length; i++){ %>
    <span id="GiftGroup<%=i %>" class="themeActivityBlock">
    <input type="button" class="button" onclick="childPop('GiftGroupAdd.aspx?Action=Update&ID=<%=i %>&GiftPackID=<%=strGiftPackID %>',650,600,'修改礼品组','GiftGroupAdd')" value="修改礼品组"  style="width:80px" />
    <input type="button" class="button" onclick="DeleteGiftGroup(<%=i %>)" value="删除礼品组"  style="width:80px" />
    <input name="GiftGroupValue<%=i %>" id="GiftGroupValue<%=i %>"  type="hidden"  value="<%=nameArray[i]%>|<%=countArray[i] %>|<%=productArray[i]%>"/>
	<ul>
		<li class="left">名称：</li>
		<li class="right"><%=nameArray[i]%></li>
	</ul>	
	<ul>
		<li class="left">购买数量：</li>
		<li class="right"><%=countArray[i]%></li>
	</ul>	
	<ul>
		<li class="left">商品：</li>
		<li class="right"><% string nameList = string.Empty; if (productArray[i] != string.Empty){foreach (string id in productArray[i].Split(',')){nameList += ReadProduct(productList, Convert.ToInt32(id)).Name.Replace(",", "") + ",";%>
		    <div class="giftGroupPhoto"><img  src="<%=ReadProduct(productList,Convert.ToInt32(id)).Photo%>" alt="" onload="photoLoad(this,60,60)" title="<%=ReadProduct(productList, Convert.ToInt32(id)).Name%>"/><br /><%=ReadProduct(productList, Convert.ToInt32(id)).Name%></div>
		    <%}} %>
		</li>
	</ul>
	 <input name="GiftGroupNameValue<%=i %>" id="GiftGroupNameValue<%=i %>"  type="hidden"  value="<%if (nameList != string.Empty) { ResponseHelper.Write(nameList.Substring(0, nameList.Length - 1)); }%>"/>
	</span>	
	<%}}%>
	</div>
	<input type="hidden" name="GiftGroupCount" id="GiftGroupCount" value="<%=i %>" />
</div>
<div class="action">
    <asp:Button CssClass="button" ID="SubmitButton" Text=" 确 定 " runat="server"  OnClick="SubmitButton_Click" />
</div>
</asp:Content>
