<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ExhibitorMaster.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/DynaForm.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#CurrentPosition").html("本届观众列表");
            $("#menu64").css("visibility", "visible");
        });

        function Sub() {
            $("#f1").submit();
        }

        var dynaform;
        function AddMatch(id) {
            dynaform = new DynaForm({
                id: "dynaform",
                title: "新增预约",
                src: "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/MeetingEdit?id=" + id,
                width: "650px",
                height: "500px"
            });
            dynaform.showModalDialog();
        }

        function showInfo(id) {
            $("#PsnID").val(id);
            $("#f1").attr("action", "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ShowVisitorInfo");
            $("#f1").submit();
        }
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <center>
            <form id="f1" action="" method="post">
            <table width="100%" border="0" style="text-align: left" cellpadding="0" cellspacing="0" id="main">
                <tr>
                    <td>
                        <div style="border-color:#09F; border-style:solid; border-width:1px; padding:10px;">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td colspan="2"><strong>观众查询</strong></td>
                            </tr>
                            <tr>
                                <td width="300px">
                                <%
                                    string searchName = "";
                                    if (ViewData["SearchName"] != null)
                                    {
                                        searchName = Server.HtmlEncode(ViewData["SearchName"].ToString());
                                    }
                                    string searchRank = "";
                                    if (ViewData["SearchRank"] != null)
                                    {
                                        searchRank = Server.HtmlEncode(ViewData["SearchRank"].ToString());
                                    }
                                    string searchCompany = "";
                                    if (ViewData["SearchCompany"] != null)
                                    {
                                        searchCompany = Server.HtmlEncode(ViewData["SearchCompany"].ToString());
                                    }
                                %>
                                    姓名：<input type="text" class="text" id="SearchName" name="SearchName" value="<%=searchName %>" />
                                </td>
                                <td>
                                    职务：<input type="text" class="text" id="SearchRank" name="SearchRank" value="<%=searchRank %>" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    公司：<input type="text" class="text" id="SearchCompany" name="SearchCompany" value="<%=searchCompany %>" />
                                </td>
                                <td>
                                    <div class="button" onclick="Sub()">查询</div>
                                </td>
                            </tr>
                        </table>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="left">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="td01">姓名</td>
                                <td class="td01">职务</td>
                                <td class="td01">公司</td>
                                <td class="td01">是否预约</td>
                                <td class="td01">操作</td>
                            </tr>
                        <%
                            System.Data.DataTable dt = ViewData["Data"] as System.Data.DataTable;
                            if (dt.Rows.Count > 0)
                            {
                                foreach (System.Data.DataRow dr in dt.Rows)
                                {
                                    string state = "";
                                    if (Convert.ToInt32(dr["ActorMaaCount"]) > 0)
                                    {
                                        state = "<a href='" + FamousFurnitureExpo.Models.Helper.VRoot + "/Exhibitor/ShowMeetingInfo/" + dr["PsnID"] + "'>已预约</a>";
                                    }
                        %>
                            <tr>
                                <td class="td03" align="center" width="20%">
                                    <a href="javascript:;" onclick="showInfo(<%=dr["PsnID"] %>)">
                                    <%=Server.HtmlEncode(dr["PsnName"].ToString())%>
                                    </a>
                                </td>
                                <td class="td03" align="center" width="20%"><%=Server.HtmlEncode(dr["PsnRank"].ToString())%></td>
                                <td class="td03" align="left" width="30%"><%=Server.HtmlEncode(dr["PsnComName"].ToString())%></td>
                                <td class="td03" align="center" width="10%"><%=state %></td>
                                <td class="td03" align="center" width="20%">
                                    <a href="javascript:AddMatch(<%=dr["PsnID"] %>);">预约</a>
                                </td>
                            </tr>
                        <%            
                                }
                        %>
                            <tr>
                                <td colspan="8">
                                    <script type="text/javascript">
                                        PagerPost.Display("<%=ViewData["Page"] %>","<%=ViewData["PageSize"] %>","<%=ViewData["TotalNum"] %>","f1");
                                    </script>
                                </td>
                            </tr>
                        <%
                            }
                            else
                            { 
                        %>
                            <tr>
                                <td colspan="8" class="td03" align="center" valign="middle" height="40" width="100%">暂无信息</td>
                            </tr>
                        <%    
                            }
                        %>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td><input type="hidden" id="PsnID" name="PsnID" /></td>
                </tr>
            </table>
            </form>
        </center>
    </div>
</asp:Content>
