<%@ Page language="c#" Codebehind="Shipping.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.Shipping" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
	    <!--#include file="inc/head.inc"-->
		<title>Shipping</title>
	</HEAD>
	<body>
	    <div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />
		<% if(this.Request.QueryString["Action"] == "Manage"){%>配送方式列表<%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>配送方式添加<%}%>
		</div>
		<div class="sub_container_content">
		<form id="Form1" method="post" runat="server">
		    <div class="frame">
		        <div class="frame_title"><asp:Label id="lblAction" runat="server" CssClass="tableHeaderText"></asp:Label></div>
		        <div class="frame_content">
		            <% if(this.Request.QueryString["Action"] == "Manage"){%>
			        <table class="tableBorder" cellSpacing="0" cellPadding="0" width="98%" align="center" border="0">
				        <tr>
					        <td height="23" class="forumRowHighlight">
						        <asp:datagrid id="dgShipping" runat="server" AllowPaging="False" PagerStyle-Mode="NumericPages"
							        AutoGenerateColumns="False" DataKeyField="ShippingID" Width="100%" HorizontalAlign="Center"
							        HeaderStyle-CssClass="summary-title">
							        <HeaderStyle Font-Bold="True"></HeaderStyle>
							        <Columns>
								        <asp:TemplateColumn HeaderText="序号">
									        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="30px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "ShippingID") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="配送方式名称">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Name") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="配送默认价格">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Price") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="快件查询接口">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="left" Width="400px"></ItemStyle>
									        <ItemTemplate>
										        <a href="<%# DataBinder.Eval(Container.DataItem, "QueryUrl") %>" target="_blank"><%# DataBinder.Eval(Container.DataItem, "QueryUrl") %></a>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="描述">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="left"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Description") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn>
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
									        <ItemTemplate>
										        <a href='Shipping.aspx?Action=Modify&ShippingID=<%# DataBinder.Eval(Container.DataItem, "ShippingID") %>'>
											        修改</a>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:ButtonColumn Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
									        CommandName="Delete">
									        <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
								        </asp:ButtonColumn>
							        </Columns>
							        <PagerStyle Mode="NumericPages"></PagerStyle>
						        </asp:datagrid>
					        </td>
				        </tr>
			        </table>
			        <%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>
			        <table class="tableBorder" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
				        <tr>
					        <td height="23">
						        <table class="ptable" cellspacing="0" cellpadding="0">
							        <tr>
								        <th class="tl">
									        配送方式名称：
								        </th>
								        <td class="tr">
									        <asp:TextBox id="txtName" runat="server"></asp:TextBox>
								        </td>
							        </tr>
							        <tr>
								        <th class="tl">
									        默认配送价格公式：
								        </th>
								        <td class="tr">
									        <P>
										        <asp:TextBox id="txtPrice" runat="server">0</asp:TextBox><br>
										        (如“20+(c(w/0.5)-1)*6”代表首重为20元次重为6元，单位重量为0.5千克的配送费用)<FONT face="宋体"><BR>
											        字母“w”表示订单物品总重量<BR>
											        字母“p”代表订单总金额<BR>
											        字母“q”代表订单物品总数量<br>
											        字符“c()”代表“ceiling”，指偏大取整（如c(0.4/0.5)=1）</FONT><font color="red">*Access版本不支持此函数</font></P>
								        </td>
							        </tr>
							        <tr>
								        <th class="tl">
									        快件查询接口：
								        </th>
								        <td class="tr">
									        <asp:TextBox id="txtQueryUrl" Width="400px" runat="server"></asp:TextBox>
								        </td>
							        </tr>
							        <tr>
								        <th class="tl">
									        描述：
								        </th>
								        <td class="tr">
									        <asp:TextBox id="txtDescription" runat="server" Width="350px" TextMode="MultiLine" Height="60px"></asp:TextBox>
								        </td>
							        </tr>
							        <tr>
								        <th class="tl"></th>
									    <td class="tr">    <asp:Button id="btnSave" OnClick="btnSave_Click" runat="server" Text="保存" CssClass="inputbtn"></asp:Button>
									        <asp:Button id="btnCancel" OnClick="btnCancel_Click" runat="server" Text="取消" CausesValidation="False" CssClass="inputbtn"></asp:Button></td>
							        </tr>
						        </table>
					        </td>
				        </tr>
			        </table>
			        <table class="tableBorder" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
				        <tr>
					        <th class="tableHeaderText" height="25" align="left">
						        &nbsp;&nbsp; 测试上面的公式</th>
					        <th class="tableHeaderText" align="right">
					        </th>
				        <tr>
			        </table>
			        <table class="tableBorder" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
				        <tr>
					        <td height="23">
						        <table class="ptable" cellspacing="0" cellpadding="0">
							        <tr>
								        <th class="tl">
									        订单总重量：
								        </th>
								        <td class="tr">
									        <asp:TextBox id="txtWeight" runat="server">0</asp:TextBox>
								        </td>
							        </tr>
							        <tr>
								        <th class="tl">
									        订单总价：
								        </th>
								        <td class="tr">
									        <asp:TextBox id="txtTotalPrice" runat="server">0</asp:TextBox>
								        </td>
							        </tr>
							        <tr>
								        <th class="tl">
									        订单总数量：
								        </th>
								        <td class="tr">
									        <asp:TextBox id="txtQuantity" runat="server">0</asp:TextBox>
								        </td>
							        </tr>
							        <tr>
								        <th class="tl"></th>
									    <td class="tr">    <asp:Button id="btnCount" OnClick="btnCount_Click" runat="server" Text="计算" CausesValidation="False" CssClass="inputbtn"></asp:Button></td>
							        </tr>
						        </table>
					        </td>
				        </tr>
			        </table>
			        <%}%>
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
	</body>
</HTML>
