<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!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>
    <link href="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Content/Site.css" rel="stylesheet"
        type="text/css" />
    <script src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/jquery-1.4.1-vsdoc.js"
        type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            iframeAutoFit();
        });

        function iframeAutoFit() {
            try {
                if (window != parent) {
                    var a = parent.document.getElementsByTagName("IFRAME");
                    for (var i = 0; i < a.length; i++) {
                        if (a[i].contentWindow == window) {
                            var h1 = 0, h2 = 0, d = document, dd = d.documentElement;
                            a[i].parentNode.style.height = a[i].offsetHeight + "px";
                            a[i].style.height = "10px";
                            if (dd && dd.scrollHeight) {
                                h1 = dd.scrollHeight;
                            }
                            if (d.body) {
                                h2 = d.body.scrollHeight;
                            }
                            var h = Math.max(h1, h2);
                            if (document.all) {
                                h += 0;
                            }
                            if (window.opera) {
                                h += 0;
                            }
                            a[i].style.height = a[i].parentNode.style.height = h + "px";
                        }
                    }
                }
            } catch (ex) { }
        }
    </script>
    <style type="text/css">
        body
        {
            background-image: none;
            font-size: 12px;
            margin-top: 0px;
        }
    </style>
</head>
<body>
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td class="td01" width="15%" align="center">
                日期
            </td>
            <td class="td01" width="85%" align="center">
                安排
            </td>
        </tr>
    <%
        Dictionary<DateTime, List<System.Data.DataRow>> di = ViewData["Dict"] as Dictionary<DateTime, List<System.Data.DataRow>>;
        foreach (DateTime dt in di.Keys)
        {   
    %>
        <tr>
            <td class="td03" align="center" valign="top">
                <%=dt.ToShortDateString()%>
            </td>
            <td class="td03" align="left" style="padding-left:10px; padding-right:10px;">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <%
            List<System.Data.DataRow> li = di[dt];
            if (li.Count > 0)
            {
                foreach (System.Data.DataRow dr in li)
                {
                    string type = dr["Type"].ToString();
                    string mmiSysState = dr["MmiSysState"].ToString();
                    string message = "";
                    if (type == "预约")
                    {
                        if (mmiSysState == "确认")
                        {
                            message = "与来自 " + Server.HtmlEncode(dr["PsnComName"].ToString()) + " 的 " + Server.HtmlEncode(dr["PsnName"].ToString()) + " 有预约";
                            //message += " 见面地点：" + Server.HtmlEncode(dr["MmiInviteArea"].ToString());
                            //message += " <a href='" + FamousFurnitureExpo.Models.Helper.VRoot + "/Exhibitor/MeetingInitiateShow/" + dr["MmiID"] + "' target='_parent'>查看</a>";
                        }
                        if (mmiSysState == "申请")
                        {
                            message = "您向来自 " + Server.HtmlEncode(dr["PsnComName"].ToString()) + " 的 " + Server.HtmlEncode(dr["PsnName"].ToString()) + " 提出预约申请";
                            //message += " 见面地点：" + Server.HtmlEncode(dr["MmiInviteArea"].ToString());
                            //message += " <a href='" + FamousFurnitureExpo.Models.Helper.VRoot + "/Exhibitor/MeetingInitiateShow/" + dr["MmiID"] + "' target='_parent'>查看</a>";
                        }
                    }
                    if (type == "被预约")
                    {
                        message = "接受了来自 " + Server.HtmlEncode(dr["PsnComName"].ToString()) + " 的 " + Server.HtmlEncode(dr["PsnName"].ToString()) + " 的预约";
                        //message += " 见面地点：" + Server.HtmlEncode(dr["MmiInviteArea"].ToString());
                        //message += " <a href='" + FamousFurnitureExpo.Models.Helper.VRoot + "/Exhibitor/MeetingReceiveShow/" + dr["MmiID"] + "' target='_parent'>查看</a>";
                    }

                    string bTime = dr["BTime"].ToString();
                    bTime = bTime.Length > 5 ? bTime.Substring(0, 5) : bTime;
    %>
                    <tr>
                        <td width="10%" align="left">
                            <%=bTime %>
                        </td>
                        <td width="90%" align="left">
                            <%=message %>
                        </td>
                    </tr>
    <%     
                }
            }
            else
            {
                Response.Write("<tr><td>没有日程安排</td></tr>");
            }
    %>              
                </table>
            </td>
        </tr>
    <%
        }
    %>
    </table>
</body>
</html>
