<%@ 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("客户胸卡");
            $("#mainmenu3").css("visibility", "visible");
        });
        function GoTo(str) {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/" + str;
        }
        function Add() {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ExhiVisitCardEdit?Type=Add";
        }
        function Modify(id) {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ExhiVisitCardEdit?Type=Modify&ID=" + id;
        }
        function Delete(id) {
            if (confirm("确认删除？")) {
                $("#ID").val(id);
                $("#Type").val("Delete");
                $("#f1").submit();
            }
        }

        var dynaform;
        function ShowCardStyle() {
            if ($("#CardDemo").attr("src") != "") {
                var width = $("#CardDemo").width() - 2;
                var height = $("#CardDemo").height();
                var url = $("#CardDemo").attr("src");

                dynaform = new DynaForm({
                    id: "dynaform",
                    title: "观众胸卡样式",
                    width: width + "px",
                    height: height + "px",
                    innerhtml: "<img src='" + url + "' />"
                });
                dynaform.showModalDialog();
            } else {
                MsgTip.show({ msg: "没有设置胸卡样式！", ico: "warning", top: 340 });
            }
        }
    </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 align="left">
                        <table border='0' cellpadding="0" cellspacing="0" width="100%" align="left">
                            <tr>
                                <td class="tdMenu" onclick="GoTo('ExhiActorCard')">
                                    展商胸卡
                                </td>
                                <td class="tdMenuWidth">&nbsp;</td>
                                <td class="tdMenuSelect" onclick="GoTo('ExhiVisitCard')">
                                    客户胸卡
                                </td>
                                <td class="tdMenuWidth">&nbsp;</td>
                    <% 
                        if (FamousFurnitureExpo.Models.Helper.IfShowTrafficCard(Convert.ToInt32(Session["ExhID"])))
                        {
                    %>
                                <td class="tdMenu" onclick="GoTo('ExhiTrafficCard')">
                                    货车证
                                </td>
                                <td class="tdMenuWidth">&nbsp;</td>
                    <% 
                        }    
                    %>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="tdMenuLine" colspan="7"></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td><div class="button" onclick="Add()">新增客户胸卡</div></td>
                                <td><div class="button" onclick="ShowCardStyle()">查看胸卡样式</div></td>
                            </tr>
                        </table>
                        <img id="CardDemo" src="<%=ViewData["ImageUrl"] %>" alt="" style="display:none" />
                    </td>
                </tr>
                <tr>
                    <td align="left">
                    <% 
                        List<FamousFurnitureExpo.Models.Ticket> li = ViewData["Data"] as List<FamousFurnitureExpo.Models.Ticket>;    
                    %>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="td01" width="15%" align="center">姓名</td>
                                <td class="td01" width="40%" align="center">公司名称</td>
                                <td class="td01" width="20%" align="center">职务</td>
                                <td class="td01" width="10%" align="center">操作</td>
                            </tr>
                        <% 
                            if (li.Count > 0)
                            {
                                foreach (FamousFurnitureExpo.Models.Ticket ec in li)
                                {
                        %>
                            <tr>
                                <td class="td03" align="center">
                                    <%=ec.TktName %>
                                </td>
                                <td class="td03" align="left">
                                    <%=ec.TktComName %>
                                </td>
                                <td class="td03" align="center">
                                    <%=ec.TktRank %>
                                </td>
                                <td class="td03" align="center">
                                    <a href="javascript:Modify(<%=ec.TktID %>);">修改</a>&nbsp;
                                    <a href="javascript:Delete(<%=ec.TktID %>);">删除</a>
                                </td>
                            </tr>
                        <%            
                                }
                            }
                            else
                            { 
                        %>
                            <tr>
                                <td colspan="4" class="td03" align="center" valign="middle" height="40" width="100%">暂无信息</td>
                            </tr>
                        <%    
                            }    
                        %>
                        </table>
                    </td>
                </tr>
                <tr><td>&nbsp;</td></tr>
                <tr>
                    <td>
                        <script type="text/javascript">
                            var message = "<%=ViewData["Message"] %>";
                            if (message != "") {
                                MsgTip.show({ msg: message, ico: "warning", top: 340 });
                            }
                        </script>
                        <input type="hidden" id="ID" name="ID" />
                        <input type="hidden" id="Type" name="Type" />
                    </td>
                </tr>
            </table>
            </form>
        </center>
    </div>
</asp:Content>
