@model string
<div class="current-location">
    <ul>
        <li class="left"><i class="glyphicon glyphicon-home"></i><a href="javascript:void(0)" onclick="location.href=location.href">发件箱</a></li>
        <li class="right"><a href="javascript:void(0)" onclick="LoadData()" title="刷新"><span class="glyphicon glyphicon-refresh"></span></a></li>
    </ul>
</div>
@Html.Action("Tabhead", "MsgInbox")
<div class="main no-top-border">
    <div class="control-group clearfix">
        <div class="btn-group left">
            <button type="button" class="btn btn-default btn-sm ui-selectInvert">反选</button>
            <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown" aria-expanded="false">
                菜单<span class="caret"></span>
            </button>
            <ul class="dropdown-menu" role="menu">
                <li><a href="javascript:void(0)" class="ui-dialog" data-custom-params="title:'发信息',url:'@Url.Action("Add")',width:'900px',height:'90%'">发信息</a></li>
                <li class="divider"></li>
                <li><a href="javascript:void(0)" class="ui-deleteMultiple" data-custom-params="url:'@Url.Action("Delete")'">删除</a></li>
            </ul>
        </div>
        <div class="right form-inline form-group-sm controls">
            <input type="text" id="thedate" name="thedate" placeholder="开始日期" style="width:105px" onclick="laydate({istime:true,format:'YYYY-MM-DD'})" class="laydate-icon form-control ui-queryString">
            <input type="text" id="thedate" name="thedate" placeholder="结束日期" style="width:105px" onclick="laydate({istime:true,format:'YYYY-MM-DD'})" class="laydate-icon form-control ui-queryString">
            <select id="field" name="field" class="form-control ui-queryString ui-setName option_jj">
                <option value="uid">按收件人</option>
                <option value="title">按标题</option>
            </select>
            <input type="text" id="keyword" name="keyword" placeholder="请输入关键词" style="width:105px;" class="form-control ui-queryString ui-keyword" />
            <button type="button" class="btn btn-default btn-sm ui-queryString-search">确定</button>
            <span class="help-block"></span>
        </div>
    </div>
    <table border=0 cellpadding=0 cellspacing=0 width=100% class="table table-bordered" id="tb_list">
        <thead><tr>
            <td align="center"  style="width:40px"><input type="checkbox" title="选择" class="ui-selectInvert" data-custom-params="isReverse:false"></td>
            <td align="center">标题</td>
            <td align="center">收件人</td>
            <td align="center">时间</td>
            <td align="center">查看</td>
        </tr>
        <tr class="item" id="item_{id}">
            <td align="center"><input type="checkbox" id="id" name="id" value="{id}"></td>
            <td align=left>
                <span class='icon icon-mailopen'></span><a href="javascript:void(0)">{title}</a>
            </td>
            <td align="center" class="msg_id">{id}</td>
            <td align="center">{thedate}</td>
            <td align="center">
                <div class="btn-group btn-group-sm">
                    <a href="javascript:void(0)" class="btn btn-default btn-sm ui-dialog" data-custom-params="title:'发件内容查看',url:'@Url.Action("Edit")?id={id}&action=1',width:'900px',height:'90%'">查看</a>
                    <a href="javascript:void(0)" class="btn btn-default btn-sm ui-setField" data-custom-params="url:'@Url.Action("SetField")',ids:'{id}',setField:'is_show',setValue:'0',successMsg:'删除成功'">删除</a>
                </div>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">

    function LoadData()
    {
        var url = "@Url.Action("PageListData")"
        $("#tb_list").ListBind(url, {callBack: "LoadedInit" });

        $(function () {
            Loading();
            $(".msg_id").each(function (i) {
                var msg_id = $(this).text();
                var username = CallAjax("get", false, "@Url.Action("GetReceiverUid")", "msg_id=" + msg_id);
                $(this).text(username);
            })
            CloseLoading();
        })
    }
    LoadData();

</script>