<%@ 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 () {
            selectMenu("观众需求发布及联络");

            if ($("#PdtCount").val() == "0") {
                alert("您还没有添加新品，无法查看观众发布的需求信息！");
                window.location.href = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ProductEdit?Type=Add";
                return;
            }

        });

        var dynaform;
        function MoreLink(PsjName, PsnID, SddID) {
            //alert(getScrollTop());
            var vheight = 0;
            vheight = getScrollTop() - 200;
            if (vheight < 0)
                vheight = 50;
            dynaform = new DynaForm({
                id: "dynaform",
                title: "采购需求联络信息---" + PsjName,
                src: "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/SupplyDemandLinkIndex?PsnID=" + PsnID + "&SddID=" + SddID,
                width: "400px",
                height: "450px",
                top: vheight
            });
            dynaform.showModalDialog();
        }

        function getScrollTop() {
            var scrollTop = 0;
            if (parent.document.documentElement && parent.document.documentElement.scrollTop) {
                scrollTop = parent.document.documentElement.scrollTop;
            }
            else if (parent.document.body) {
                scrollTop = parent.document.body.scrollTop;
            }
            return scrollTop;
        }

        function ChangePage(Page) {
            location.href = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/" + Page;
        }
    </script>
    <style type="text/css">
    .link1
    {
    	color:White;
	    text-decoration: none;
    }
    .link1 a
    {
        color:White;
	    text-decoration: none;
    }    
    .link1 a:link 
    {
        color:White;
	    text-decoration: none;
    }
    .link1 a:hover 
    {
        color:White;
	    text-decoration: none;
    }
    .link1 a:visited
    {
        color:White;
	    text-decoration: none;
    }
     .selectDivBottomLine
    {
        border-bottom:1px solid #F7A841;
    }
    
    .selectDiv
    {
        padding:5px;
        cursor:pointer;
    }
    .selectDivSelected
    {
        padding:5px;
        cursor:pointer;
        background-color:#F7A841;
    }
    
    </style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<div>
    <form id="f1" action="" method="post">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td align="left">
                <table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-family:Arial">
                    <tr>
                        <td align="left">
                            <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td><div class="selectDivSelected" onclick="ChangePage('SupplyDemandList')">采购需求列表</div>
                                </td>
                                <td><div class="selectDiv" onclick="ChangePage('SupplyDemandLinkList')">我联系的观众</div>
                                </td>
                            </tr>
                            </table>
                            
                        </td>
                    </tr>
                    <tr>
                        <td>
                        <div class="selectDivBottomLine"></div>
                        </td>
                    </tr>
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td align="left">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                            <% 
                                System.Data.DataTable dt = ViewData["Data"] as System.Data.DataTable;
                                if (dt != null && dt.Rows.Count > 0)
                                {
                                    foreach (System.Data.DataRow dr in dt.Rows)
                                    {
                                        string PsnName = Server.HtmlEncode(dr["PsnName"].ToString());
                                        string PsnID = Server.HtmlEncode(dr["SddSourceID"].ToString());
                                        string SddArea = Server.HtmlEncode(dr["SddArea"].ToString());
                                        string TypName = Server.HtmlEncode(dr["TypName"].ToString());
                                        string SddPurpose = Server.HtmlEncode(dr["SddPurpose"].ToString());
                                        string SddField1 = Server.HtmlEncode(dr["SddField1"].ToString());
                                        string SddRemark = Server.HtmlEncode(dr["SddRemark"].ToString());
                                        //string SddSysState = Server.HtmlEncode(dr["SddSysState"].ToString());
                                        string SddID = Server.HtmlEncode(dr["SddID"].ToString());
                                        string SddCreateTime = Server.HtmlEncode(dr["SddCreateTime"].ToString());                                             
                            %>
                                <tr>
                                    <td colspan="2">
                                        <table border="0" cellpadding="0" cellspacing="0" width="100%" style="border: solid thin #F7A841">
                                            <tr>
                                                <td style="height:100px;padding:5px" valign="top">
                                                    <table width="100%" border="0">
                                                        <tr>
                                                            <td colspan="3">
                                                                <%=SddCreateTime%>   <font color="#F7A841"><b><%=PsnName %></b></font> 发布需求：
                                                            </td>
                                                            <td align="right">
                                                                <a href="javascript:MoreLink('<%=PsnName%>','<%=PsnID%>','<%=SddID%>');">联系该观众</a>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="width:160px">
                                                                地区：<%=SddArea%>
                                                            </td>
                                                            <td style="width:200px">
                                                                分类：<%=TypName%>
                                                            </td>
                                                            <td style="width:80px">
                                                                需求：<%=SddPurpose%>
                                                            </td>
                                                            <td>
                                                                采购量：<%=SddField1%>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="4">
                                                                备注：<%=SddRemark%>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            
                                        </table>
                                        
                                    </td>
                                </tr>

                               <tr>
                                    <td colspan="2" style="height:10px">
                                    </td>
                                    </tr>


                                    <%            
                                        }
                                    %>


                                <tr><td>&nbsp;</td></tr>
                                <tr>
                                    <td>
                                        <script type="text/javascript">
                                            PagerPost.Display("<%=ViewData["Page"] %>","<%=ViewData["PageSize"] %>","<%=ViewData["TotalNum"] %>","f1");
                                        </script>
                                    </td>
                                </tr>
                            <%    
                            }
                                else
                                { 
                            %>
                                <tr>
                                    <td align="center" style="padding:6px">暂无信息</td>
                                </tr>
                            <%    
                                }
                            %>
                            </table>	
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="hidden" id="ID" name="ID" />
                            <input type="hidden" id="Type" name="Type" />
                            <input type="hidden" id="Message" name="Message" value="<%=ViewData["Message"] %>" />
                            <input type="hidden" id="PdtCount" name="PdtCount" value="<%=ViewData["PdtCount"] %>" />
                        </td>
                    </tr>
                    </table>
            </td>
        </tr>
    </table>
    </form>
</div>
</asp:Content>
