<%@ Page Title="" Language="C#" MasterPageFile="BaseMaster.Master" CodeBehind="Home.aspx.cs" Inherits="WAP2P.Web.PC.Admin.Home" %>
<asp:Content ID="Content1" ContentPlaceHolderID="content" runat="server">
    <div class="m-home">
        <p><span><%= CurrentAdmin.Name %></span> 您上次于 <span><%= CurrentAdmin.PreLoginAt.ToDateTimeString() %></span> 在 <span><%= WAP2P.Sys.Area.GetLocationString(CurrentAdmin.PreLoginIP) %></span> 登录, IP：<span> <%= CurrentAdmin.PreLoginIP %> </span> , 如果对登录有疑问请尽快通知公司技术人员进行处理。</p>
        <dl class="alt">
            <dt><i class="iconfont g-f20">&#xe6a6;</i> 系统常规提醒</dt>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="借款申请处理"><dd>未处理的借款申请： <a href="BorrowLoan/OfflineApplyList.aspx?from=home"><% =WAP2P.BorrowLoan.OfflineApply.Find(item => item.AdminById == null).Count() %></a> 单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="资讯推广" Function="客户留言管理"><dd>未处理的会员留言： <a href="Info/GuestBookList.aspx?from=home"><% =WAP2P.Sys.GuestBook.Find(item => item.ReplyAdminId == null).Count() %></a> 条</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="会员管理" Function="会员账号管理"><dd>本月注册会员： <a href="Member/UserList.aspx?from=homeMonth"><% DateTime currentMonth = DateTime.Now.SetMonthDay(1).ClearTime(); var list = WAP2P.Member.User.Find(item => item.CreateAt >= currentMonth); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.Id)).Count() %></a> 人</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="会员管理" Function="会员账号管理"><dd>未指定客服会员： <a href="Member/UserList.aspx?from=homeService"><% var ulist = WAP2P.Member.UserAdminMapping.Find(o => o.ServiceId != 0).Select(item => item.Id).ToList(); %><%  =canViews == null ? WAP2P.Member.User.Find(item => !ulist.Contains(item.Id)).Count() :  WAP2P.Member.User.Find(item => !ulist.Contains(item.Id) && canViews.Contains(item.Id)).Count()%></a> 人</dd></ruson:PermissionSpace>
        </dl>
        <dl>
            <dt><i class="iconfont g-f20">&#xe608;</i> 会员认证审核</dt>
            <ruson:PermissionSpace runat="server" Module="会员管理" Function="会员认证管理"><dd>等待实名认证：<a href="Member/UserValidList.aspx?status=实名认证待审核"><%var list = WAP2P.Member.User.Find(item => item.RealNameValid == WAP2P.Member.User.BaseInfoValidStatus.WaitValid); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>人</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="会员管理" Function="会员基本资料管理"><dd>基本资料待审核：<a href="Member/UserInfoList.aspx?from=home"><%var list = WAP2P.Member.User.Find(item => item.UserInfoWaitValid); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>人</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="会员管理" Function="会员借款资料管理" Operate="审核"><dd>借款资料待审核：<a href="Member/BorrowInfoList.aspx?status=<% =(int)WAP2P.Member.BorrowInfo.ValidStatus.Submit %>"><%var list =WAP2P.Member.BorrowInfo.Find(item => item.Status == WAP2P.Member.BorrowInfo.ValidStatus.Submit); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>份</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="会员管理" Function="会员借款资料管理" Operate="授额"><dd>借款资料待授额：<a href="Member/BorrowInfoList.aspx?status=<% =(int)WAP2P.Member.BorrowInfo.ValidStatus.Quota %>"><%var list =WAP2P.Member.BorrowInfo.Find(item => item.Status == WAP2P.Member.BorrowInfo.ValidStatus.Quota); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>份</dd></ruson:PermissionSpace>
        </dl>
        <dl class="alt">
            <dt><i class="iconfont g-f20">&#xe688;</i> 账户异动提醒</dt>
            <ruson:PermissionSpace runat="server" Module="资金管理" Function="会员线下充值管理"><dd>等待审核的线下充值：<a href="Account/RechargeList.aspx?rechargeType=<% =(int)WAP2P.Account.Recharge.RechargeType.Offline %>&from=home"><%var list = WAP2P.Account.Recharge.Find(item => item.Type == WAP2P.Account.Recharge.RechargeType.Offline && item.Status == WAP2P.Account.Recharge.AuditingStatusType.Waiting); %><%=canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="资金管理" Function="提现申请处理"><dd>等待审核的提现申请：<a href="Account/CashApplyList.aspx?statusType=apply&from=home"><%var list = WAP2P.Account.CashApply.Find(item => item.Status == WAP2P.Account.CashApply.CashApplyStatusType.Waiting); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="资金管理" Function="提现放款处理"><dd>等待放款的提现：<a href="Account/CashApplyList.aspx?statusType=processing&from=home"><%var list = WAP2P.Account.CashApply.Find(item => item.Status == WAP2P.Account.CashApply.CashApplyStatusType.WaitPay); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="资金管理" Function="会员银行列表"><dd>等待审核的银行卡：<a href="Account/BankCardList.aspx?from=home"><% var list = WAP2P.Account.BankCard.Find(item => item.Status == WAP2P.Account.BankCard.AuditingStatus.Waiting); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>张</dd></ruson:PermissionSpace>
        </dl>
        <dl>
            <dt><i class="iconfont g-f20">&#xe692;</i> 借款发布提醒</dt>
            <ruson:PermissionSpace runat="server" Module="会员管理" Function="会员额度管理"><dd>等待审核的额度申请：<a href="Member/UserQuotaLogList.aspx?from=home"><%var list = WAP2P.Member.QuotaLog.Find(item => item.Status == WAP2P.Member.QuotaLog.ApplyStatus.Wait); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="等待初审的借款"><dd>等待初审的借款：<a href="BorrowLoan/BorrowListFirst.aspx"><%var list = WAP2P.BorrowLoan.Borrow.Find(item => item.Status == WAP2P.BorrowLoan.Borrow.BorrowStatus.发布待审核); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="等待满标审核的借款"><dd>等待满标审核的借款：<a href="BorrowLoan/BorrowListFull.aspx"><%var list = WAP2P.BorrowLoan.Borrow.Find(WAP2P.BorrowLoan.Borrow.GetDisplayStatusWhere(WAP2P.BorrowLoan.Borrow.BorrowStatusDisplay.满标待审核)); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>单</dd></ruson:PermissionSpace>
        </dl>
        <dl class="alt">
            <dt><i class="iconfont g-f20">&#xe66b;</i> 借款状态提醒</dt>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="借款明细"><dd>一天内未满的借款：<a href="BorrowLoan/BorrowListAll.aspx?borrowStatus=<% =(int)WAP2P.BorrowLoan.Borrow.BorrowStatusDisplay.投标中 %>&bidStartAt=<% =DateTime.Now.AddDays(-1).ToDateTimeString() %>&bidEndAt=<% =DateTime.Now.ToDateTimeString() %>"><% DateTime date1 = DateTime.Now.AddDays(-1); var list = WAP2P.BorrowLoan.Borrow.Find(item => item.Status == WAP2P.BorrowLoan.Borrow.BorrowStatus.发布中 && item.LoanAmount != item.BidAmountCount && DateTime.Now >= item.BidAt && DateTime.Now <= item.BidEndAt && item.BidAt >= date1); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="借款明细"><dd>三天内未满的借款：<a href="BorrowLoan/BorrowListAll.aspx?borrowStatus=<% =(int)WAP2P.BorrowLoan.Borrow.BorrowStatusDisplay.投标中 %>&bidStartAt=<% =DateTime.Now.AddDays(-3).ToDateTimeString() %>&bidEndAt=<% =DateTime.Now.AddDays(-1).ToDateTimeString() %>"><% DateTime date1 = DateTime.Now.AddDays(-1); DateTime date3 = DateTime.Now.AddDays(-3); var list = WAP2P.BorrowLoan.Borrow.Find(item => item.Status == WAP2P.BorrowLoan.Borrow.BorrowStatus.发布中 && item.LoanAmount != item.BidAmountCount && DateTime.Now >= item.BidAt && DateTime.Now <= item.BidEndAt && item.BidAt >= date3 && item.BidAt < date1); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="借款明细"><dd>五天内未满的借款：<a href="BorrowLoan/BorrowListAll.aspx?borrowStatus=<% =(int)WAP2P.BorrowLoan.Borrow.BorrowStatusDisplay.投标中 %>&bidStartAt=<% =DateTime.Now.AddDays(-5).ToDateTimeString() %>&bidEndAt=<% =DateTime.Now.AddDays(-3).ToDateTimeString() %>"><% DateTime date3 = DateTime.Now.AddDays(-3); DateTime date5 = DateTime.Now.AddDays(-5); var list = WAP2P.BorrowLoan.Borrow.Find(item => item.Status == WAP2P.BorrowLoan.Borrow.BorrowStatus.发布中 && item.LoanAmount != item.BidAmountCount && DateTime.Now >= item.BidAt && DateTime.Now <= item.BidEndAt && item.BidAt >= date5 && item.BidAt < date3); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="借款明细"><dd>超过五天未满的借款：<a href="BorrowLoan/BorrowListAll.aspx?borrowStatus=<% =(int)WAP2P.BorrowLoan.Borrow.BorrowStatusDisplay.投标中 %>&bidStartAt=&bidEndAt=<% =DateTime.Now.AddDays(-5).ToDateTimeString() %>"><% DateTime date5 = DateTime.Now.AddDays(-5); var list = WAP2P.BorrowLoan.Borrow.Find(item => item.Status == WAP2P.BorrowLoan.Borrow.BorrowStatus.发布中 && item.LoanAmount != item.BidAmountCount && DateTime.Now >= item.BidAt && DateTime.Now <= item.BidEndAt && item.BidAt < date5); %><% =canViews == null ? list.Count() : list.Where(item => canViews.Contains(item.UserId)).Count() %></a>单</dd></ruson:PermissionSpace>
        </dl>
        <dl>
            <dt><i class="iconfont g-f20">&#xe637;</i> 借款还款提醒</dt>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="还款中的借款"><dd>一天内到期的借款：<% DateTime date1 = DateTime.Now.AddDays(-1); var list = WAP2P.BorrowLoan.Repay.Find(item => item.Status == WAP2P.BorrowLoan.Repay.RepayStatus.WaitRepayment && item.ShouldRepayAt >= date1 && item.ShouldRepayAt < DateTime.Now); var ids = canViews == null ? list.GroupBy(item => item.BorrowId).Select(item => item.Key).ToList() : list.Where(item => canViews.Contains(item.UserId)).GroupBy(item => item.BorrowId).Select(item => item.Key).ToList(); %><a href="BorrowLoan/BorrowListRepay.aspx?homeFilter=<% =ids.Join() %>"><% =ids.Count %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="还款中的借款"><dd>三天内到期的借款：<% DateTime date1 = DateTime.Now.AddDays(-1); DateTime date3 = DateTime.Now.AddDays(-3); var list = WAP2P.BorrowLoan.Repay.Find(item => item.Status == WAP2P.BorrowLoan.Repay.RepayStatus.WaitRepayment && item.ShouldRepayAt >= date3 && item.ShouldRepayAt < date1); var ids = canViews == null ? list.GroupBy(item => item.BorrowId).Select(item => item.Key).ToList() : list.Where(item => canViews.Contains(item.UserId)).GroupBy(item => item.BorrowId).Select(item => item.Key).ToList(); %><a href="BorrowLoan/BorrowListRepay.aspx?homeFilter=<% =ids.Join() %>"><% =ids.Count %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="还款中的借款"><dd>五天内到期的借款：<% DateTime date3 = DateTime.Now.AddDays(-3); DateTime date5 = DateTime.Now.AddDays(-5); var list = WAP2P.BorrowLoan.Repay.Find(item => item.Status == WAP2P.BorrowLoan.Repay.RepayStatus.WaitRepayment && item.ShouldRepayAt >= date5 && item.ShouldRepayAt < date3); var ids = canViews == null ? list.GroupBy(item => item.BorrowId).Select(item => item.Key).ToList() : list.Where(item => canViews.Contains(item.UserId)).GroupBy(item => item.BorrowId).Select(item => item.Key).ToList(); %><a href="BorrowLoan/BorrowListRepay.aspx?homeFilter=<% =ids.Join() %>"><% =ids.Count %></a>单</dd></ruson:PermissionSpace>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="还款中的借款"><dd>一月内到期的借款：<% DateTime date5 = DateTime.Now.AddDays(-5); DateTime month = DateTime.Now.AddMonths(-1); var list = WAP2P.BorrowLoan.Repay.Find(item => item.Status == WAP2P.BorrowLoan.Repay.RepayStatus.WaitRepayment && item.ShouldRepayAt >= month && item.ShouldRepayAt < date5); var ids = canViews == null ? list.GroupBy(item => item.BorrowId).Select(item => item.Key).ToList() : list.Where(item => canViews.Contains(item.UserId)).GroupBy(item => item.BorrowId).Select(item => item.Key).ToList(); %><a href="BorrowLoan/BorrowListRepay.aspx?homeFilter=<% =ids.Join() %>"><% =ids.Count %></a>单</dd></ruson:PermissionSpace>
        </dl>
        <dl>
            <dt><i class="iconfont g-f20">&#xe68c;</i> 借款逾期提醒</dt>
            <ruson:PermissionSpace runat="server" Module="借贷管理" Function="逾期的借款"><dd>逾期的借款：<a href="BorrowLoan/BorrowListOverdue.aspx"><% var list = WAP2P.BorrowLoan.Repay.Find(item => item.ShouldRepayAt < DateTime.Now && item.Status == WAP2P.BorrowLoan.Repay.RepayStatus.WaitRepayment); %><% =canViews == null ? list.GroupBy(item => item.BorrowId).Count() : list.Where(item => canViews.Contains(item.UserId)).GroupBy(item => item.BorrowId).Count() %></a>单</dd></ruson:PermissionSpace>            
        </dl>
        <dl class="alt">
            <dt><i class="iconfont g-f20">&#xe61d;</i> 商城奖励提醒</dt>
            <dd>免费版不支持</dd>
        </dl>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="script" runat="server">
    <script>
        $('.m-home dl').each(function (i, n) {
            n = $(n);
            if (n.find('dd').length == 0) n.remove();
        });

        $('.m-home dl').find('a').each(function (i, n) {
            n = $(n);
            if (n.text() == '0') n.addClass('home-nonum');
        })
    </script>
</asp:Content>
