<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="bxorderlist.aspx.cs" Inherits="QiZhanBang.Web.backend.bxorderlist" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>保险订单管理</title>
<link href="images/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body { padding:10px }
-->
</style>
<script language="javascript" type="text/javascript">
    function SelectAll(theBox) {
        var elm = document.Form1.elements;
        for (i = 0; i < elm.length; i++)
            if (elm[i].type == "checkbox" && elm[i].id != theBox.id) {
                elm[i].checked = theBox.checked;
            }
    }

    function CheckDeleteHandle(btn) {
        var elm = document.Form1.elements;
        var flag = false;
        for (i = 0; i < elm.length; i++)
            if (elm[i].type == "checkbox") {
                if (elm[i].checked) {
                    flag = true;
                    break;
                }
            }

        if (flag) {
            return confirm('是否要删除选择的订单？');
        }
        else {
            alert("你没有选择任何订单，请选择！");
            return false;
        }
    }
</script>
</head>
<body>
<form id="Form1" runat="server">
<h3 class="boxtitle">后台管理 &gt;&gt; 保险订单管理</h3>
<table height="0" border="0" cellpadding="0" cellspacing="1" class="tabBgColor">
<tr align="center">
  <td height="25" background="Images/Top.gif">
  关键词：<asp:TextBox runat="server" ID="txtSearchKeyword" />
  <asp:Button runat="server" ID="btnSearch" Text="搜索" onclick="btnSearch_Click" /> (可以搜索车主姓名，电话)
  </td>
</tr>
<tr>
  <td height="25" background="Images/Top.gif">
  <a href="bxorderlist.aspx?status=1">未处理订单</a> | <a href="bxorderlist.aspx?status=2">已处理订单</a> | <a href="bxorderlist.aspx?status=3">已送积分订单</a>
  </td>
</tr>
</table>
  <asp:DataGrid runat="server" ID="dgOrderList" AutoGenerateColumns="false" 
            BorderWidth="1" HorizontalAlign="Center" CellPadding="3" CellSpacing="1" 
            CssClass="boxtd" HeaderStyle-CssClass="title_bg" 
            FooterStyle-BackColor="#ffffff" 
    FooterStyle-HorizontalAlign="Center" FooterStyle-Height="33"
            UseAccessibleHeader="true" ShowFooter="false" ShowHeader="true" 
            DataKeyField="orderid" AllowPaging="True" 
    onitemcommand="dgOrderList_ItemCommand" onitemcreated="dgOrderList_ItemCreated" 
    onpageindexchanged="dgOrderList_PageIndexChanged">
<FooterStyle HorizontalAlign="Center" BackColor="White" Height="33px"></FooterStyle>
      <PagerStyle Mode="NumericPages" />
     <Columns>
        <asp:TemplateColumn HeaderText="选择" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <asp:CheckBox runat="server" ID="chkIsSelect" CssClass="input" />
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="车主姓名" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <%# DataBinder.Eval(Container.DataItem, "ownername")%>
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="联系电话" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <%# DataBinder.Eval(Container.DataItem, "tel")%>
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="下单时间" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <%# DataBinder.Eval(Container.DataItem, "createtime")%>
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="订单状态" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <%# DataBinder.Eval(Container.DataItem, "dealstatus").ToString() == "1" ? "未处理" : "已处理"%>
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="积分情况" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <%# DataBinder.Eval(Container.DataItem, "bxjbnum").ToString() == "0" ? "未送积分" : "已送积分：" + DataBinder.Eval(Container.DataItem, "bxjbnum").ToString()%>
              <%# DataBinder.Eval(Container.DataItem, "sjjbnum").ToString() == "0" ? "" : "<br />(送上级积分：" + DataBinder.Eval(Container.DataItem, "sjjbnum").ToString() + ")"%>
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="操作" ItemStyle-HorizontalAlign="Center">
             <ItemTemplate>
                <a href="bxorderdetail.aspx?orderid=<%# DataBinder.Eval(Container.DataItem, "orderid")%>">订单详情</a> | 
                <asp:LinkButton runat="server" ID="lnkDeal" CommandArgument="DealOrder" Text="设已处理"  /> | 
                <asp:LinkButton runat="server" ID="lnkDel" CommandArgument="DelOrder" Text="删除"  />
             </ItemTemplate>
        </asp:TemplateColumn>
     </Columns>

<HeaderStyle CssClass="title_bg"></HeaderStyle>
  </asp:DataGrid> 
</form>
</body>
</html>