<%@ Page Language="C#" MasterPageFile="MasterPage.Master" AutoEventWireup="true" CodeBehind="OrderAdd.aspx.cs" Inherits="SocoShop.Web.Admin.OrderAdd" %>
<%@ Register Namespace="SkyCES.EntLib" Assembly="SkyCES.EntLib" TagPrefix="SkyCES"%>
<%@ Import Namespace="SocoShop.Business" %>
<%@ Import Namespace="SocoShop.Common" %>
<%@ Import Namespace="SocoShop.Entity" %>
<asp:Content ID="MasterContent" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
<script language="javascript" type="text/javascript" src="/Admin/js/UnlimitClass.js"></script>
<script type="text/javascript" src="/Admin/Pop/lhgdialog_ex.js"></script>	
<script language="javascript" src="/Admin/js/calendar.js" type="text/javascript"></script>
<div class="position"><img src="/Admin/Style/Images/PositionIcon.png"  alt=""/><%=title %>修改</div>
<div class="add">
    <asp:PlaceHolder ID="Shipping" runat="server" Visible="false">
	
	<ul>
		<li class="left">收货人：</li>
		<li class="right"><SkyCES:TextBox ID="Consignee" CssClass="input" runat="server" Width="400px"  CanBeNull="必填" /></li>
	</ul>
	<ul>
		<li class="left">收货地区：</li>
		<li class="right"><SkyCES:SingleUnlimitControl ID="RegionID" runat="server" /></li>
	</ul>
	<ul>
		<li class="left">收货地址：</li>
		<li class="right"><SkyCES:TextBox ID="Address" CssClass="input" runat="server" Width="400px" /></li>
	</ul>
	<ul>
		<li class="left">邮编：</li>
		<li class="right"><SkyCES:TextBox ID="ZipCode" CssClass="input" runat="server" Width="400px" /></li>
	</ul>
	<ul>
		<li class="left">联系电话：</li>
		<li class="right"><SkyCES:TextBox ID="Tel" CssClass="input" runat="server" Width="400px" /></li>
	</ul>
	<ul>
		<li class="left">Email：</li>
		<li class="right"><SkyCES:TextBox ID="Email" CssClass="input" runat="server" Width="400px" /></li>
	</ul>
	<ul>
		<li class="left">手机：</li>
		<li class="right"><SkyCES:TextBox ID="Mobile" CssClass="input" runat="server" Width="400px" /></li>
	</ul>
	<ul>
		<li class="left">配送方式：</li>
		<li class="right"><asp:DropDownList runat="server" ID="ShippingID"></asp:DropDownList></li>
	</ul>
	<asp:PlaceHolder ID="ShippingInfo" runat="server" Visible="false">
	<ul>
		<li class="left">配送日期：</li>
		<li class="right"><SkyCES:TextBox ID="ShippingDate" CssClass="input" runat="server" Width="400px" onfocus="cdr.show(this);"/></li>
	</ul>
	<ul>
		<li class="left">配送单号：</li>
		<li class="right"><SkyCES:TextBox ID="ShippingNumber" CssClass="input" runat="server" Width="400px" /></li>
	</ul>
	</asp:PlaceHolder>
	</asp:PlaceHolder>
	<asp:PlaceHolder ID="Other" runat="server" Visible="false">
	<ul>
		<li class="left">发票标题：</li>
		<li class="right"><SkyCES:TextBox ID="InvoiceTitle" CssClass="input" runat="server" Width="400px" /></li>
	</ul>
	<ul>
		<li class="left">发票内容：</li>
		<li class="right"><SkyCES:TextBox ID="InvoiceContent" CssClass="input" runat="server" Width="400px" TextMode="MultiLine" Height="40px" /></li>
	</ul>
	<ul>
		<li class="left">用户留言：</li>
		<li class="right"><asp:Label ID="UserMessage" runat="server"/></li>
	</ul>
	<ul>
		<li class="left">订单备注：</li>
		<li class="right"><SkyCES:TextBox ID="OrderNote" CssClass="input" runat="server" Width="400px" TextMode="MultiLine" Height="40px" /></li>
	</ul>
	</asp:PlaceHolder>
	<asp:PlaceHolder ID="Money" runat="server" Visible="false">
	<ul>
		<li class="left">产品金额：</li>
		<li class="right"><asp:Label ID="ProductMoney" runat="server" />  元 </li>
	</ul>
	<ul>	
		<li class="left">优惠金额：</li>
		<li class="right"><asp:Label ID="FavorableMoney" runat="server" />  元 </li>
	</ul>
	<ul>		
		<li class="left">物流费用：</li>
		<li class="right"><asp:Label ID="ShippingMoney" runat="server"/> 元 </li>
	</ul>
	<ul>	
		<li class="left">其它费用：</li>
		<li class="right"  style="line-height:25px"><SkyCES:TextBox ID="OtherMoney" CssClass="input" runat="server" CanBeNull="必填" RequiredFieldType="金额" /> 元 <br /> 后台调节订单费用项，“+”表示增加订单费用，“-”表示减去订单费用</li>
	</ul>
	<ul>		
		<li class="left">余额：</li>
		<li class="right"><SkyCES:TextBox ID="Balance" CssClass="input" runat="server" CanBeNull="必填" RequiredFieldType="金额" /> 元</li>
	</ul>
	<ul>	
		<li class="left">优惠劵：</li>
		<li class="right" style="line-height:25px"><asp:DropDownList ID="UserCoupon" runat="server" /> <br />红色表示产品金额未能达到该优惠券规定的最低金额</li>
	</ul>
	</asp:PlaceHolder>	
	<asp:PlaceHolder ID="Gift" runat="server" Visible="false">
	<ul>
		<li class="left">赠送礼品：</li>
		<li class="right" id="SelectGiftList"><%if(order.GiftID>0){%><%=GiftBLL.ReadGift(order.GiftID).Name %><input type="hidden" name="GiftID" value="<%=order.GiftID %>"/><span onclick="deleteGift()" style="cursor:pointer"><img src="style/images/delete.gif" /></span><%}%></li>
	</ul>
	<ul>
        <li class="left">选择礼品：</li>
        <li class="right"><input id="GiftName" class="input" /><input type="button" value="搜索"  onclick="searchGift()" class="button" />   
        <div id="SearchGiftList"></div></li>
    </ul>
	</asp:PlaceHolder>
</div>
<script language="javascript" type="text/javascript">
var giftID="<%=FavorableActivityBLL.ReadFavorableActivity(order.FavorableActivityID).GiftID %>";
function  searchGift(){
    var name=o("GiftName").value;
    var url = "Ajax.aspx?Action=SearchGift&Name=" + name+"&GiftID="+giftID;
    Ajax.requestURL(url, dealSearchGift);
    alertMessage("正在搜索...", 1); 
}
function dealSearchGift(data){
    closeAlertDiv();
    if(data!=""){
        var result="";
        var giftArray=data.split("#");
        for(var i=0;i<giftArray.length;i++){
            var tempArray=giftArray[i].split("|");
            result+="<span><input type=\"radio\" name=\"GiftList\" value=\""+giftArray[i]+"\" onclick=\"selectGift(this)\"> "+substring(tempArray[1],10)+" </span>";
        }
        o("SearchGiftList").innerHTML="<br />"+result;
    }
}
function selectGift(obj){
    var giftArray=obj.value.split("|");
    if(obj.checked){
        var content=giftArray[1]+"<input class=\"input\" name=\"GiftID\" type=\"hidden\" value=\""+giftArray[0]+"\"/><span onclick=\"deleteGift()\" style=\"cursor:pointer\"><img src=\"style/images/delete.gif\" /></span>";
        o("SelectGiftList").innerHTML=content; 
    }
}
function deleteGift(){
    o("SelectGiftList").innerHTML="";
}
</script>
<div class="action">
    <asp:Button CssClass="button" ID="SubmitButton" Text=" 确 定 " runat="server"  OnClick="SubmitButton_Click" />
</div>
</asp:Content>
