<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="OrderList.aspx.cs" Inherits="OAWeb.crm.orders.OrderList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Src="../../UserControls/OrderNav.ascx" TagName="OrderNav" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlace" runat="server">
    <!--主体左侧-->
    <table id="plc_profile" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td class="main_left">
                <uc1:OrderNav ID="OrderNav1" runat="server" />
            </td>
            <td class="main_center">
                <!--主体-->
                <div class="page_main">
                    <div class="page_content">
                        <table class="data_title" cellspacing="3">
                            <tr>
                                <td class="data_caption">
                                    <em style="float: left">
                                        <img src="/images/10.gif" />
                                    </em>订单管理<br />
                                    <span class="tip01">管理订单.您可以添加、编辑、删除订单,删除的订单可以在回收站还原</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="data_field">
                                    <%=LoadLinkOP()%>
                                    <br />
                                    <asp:DropDownList ID="ddlField" runat="server">
                                        <asp:ListItem Value="OrderSN">订单号</asp:ListItem>
                                        <asp:ListItem Value="CRM_Orders.CustomerName">客户名称</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:TextBox ID="txtKeyword" runat="server" CssClass="text_box"></asp:TextBox><asp:Button
                                        ID="btnSearch" runat="server" Text="查  询" class="btn_77px" />
                                </td>
                            </tr>
                        </table>
                        <div class="page_op">
                            <asp:Button ID="btnNewOrder" runat="server" Text="新增订单" CssClass="btn_77px" Visible="false" OnClientClick="window.location.href='OrderEdit2.aspx';return false;" />
                            <asp:Button ID="btnDelete" runat="server" Text="删除订单" CssClass="btn_77px" />
                            <asp:Button ID="btnStyle" Enabled="false" runat="server" Text="打印样式" CssClass="btn_77px" />
                            <asp:Button ID="btnMimeograph"  Enabled="false" runat="server" Text="打印订单" CssClass="btn_77px" />
                            <asp:Button ID="btnBill"  Enabled="false" runat="server" Text="单据设置" CssClass="btn_77px" />
                            <asp:Button ID="btnRecycle" runat="server" Text="回收站" CssClass="btn_77px" OnClientClick="window.location.href='OrderRecycleList.aspx';return false;" />
                            <asp:Button ID="btnTaoBao" runat="server" Text="下载订单" CssClass="btn_77px" />
                            <span style=" margin-left:30px; color:Red;" id="spState" runat="server" visible="false">
                                <asp:Label ID="lblShopName" runat="server" Text=""></asp:Label>
                            授权已经过期或者昵称设置错误，请点击<a href="/shop/shoplist.aspx">这里</a>进行修改</span>
                        </div>
                        <div class="list">
                            <asp:GridView ID="gvData" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                                GridLines="None" CellPadding="0" CssClass="table_list" EnableModelValidation="True"
                                OnRowDataBound="gvData_RowDataBound">
                                <RowStyle HorizontalAlign="Left" />
                                <Columns>
                                    <asp:TemplateField HeaderText="编号">
                                        <HeaderTemplate>
                                            <input name="chkHeader" onclick="javascript:SelectAll(this);" type="checkbox" value="chkHeader" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <input id="chkItem" type="checkbox" value="<%#Eval("Id") %>" <%#(Eval("AuditState").ToString() != "0" && Eval("AuditState").ToString() != "2") ? "disabled=disabled" : ""%> />
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" ForeColor="White"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Center" Width="10px"></ItemStyle>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="订单号">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="hypView" runat="server" Text='<%# Eval("OrderSN") %>'></asp:HyperLink>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="OrderDate" HeaderText="下单时间"></asp:BoundField>
                                    <asp:HyperLinkField DataNavigateUrlFields="CustomerId" 
                                        DataNavigateUrlFormatString="/crm/customer/CustomerView.aspx?CustomerID={0}" 
                                        DataTextField="CustomerName" HeaderText="客户名称" Target="_blank" />
                                    <asp:BoundField DataField="OrderTotal" HeaderText="订单金额" DataFormatString="￥{0:f2}">
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Distributor" HeaderText="经销商"></asp:BoundField>
                                     <asp:TemplateField HeaderText="来源">
                                        <ItemTemplate>
                                            <%# Eval("FromName") %> <%# ObjToStr(Eval("ShopName")) == "" ? "" : " ( " + Eval("ShopName")+" ) "%>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:BoundField HeaderText="交易状态" />
                                    <asp:BoundField DataField="TrackUserName" HeaderText="业务员"></asp:BoundField>
                                    <asp:TemplateField HeaderText="操作">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="hypEdit" runat="server" Text='编辑'></asp:HyperLink>
                                            <asp:LinkButton ID="lbtnDelete" runat="server">删除</asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <div class="pager-bar">
                                <webdiyer:AspNetPager ID="pager" runat="server" CssClass="anpager" currentpagebuttonclass="cpb"
                                    PageSize="20" NextPageText="下一页" LastPageText="页 尾" FirstPageText="第一页" PrevPageText="上一页"
                                    ShowBoxThreshold="10" SubmitButtonText="跳 转" UrlPaging="True">
                                </webdiyer:AspNetPager>
                            </div>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
