@model Com._9pm2.ClientWeb.Models.OrderList
@{
    ViewBag.Title = "客户订单回收站";
}

<script src="~/Scripts/ordercommon.js?vn=20180813"></script>
<script src="../../Scripts/orderrecycle.js?vn=20180813"></script>

<div class="callout callout-success lead ">提示：客户订单彻底删除后将无法恢复</div>

 
<div class="list">
    <div>        
        @{
            Com._9pm2.ClientWeb.Models.LoginUser user = Session["LoginUser"] as Com._9pm2.ClientWeb.Models.LoginUser;
        }

        <button type="button" class="btn btn-primary" id="btnRestore" onclick="btnRestore()">还原</button>

        @if (user.PermissionList.Contains(Com._9pm2.ClientWeb.Common.PT_PermissionType.P1_客户订单_订单删除))
        {            
            <button type="button" class="btn btn-danger" id="btnDelete" onclick="btnDelete()">彻底删除</button>
        }        
    </div>

    <div class="error-msg"></div>
    <table id="tOrder">
        <thead>
            <tr>
                <th style="width: 30px">
                    <input type="checkbox" id="chkAll" onclick="SelectAll();" />
                </th>
                <th style="width: 125px">
                    编号
                </th>
                <th style="width: 100px">
                    日期
                </th>
                <th style="width: 150px">
                    客户
                </th>
                 
                <th>
                    订单名
                </th>
               
                <th style="width: 80px">
                    金额
                </th>
                <th style="width: 80px">
                    支付状态
                </th>
                <th style="width: 80px">
                    订单状态
                </th>

            </tr>
        </thead>
        <tbody id="orderList">
            @foreach (var item in Model.Orders)
            {
                <tr id="@item.OrderNo">
                    <td style="text-align: center">
                        <input type="checkbox" onclick="SelectOne();" />
                    </td>
                    <td>                        
                            @Html.DisplayFor(modelItem => item.OrderNo)
                         
                    </td>
                    <td>

                        @item.TransactionDate.ToString("yyyy-MM-dd")
                    </td>

                    <td>
                        @Html.DisplayFor(modelItem => item.CustomerShortName)
                      
                    </td>                    
                    <td>
                        @Html.DisplayFor(modelItem => item.OrderName)
                    </td>                   
                    <td>@item.Amount</td>

                    <td>
                        @Html.DisplayFor(modelItem => item.StatusDescription)
                    </td>

                    <td>
                        @Html.DisplayFor(modelItem => item.PaymentStatusDescription) 
                    </td>

                </tr>
            }
        </tbody>
    </table>
    @Html.Pager("Recycle", "Order", Model.RouterDirectory, Model.PagerConfig, "pagerDiv", "pagerDiv", 8, true, false, true, true, false)
</div>

@Html.Partial("OrderDetail", Session["LoginUser"] as Com._9pm2.ClientWeb.Models.LoginUser)
<input type="hidden" id="OrderNo" />