<%@ Page Language="C#" MasterPageFile="Admin.Master" AutoEventWireup="true" CodeBehind="Ordermanage.aspx.cs" Inherits="Mvcb2b.admin.Ordermanage" Title="订单管理" %>
<%@ Import Namespace="Mvcmode"%>
<%@ MasterType VirtualPath="Admin.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript" src="../Comja/val_num.js"></script>    
<script type="text/javascript">
	$(document).ready(function(){
	});
	function upstate(id)
	{
		if (confirm("确认更新付款状态，付款流程完成将不能撤销！"))
		{
		var paystate=escape($("#paystate_"+id).val());
		 $.ajax({
			   type: "POST",
			   url: "jquery/upstate.aspx",
			   dataType: "html",
			   data: { "id": "" + id+ "","paystate": "" + paystate + ""}, /*传输的参数*/
			   success: function(msg) {
				   if (msg =="ok") {
					   alert("更新成功!");	
					   window.location.href="Ordermanage.aspx";	  
				  }
				  if (msg=="have")
				  {
					  alert("该订单已付款，系统已完成授权流程，不能撤销！");
				  }
			   }, error: function(e) { alert("error-$.ajax"+e);}
		   });	
		}
	}
	function delorder(id)
	{
		if (confirm("确认删除此订单吗？"))
		{
		   $.ajax({
			   type: "POST",
			   url: "jquery/orderdel.aspx",
			   dataType: "text",
			   data: { "id": "" + id+ ""}, /*传输的参数*/
			   success: function(msg) {
				   if (msg =="ok") {
					   /*显示*/
						tr_orderid="order"+id;
					   $('#'+tr_orderid).remove();		  
				   }
			   }, error: function(html) { alert("error-$.ajax"+html); }
		   });	
		}
	}
</script>    
<div class="path">当前位置： 系统管理 >>  订单管理</div>
<h3 class="nob">订单管理 </h3>
<div class="menusearch">
    <div style="float:left;padding-left:20px;"><input type="button" value="重置搜索" onclick="javascript:window.location.href='Ordermanage.aspx';" class="submit"  /> &nbsp; 订单号码：</div>
    <div style="float:left;padding-left:0px;"><input type="text" class="key" name="key" id="key" value="<%=keyword %>" /> </div>
    <div style="float:left;padding-left:0px;">
    &nbsp;<asp:Button ID="Search1" runat="server" Text="搜索"  CssClass="submit"   onclick="Search1_Click" /> </div>
</div>
<table width="96%" border="0" align="center" cellpadding="2" style="background-color:#f5f5f5;" cellspacing="1">
          <tr style="background-color:#ffffff;font-weight:bold;">
            <td>编号</td>
            <td style="width:100px;">订单号码</td>
            <td>套餐名称</td>            
            <td style="width:80px;text-align:center">价格（元）</td>  
            <td style="width:130px;text-align:center">有效日期</td>
            <td style="width:60px;text-align:center">用户名</td>  
            <td style="width:110px;text-align:center">状态</td>
            <td style="width:50px;text-align:center">删除</td>
          </tr>
        <asp:Repeater ID="Repeater1" runat="server">
          <ItemTemplate>
          <tr style="background-color:#ffffff" id="order<%#(Container.DataItem as E_order).Id%>">
            <td><%#Eval("id")%></td>       
            <td><%#(Container.DataItem as E_order).Ordernum%></td>   
            <td><%#(Container.DataItem as E_order).Package.Pname%> <%#Statusstr2((Container.DataItem as E_order).Status)%></td>
            <td style="text-align:center"><%#(Container.DataItem as E_order).Package.Pfee%></td>
            <td style="text-align:center"><%#Fun.Totime((Container.DataItem as E_order).Package.Startdate).ToShortDateString()%> - <%#Fun.Totime((Container.DataItem as E_order).Package.Enddate).ToShortDateString()%></td>
            <td style="text-align:center"><%#Userstr((Container.DataItem as E_order).Userid)%></td>
            <td style="text-align:center">
            <select id="paystate_<%#(Container.DataItem as E_order).Id%>" name="paystate_<%#(Container.DataItem as E_order).Id%>">
            <option value="<%#(Container.DataItem as E_order).Status%>"><%#Statusstr((Container.DataItem as E_order).Status)%></option>
            <option value="0">未付款</option>
            <option value="1">已付款</option>
            </select> <span style="padding-left:2px;"><input type="button" name="up2" id="up2" onclick="upstate(<%#(Container.DataItem as E_order).Id%>);"  value="更新" /></span>
            </td>
            <td style="text-align:center"><a href="javascript:void(0);" onclick="delorder(<%#(Container.DataItem as E_order).Id%>);"><span>删除</span></a></td>
          </tr></ItemTemplate>
         </asp:Repeater>
         <asp:Literal runat="server"  ID="noms"  />
        </table> 
<div class="pagemsg" >
<table  border="0" align="center" cellpadding="0" cellspacing="0" width="90%">
          <tr><td><asp:Literal id="Message" runat="server" ></asp:Literal></td>
          </tr><tr>
          <td style="text-align:right;">&nbsp; 直接进入 <asp:textbox  id="gopage" Width="30px"   runat="server"  CssClass="gopage" > </asp:textbox> 页   <asp:button id ="Submithao"  Text="Go" runat="server" OnClick="Submithao_Click" CssClass="gopage" ></asp:button> </td>
          </tr></table>
</div>   

<p style="text-align:left;padding-left:80px;font-size:12px;line-height:20px;">? 帮助：<br />

</p>
     
</asp:Content>
